[PATCH 0/1] Adding git-ignore command, tests, and documentation.

2019-07-16 Thread Thurston via GitGitGadget
git-ignore will allow users to quickly add entries to the gitignore files in the repositories. Many times, I'll have a config file or log file buried in a series of sub-directories and find it frustrating to edit the right git ignore with the right relative path to the file that i want to add. Thi

[PATCH 1/1] Adding git ignore command

2019-07-16 Thread Thurston Stone via GitGitGadget
From: Thurston Stone The 'git ignore' command modifies a .gitignore file in your path easily. By default, it adds lines to the .gitignore found in the root of your repository. It can, however, add lines to a gitignore anywhere inbetween the file(s) passed in and the root of the repository. The li

[PATCH] fetch: add "--parallel", which fetches all remotes in parallel

2019-07-16 Thread Palmer Dabbelt
I have a handful of repositories with a bunch of remotes and this week I'm on an internet connection with a high bandwidth high latency connection to those remotes. This results in "fetch --all" being painfully slow: 3-4 seconds per remote, all at almost zero link utilization (presumably doing an

Re: [RFC/PATCH] CodingGuidelines: spell out post-C89 rules

2019-07-16 Thread Bryan Turner
On Tue, Jul 16, 2019 at 10:21 AM Junio C Hamano wrote: > > Even though we have been sticking to C89, there are a few handy > features we borrow from more recent C language in our codebase after > trying them in weather balloons and saw that nobody screamed. > > Spell them out. > > While at it, ext

Re: [RFC/PATCH] CodingGuidelines: spell out post-C89 rules

2019-07-16 Thread Jonathan Nieder
Junio C Hamano wrote: > Even though we have been sticking to C89, there are a few handy > features we borrow from more recent C language in our codebase after > trying them in weather balloons and saw that nobody screamed. > > Spell them out. Thanks for this. It gives a place to advertise future

Re: [PATCH] transport-helper: avoid var decl in for () loop control

2019-07-16 Thread Jonathan Nieder
Junio C Hamano wrote: > We do allow a few selected C99 constructs in our codebase these > days, but this is not among them (yet). > > Reported-by: Carlo Arenas > Signed-off-by: Junio C Hamano > --- > transport.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Yes, gcc 4.8 fails to bu

[PATCH] submodule: plumb --filter to cloned submodules

2019-07-16 Thread Josh Steadmon
When cloning a repo with a --filter and with --recurse-submodules enabled, the partial clone filter only applies to the top-level repo. This can lead to unexpected bandwidth and disk usage for projects which include large submodules. Fix this by plumbing the --filter argument from git-clone throug

[BUG] Recursive submodules fails to track branch correctly if . is used

2019-07-16 Thread Krzysztof Opasiak
Dear git community, I'd like to report you a potential bug in git submodule implementation. * Problem statement According to doc a special value of "." can be used as a branch name to track. This means that git should trace the same branch as is currently in use in superproject. This works per

[PATCH] transport-helper: avoid var decl in for () loop control

2019-07-16 Thread Junio C Hamano
We do allow a few selected C99 constructs in our codebase these days, but this is not among them (yet). Reported-by: Carlo Arenas Signed-off-by: Junio C Hamano --- transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transport.c b/transport.c index d768bc275e..453de

Re: [PATCH] stash: fix handling removed files with --keep-index

2019-07-16 Thread Junio C Hamano
Thomas Gummerer writes: > On 07/11, Junio C Hamano wrote: >> Thomas Gummerer writes: >> >> > Fix that behaviour by using 'git restore' which can faithfully restore >> > the index and working tree. This also simplifies the code. >> >> Hmph. I would have preferred to see we stayed away from 'r

Re: [PATCH v2] stash: fix handling removed files with --keep-index

2019-07-16 Thread Junio C Hamano
Thomas Gummerer writes: > git stash push --keep-index is supposed to keep all changes that have > been added to the index, both in the index and on disk. Thanks, will queue.

Re: [PATCH] range-diff: fix some 'hdr-check' and sparse warnings

