Re: [PATCH] fast-import: Reinitialize command_buf rather than detach it.

2019-08-24 Thread Jeff King
On Sun, Aug 25, 2019 at 01:13:48PM +0900, Mike Hommey wrote: > command_buf.buf is also stored in cmd_hist, so instead of > strbuf_release, the current code uses strbuf_detach in order to > "leak" the buffer as far as the strbuf is concerned. > > However, strbuf_detach does more than "leak" the st

[PATCH] notes: avoid leaking duplicate entries

2019-08-24 Thread Mike Hommey
When add_note is called multiple times with the same key/value pair, the leaf_node it creates is leaked by notes_tree_insert. --- notes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notes.c b/notes.c index 75c028b300..ec35f5b551 100644 --- a/notes.c +++ b/notes.c @@ -269

[PATCH] fast-import: Reinitialize command_buf rather than detach it.

2019-08-24 Thread Mike Hommey
command_buf.buf is also stored in cmd_hist, so instead of strbuf_release, the current code uses strbuf_detach in order to "leak" the buffer as far as the strbuf is concerned. However, strbuf_detach does more than "leak" the strbuf buffer: it possibly reallocates it to ensure a terminating nul char

[PATCH] fix segv with corrupt tag object

2019-08-24 Thread Stefan Sperling
A tag object which lacks newlines won't be parsed correctly. Git fails to detect this error and crashes due to a NULL deref: $ git archive 1.0.0 Segmentation fault (core dumped) $ git checkout 1.0.0 Segmentation fault (core dumped) $ See the attached tarball for a reproduction repository. Also mi

[PATCH 0/1] mingw: handle non-ASCII PATH components correctly

2019-08-24 Thread Johannes Schindelin via GitGitGadget
We need to be careful on Windows: there are "ANSI" versions of the API functions that take char *, and "Unicode" versions that take "wchar_t ` strings as parameters. The ANSI versions are subject to the current codepage, i.e. almost guaranteed to *not handle UTF-8. Internally, we do want to use UTF

[PATCH 1/1] mingw: fix launching of externals from Unicode paths

2019-08-24 Thread Adam Roben via GitGitGadget
From: Adam Roben If Git were installed in a path containing non-ASCII characters, commands such as `git am` and `git submodule`, which are implemented as externals, would fail to launch with the following error: > fatal: 'am' appears to be a git command, but we were not > able to execute it. May

[PATCH 0/1] Do use ALL_CFLAGS in hdr-check

2019-08-24 Thread Johannes Schindelin via GitGitGadget
When I was playing with the Makefile target hdr-check, it looked as if it missed the correct CFLAGS. Without them, on Windows an attempt is made to include syslog.h, which does not make sense at all. This patch addresses that. Johannes Schindelin (1): hdr-check: make it work on Windows Makefi

[PATCH 1/1] hdr-check: make it work on Windows

2019-08-24 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin On Windows, we define a specific set of pre-processor macros, among other reasons: to avoid including syslog.h (which is not available on Windows). The hdr-check target did not use those definitions, resulting in a failure to include said syslog.h. To fix that, let's l

[PATCH 3/3] setup_git_directory(): handle UNC root paths correctly

2019-08-24 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When working in the root directory of a file share (this is only possible in Git Bash and Powershell, but not in CMD), the current directory is reported without a trailing slash. This is different from Unix and standard Windows directories: both / and C:\ are reported w

[PATCH 0/3] Handle worktrees at the top of a network drive

2019-08-24 Thread Johannes Schindelin via GitGitGadget
Windows' network drive concept is a quite useful and versatile one. Once authenticated, one can even change the working directory to a network drive (cd \\server\share, works in PowerShell and Git Bash). Some users want to have their Git repositories there, and with these patches, that works, even

[PATCH 2/3] Fix .git/ discovery at the root of UNC shares

2019-08-24 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin A very common assumption in Git's source code base is that offset_1st_component() returns either 0 for relative paths, or 1 for absolute paths that start with a slash. In other words, the return value is either 0 or points just after the dir separator. This assumption i

[PATCH 1/3] setup_git_directory(): handle UNC paths correctly

2019-08-24 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The first offset in a UNC path is not the host name, but the folder name after that. This fixes https://github.com/git-for-windows/git/issues/1181 Signed-off-by: Johannes Schindelin --- setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setu

[PATCH 1/1] mingw: support UNC in git clone file://server/share/repo

2019-08-24 Thread Torsten Bögershausen via GitGitGadget
From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Extend the parser to accept file://server/share/repo in the way that Windows users expect it to be parsed who are used to referring to file shares by UNC paths of the form \\server\share\folder. [jes: tightened check to avoid handling file://C:/some/

[PATCH 0/1] mingw: support UNC as file://server/share/repo