2019-07-16 Thread Jeff King
On Tue, Jul 16, 2019 at 12:01:10PM -0700, Junio C Hamano wrote: > And that "quiet and nice" form is a moral equivalent of > > struct foo foo = { 0 }; > > that has been discussed in this thread. I'd rather not to see it > turned into distinct FOO_INIT, BAR_INIT, etc. to force the reader to

Re: [PATCH 1/1] clean: show an error message when the path is too long

2019-07-16 Thread Junio C Hamano
René Scharfe writes: >> diff --git a/builtin/clean.c b/builtin/clean.c >> index aaba4af3c2..7be689f480 100644 >> --- a/builtin/clean.c >> +++ b/builtin/clean.c >> @@ -194,7 +194,8 @@ static int remove_dirs(struct strbuf *path, const char >> *prefix, int force_flag, >> strbuf_setlen(

Re: git segfault in tag verify (patch included)

2019-07-16 Thread Junio C Hamano
Jeff King writes: > Something like: > > for (line = buf; *line; line = next) { > next = strchrnul(line, '\n'); > > ... do stuff ... > /* find a space within the line */ > space = memchr(line, ' ', next - line); > } I am not sure about the memchr() thing, but "prepare

Re: [PATCH] range-diff: fix some 'hdr-check' and sparse warnings

2019-07-16 Thread Junio C Hamano
Jeff King writes: > But I'd be happy if we could address it in another way (e.g., convincing > sparse to stop complaining about it, or just decide it's not worth > dealing with). One other thing I haven't seen discussed in this thread: > we could actually make our preferred style be for all struc

Re: git segfault in tag verify (patch included)

2019-07-16 Thread Jeff King
On Tue, Jul 16, 2019 at 11:20:48AM -0700, Junio C Hamano wrote: > That is this thing. > > static void parse_gpg_output(struct signature_check *sigc) > { > const char *buf = sigc->gpg_status; > const char *line, *next; > int i, j; >

Re: git segfault in tag verify (patch included)

2019-07-16 Thread Steven Roberts
Thanks. I hope this works ok for you (see attached). On Tue, Jul 16, 2019 at 11:20 AM Junio C Hamano wrote: > > Steven Roberts writes: > > > I believe I have found an off-by-one error in git. > > > > Please see https://marc.info/?l=openbsd-ports&m=156326783610123&w=2 > > That is this thing. > >

Re: [PATCH v3 00/11] git add -i: add a rudimentary version in C (supporting only status and help so far)

2019-07-16 Thread Johannes Schindelin
Hi Junio, On Tue, 16 Jul 2019, Johannes Schindelin via GitGitGadget wrote: > This is the first leg on the long journey to a fully built-in git add -i > (next up: parts 2 [https://github.com/gitgitgadget/git/pull/171], 3 > [https://github.com/gitgitgadget/git/pull/172], 4 > [https://github.com/gi

Re: git segfault in tag verify (patch included)

2019-07-16 Thread Junio C Hamano
Steven Roberts writes: > I believe I have found an off-by-one error in git. > > Please see https://marc.info/?l=openbsd-ports&m=156326783610123&w=2 That is this thing. static void parse_gpg_output(struct signature_check *sigc) { const char *buf = sigc->gpg_status

Re: Weird behavior with git grep --recurse-submodules

2019-07-16 Thread Daniel Zaoui
Hi Matheus, Thank you for your response. I really hope the change Brandon made is not a project decision. At least, it does seem to me like a bug. How do you recommend me to solve this issue? Is there some place where I can check if some bug ticket has been created on this matter? I didn't fin

Re: [PATCH v2] transport-helper: enforce atomic in push_refs_with_push

2019-07-16 Thread Carlo Arenas
On Tue, Jul 16, 2019 at 9:54 AM Junio C Hamano wrote: > > Does everything else compile OK with your rather old compiler on > Centos 6? yes, they were a few -Wmaybe-uninitialized warnings but they were most likely false positives. gcc 4.4.7 aborts the build (even without -Werror) with the followi

git segfault in tag verify (patch included)

2019-07-16 Thread Steven Roberts
Hi, I believe I have found an off-by-one error in git. Please see https://marc.info/?l=openbsd-ports&m=156326783610123&w=2

Re: [PATCH] documentation: add tutorial for revision walking

2019-07-16 Thread Junio C Hamano
Emily Shaffer writes: > I have been in a position of reviewing diff-of-.patch in a past life, > albeit via Gerrit, and it's not the worst when the code is simple (as we > should always hope this example tutorial code would be). I personally think a directory full of patch files is OK. I am not

[RFC/PATCH] CodingGuidelines: spell out post-C89 rules

2019-07-16 Thread Junio C Hamano
Even though we have been sticking to C89, there are a few handy features we borrow from more recent C language in our codebase after trying them in weather balloons and saw that nobody screamed. Spell them out. While at it, extend the existing variable declaration rule a bit to read better with t

Re: [PATCH v2] transport-helper: enforce atomic in push_refs_with_push

2019-07-16 Thread Junio C Hamano
Carlo Arenas writes: > On Tue, Jul 9, 2019 at 2:16 PM Emily Shaffer wrote: >> >> diff --git a/transport.c b/transport.c >> index f1fcd2c4b0..d768bc275e 100644 >> --- a/transport.c >> +++ b/transport.c >> @@ -1226,6 +1226,19 @@ int transport_push(struct repository *r, >> err = pus

Re: [PATCH 1/1] clean: show an error message when the path is too long

2019-07-16 Thread SZEDER Gábor
On Tue, Jul 16, 2019 at 07:04:23AM -0700, Johannes Schindelin via GitGitGadget wrote: > +test_expect_success MINGW 'handle clean & core.longpaths = false nicely' ' > + git config core.longpaths false && > + test_when_finished git config --unset core.longpaths && 'test_config core.longpath

Re: [PATCH 1/1] clean: show an error message when the path is too long

2019-07-16 Thread René Scharfe
Am 16.07.19 um 16:04 schrieb Johannes Schindelin via GitGitGadget: > From: Johannes Schindelin > > Without an error message when stat() failed, e.g. `git clean` would > abort without an error message, leaving the user quite puzzled. > > In particular on Windows, where the default maximum path leng

[PATCH v3 11/11] built-in add -i: implement the `help` command

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This imitates the code to show the help text from the Perl script `git-add--interactive.perl` in the built-in version. To make sure that it renders exactly like the Perl version of `git add -i`, we also add a test case for that to `t3701-add-interactive.sh`. Signed-off

[PATCH v3 10/11] built-in add -i: use color in the main loop

2019-07-16 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic The error messages as well as the unique prefixes are colored in `git add -i` by default; We need to do the same in the built-in version. Signed-off-by: Slavica Djukic Signed-off-by: Johannes Schindelin --- add-interactive.c | 37 - 1 f

[PATCH v3 00/11] git add -i: add a rudimentary version in C (supporting only status and help so far)

2019-07-16 Thread Johannes Schindelin via GitGitGadget
This is the first leg on the long journey to a fully built-in git add -i (next up: parts 2 [https://github.com/gitgitgadget/git/pull/171], 3 [https://github.com/gitgitgadget/git/pull/172], 4 [https://github.com/gitgitgadget/git/pull/173], 5 [https://github.com/gitgitgadget/git/pull/174], and 6 [ht

[PATCH v3 06/11] built-in add -i: implement the main loop

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The reason why we did not start with the main loop to begin with is that it is the first user of `list_and_choose()`, which uses the `list()` function that we conveniently introduced for use by the `status` command. Apart from the "and choose" part, there are more diffe

[PATCH v3 08/11] built-in add -i: show unique prefixes of the commands

2019-07-16 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic Just like in the Perl script `git-add--interactive.perl`, for each command a unique prefix is determined (if there exists any within the given parameters), and shown in the list, and accepted as a shortcut for the command. We use the prefix map implementation that we just ad

[PATCH v3 09/11] built-in add -i: support `?` (prompt help)

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin With this change, we print out the same colored help text that the Perl-based `git add -i` prints in the main loop when question mark is entered. Signed-off-by: Johannes Schindelin --- add-interactive.c | 22 +- 1 file changed, 21 insertions(+), 1

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

2019-07-16 Thread Slavica Djukic via GitGitGadget
From: Slavica Djukic 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 implementation: in Perl, a trie is much easier implemented, while we alrea

[PATCH v3 03/11] built-in add -i: implement the `status` command

2019-07-16 Thread Daniel Ferreira via GitGitGadget
From: Daniel Ferreira This implements the `status` command of `git add -i`. The data structures introduced in this commit will be extended as needed later. At this point, we re-implement only part of the `list_and_choose()` function of the Perl script `git-add--interactive.perl` and call it `lis

[PATCH v3 01/11] Start to implement a built-in version of `git add --interactive`

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This is hardly the first conversion of a Git command that is implemented as a script to a built-in. So far, the most successful strategy for such conversions has been to add a built-in helper and call that for more and more functionality from the script, as more and more

[PATCH v3 04/11] built-in add -i: refresh the index before running `status`

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This is what the Perl version does, and therefore it is what the built-in version should do, too. Signed-off-by: Johannes Schindelin --- add-interactive.c | 4 +++- repository.c | 19 +++ repository.h | 7 +++ 3 files changed, 29 insert

[PATCH v3 02/11] diff: export diffstat interface

2019-07-16 Thread Daniel Ferreira via GitGitGadget
From: Daniel Ferreira Make the diffstat interface (namely, the diffstat_t struct and compute_diffstat) no longer be internal to diff.c and allow it to be used by other parts of git. This is helpful for code that may want to easily extract information from files using the diff machinery, while fl

[PATCH v3 05/11] built-in add -i: color the header in the `status` command

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin For simplicity, we only implemented the `status` command without colors. This patch starts adding color, matching what the Perl script `git-add--interactive.perl` does. Original-Patch-By: Daniel Ferreira Signed-off-by: Slavica Djukic Signed-off-by: Johannes Schindelin

[PATCH v2] stash: fix handling removed files with --keep-index

2019-07-16 Thread Thomas Gummerer
git stash push --keep-index is supposed to keep all changes that have been added to the index, both in the index and on disk. Currently this doesn't behave correctly when a file is removed from the index. Instead of keeping it deleted on disk, --keep-index currently restores the file. Fix that b

[PATCH 0/1] Show an error if too-long paths are seen by git clean -dfx

2019-07-16 Thread Johannes Schindelin via GitGitGadget
This is particularly important on Windows, where PATH_MAX is very small compared to Unix/Linux. Johannes Schindelin (1): clean: show an error message when the path is too long builtin/clean.c | 3 ++- t/t7300-clean.sh | 11 +++ 2 files changed, 13 insertions(+), 1 deletion(-) base-

[PATCH 1/1] clean: show an error message when the path is too long

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Without an error message when stat() failed, e.g. `git clean` would abort without an error message, leaving the user quite puzzled. In particular on Windows, where the default maximum path length is quite small (yet there are ways to circumvent that limit in many cases)

[PATCH 0/1] mingw: support spawning programs with paths containing spacesnames

2019-07-16 Thread Johannes Schindelin via GitGitGadget
This is a patch to support older Windows versions (e.g. Windows 7) better. I know, I know, Windows 7's End-Of-Life is now less than half a year away, but... I am unsure just how long Git for Windows will support Windows 7 beyond its officially-supported life; We still support Windows Vista, after

[PATCH 1/1] mingw: support spawning programs containing spaces in their names

2019-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin On some older Windows versions (e.g. Windows 7), the CreateProcessW() function does not really support spaces in its first argument, lpApplicationName. But it supports passing NULL as lpApplicationName, which makes it figure out the application from the (possibly quoted)

Re: [PATCH] stash: fix handling removed files with --keep-index

2019-07-16 Thread Thomas Gummerer
On 07/11, Junio C Hamano wrote: > Thomas Gummerer writes: > > > Fix that behaviour by using 'git restore' which can faithfully restore > > the index and working tree. This also simplifies the code. > > Hmph. I would have preferred to see we stayed away from 'restore' > (and used 'checkout' ins

Re: [PATCH v2] transport-helper: enforce atomic in push_refs_with_push

2019-07-16 Thread Carlo Arenas
On Tue, Jul 9, 2019 at 2:16 PM Emily Shaffer wrote: > > diff --git a/transport.c b/transport.c > index f1fcd2c4b0..d768bc275e 100644 > --- a/transport.c > +++ b/transport.c > @@ -1226,6 +1226,19 @@ int transport_push(struct repository *r, > err = push_had_errors(remote_refs); >