2019-08-24 Thread Johannes Schindelin via GitGitGadget
Windows users might think that the common file:/// protocol also works for network shares. This patch makes it so. Torsten Bögershausen (1): mingw: support UNC in git clone file://server/share/repo connect.c | 4 t/t5500-fetch-pack.sh | 13 +++-- 2 files changed, 15 i

Re: [RFC] Add config option corresponding to --rebase-merges

2019-08-24 Thread Dakota Hawkins
I think it would also be prudent to add the following: # Auto-config option values for new branches branch.autoSetupRebase= + localCousins + remoteCousins + alwaysCousins

Re: [Question] clone performance

2019-08-24 Thread Bryan Turner
On Fri, Aug 23, 2019 at 6:59 PM wrote: > > Hi All, > > I'm trying to answer a question for a customer on clone performance. They > are doing at least 2-3 clones a day, of repositories with about 2500 files > and 10Gb of content. This is stressing the file system. Can you go into a bit more detail

Re: [BUG] You can't have single quote in your username

2019-08-24 Thread Giuseppe Crinò
On Fri, Aug 23, 2019 at 10:29:00AM +0200, SZEDER Gábor wrote: > What I wonder is whether we really have to remove crud from the user > name if it comes from the configuration. Yes. If the primary use of removing crud is to remove quotes from a quoted name (as in `From: 'Foo baz Bar'`) why not dire

Official request

2019-08-24 Thread Jon
<<< No Message Collected >>>

Re: [PATCH v3 13/13] format-patch: learn --infer-cover-subject option

2019-08-24 Thread Philip Oakley
On 24/08/2019 09:03, Denton Liu wrote: On Fri, Aug 23, 2019 at 01:18:44PM -0700, Junio C Hamano wrote: Philip Oakley writes: Perhaps the `--infer-cover-subject` the config option needs to be multi-valued to include: "subject" (always expect short first lines) or "message" (always

Re: [PATCH] grep: under --debug, show whether PCRE JIT is enabled

2019-08-24 Thread Carlo Arenas
On Mon, Aug 19, 2019 at 3:23 PM Junio C Hamano wrote: > > There may be others I am missing. should we still support PCRE1? I think in this case the problem is compounded by the fact that unless we do something like [1], the real fix for those UTF-8 validation issues will require a yet unreleased

Re: [PATCH v3 07/11] Add a function to determine unique prefixes for a list of strings

2019-08-24 Thread SZEDER Gábor
On Tue, Jul 16, 2019 at 07:58:42AM -0700, Slavica Djukic via GitGitGadget wrote: > In the `git add -i` command, we show unique prefixes of the commands and > files, to give an indication what prefix would select them. > > Naturally, the C implementation looks a lot different than the Perl > implem

[PATCH 0/2] completion: complete --skip for cherry-pick and revert

2019-08-24 Thread Denton Liu
Before, the completion script would not complete `--skip` for cherry-pick and revert, even though it is a valid option while that operation is in progress. Add that missing completion. Denton Liu (2): completion: merge options for cherry-pick and revert completion: add --skip for cherry-pick

[PATCH 1/2] completion: merge options for cherry-pick and revert

2019-08-24 Thread Denton Liu
Since revert and cherry-pick share the same sequencer code, they should both accept the same command-line options. Merge the `__git_cherry_pick_inprogress_options` and `__git_revert_inprogress_options` variables together into `__git_cherry_pick_revert_inprogress_options` so that the options aren't

[PATCH 2/2] completion: add --skip for cherry-pick and revert

2019-08-24 Thread Denton Liu
Even though `--skip` is a valid command-line option for cherry-pick and revert while they are in progress, it is not completed. Add this missing option to the completion script. Signed-off-by: Denton Liu --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH 00/13] format-patch: clean up tests and documentation

2019-08-24 Thread Denton Liu
On Sat, Aug 24, 2019 at 04:25:17AM -0400, Denton Liu wrote: > *** BLURB HERE *** Whoops, perhaps we also need a configuration option for turning this off as well ;) > > As one of the older parts of the Git, the tests and documentation for > format-patch have been needing cleanup for a while. Let

[PATCH 13/13] config/format.txt: specify default value of format.coverLetter

2019-08-24 Thread Denton Liu
Signed-off-by: Denton Liu --- Documentation/config/format.txt| 1 + Documentation/git-format-patch.txt | 12 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt index 414a5a8a9d..cb629fa769 100644 --- a

[PATCH 05/13] t4014: remove spaces after redirect operators

2019-08-24 Thread Denton Liu
For shell scripts, the usual convention is for there to be no space after redirection operators, (e.g. `>file`, not `> file`). Remove these spaces wherever they appear. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 62 - 1 file changed, 31 insert

[PATCH 12/13] Doc: add more detail for git-format-patch

2019-08-24 Thread Denton Liu
In git-format-patch.txt, we were missing some key user information. First of all, document the special value of `--base=auto`. Next, while we're at it, surround option arguments with <>. Finally, document the `format.outputDirectory` config and change `format.coverletter` to use camel case. Sign

[PATCH 09/13] t4014: use test_line_count() where possible

2019-08-24 Thread Denton Liu
Convert all instances of `cnt=$(... | wc -l) && test $cnt = N` into uses of `test_line_count()`. While we're at it, convert one instance of a Git command upstream of a pipe into two commands. This prevents a failure of a Git command from being masked since only the return code of the last member o

[PATCH 04/13] t4014: use sq for test case names

2019-08-24 Thread Denton Liu
The usual convention is for test case names to be written between single-quotes. Change all double-quoted test case names to single-quotes except for one test case name that uses a sq for a contraction. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 10 +- 1 file changed, 5 inse

[PATCH 01/13] t4014: drop unnecessary blank lines from test cases

2019-08-24 Thread Denton Liu
Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 47 - 1 file changed, 47 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index ca7debf1d4..3ed3feabfe 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@

[PATCH 03/13] t4014: move closing sq onto its own line

2019-08-24 Thread Denton Liu
The usual convention for test cases is for the closing sq to be on its own line. Move the sq onto its own line for cases that do not conform to this style. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t4014-form

[PATCH 08/13] t4014: let sed open its own files

2019-08-24 Thread Denton Liu
In some cases, we were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files and provides better error messages on IO failure, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu --- t/t4014-format-patc

[PATCH 07/13] t4014: drop redirections to /dev/null

2019-08-24 Thread Denton Liu
Since output is silenced when running without `-v` and debugging output is useful with `-v`, remove redirections to /dev/null as it is not useful. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t4014-format

[PATCH 02/13] t4014: s/expected/expect/

2019-08-24 Thread Denton Liu
For test cases, the usual convention is to name expected output files "expect", not "expected". Replace all instances of "expected" with "expect" except for one case where the "expected" is used as the name of a test case. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 106 +

[PATCH 10/13] t4014: remove confusing pipe in check_threading()

2019-08-24 Thread Denton Liu
In check_threading(), there was a Git command in the upstream of a pipe. In order to not lose its status code, it was saved into a file. However, this may be confusing so rewrite to redirect IO to file. This allows us to directly use the conventional &&-chain. Signed-off-by: Denton Liu --- t/t40

[PATCH 06/13] t4014: use indentable here-docs

2019-08-24 Thread Denton Liu
The convention is to use indentable here-docs within test cases so that the here-docs line up with the rest of the code within the test case. Change here-docs from `<<\EOF` to `<<-\EOF` so that they can be indented along with the rest of the test case. Signed-off-by: Denton Liu --- t/t4014-forma

[PATCH 11/13] t4014: stop losing return codes of git commands

2019-08-24 Thread Denton Liu
Currently, there are two ways where the return codes of Git commands are lost. The first way is when a command is in the upstream of a pipe. In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no

[PATCH 00/13] format-patch: clean up tests and documentation

2019-08-24 Thread Denton Liu
*** BLURB HERE *** As one of the older parts of the Git, the tests and documentation for format-patch have been needing cleanup for a while. Let's do that in this patchset! This patchset is based on v3 of "format-patch: learn --infer-cover-subject option (also t4014 cleanup)"[1]. Changes since v

Re: [PATCH v2 0/4] git-gui: Add ability to revert selected hunks and lines

2019-08-24 Thread Johannes Sixt
Am 24.08.19 um 08:57 schrieb Bert Wesarg: > On Sat, Aug 24, 2019 at 1:43 AM David Aguilar wrote: >> On the other hand, if I had to actually move my hand over to a mouse or >> trackpad and actually "click" on something then I would be super >> annoyed. That would be simply horrible with RSI in min

Re: [PATCH v3 13/13] format-patch: learn --infer-cover-subject option

2019-08-24 Thread Denton Liu
On Fri, Aug 23, 2019 at 01:18:44PM -0700, Junio C Hamano wrote: > Philip Oakley writes: > > > Perhaps the `--infer-cover-subject` the config option needs to be > > multi-valued to include: > > "subject" (always expect short first lines) or > > "message" (always the long paragraph descri

Re: [PATCH v2 0/4] git-gui: Add ability to revert selected hunks and lines

2019-08-24 Thread David Aguilar
On Sat, Aug 24, 2019 at 08:57:22AM +0200, Bert Wesarg wrote: > On Sat, Aug 24, 2019 at 1:43 AM David Aguilar wrote: > > On the other hand, if I had to actually move my hand over to a mouse or > > trackpad and actually "click" on something then I would be super > > annoyed. That would be simply ho