Re: [PATCH v2] completion: reduce overhead of clearing cached --options

2018-06-06 Thread Jonathan Nieder
Hi, SZEDER Gábor wrote: > Other Bash versions, notably 4.4.19 on macOS via homebrew (i.e. a > newer version on the same platform) and 3.2.25 on CentOS (i.e. a > slightly earlier version, though on a different platform) are not > affected. ZSH in macOS (the versions shipped by default or

Re: [RFC PATCH 7/7] merge: fix misleading pre-merge check documentation

2018-06-06 Thread Elijah Newren
On Sat, Jun 2, 2018 at 11:58 PM, Elijah Newren wrote: > builtin/merge.c contains this important requirement for merge strategies: > > ...the index must be in sync with the head commit. The strategies are > responsible to ensure this. > > However, Documentation/git-merge.txt says: > >

Re: [PATCH] git-rebase--merge: modernize "git-$cmd" to "git $cmd"

2018-06-06 Thread Elijah Newren
On Wed, Jun 6, 2018 at 10:06 PM, Elijah Newren wrote: > > I tend to think git-rebase--merge is less popular than the other rebase > types, leading to it being more overlooked and less well tested than the > other ones. This git-$cmd usage seems to support that argument. > > Anyway, this patch

Re: [PATCH 1/1] merge-recursive: give notice when submodule commit gets fast-forwarded

2018-06-06 Thread Elijah Newren
Hi Leif, On Mon, Jun 4, 2018 at 11:48 AM, Leif Middelschulte wrote: > From: Leif Middelschulte > > Since submodules are treated similarly to ordinary files (i.e. not as 'dumb' > pointers), an automatic merge should be mentioned if the user asks for it. > Just as it is mentioned for oridnary

[RFC PATCH 0/2] contrib/credential/netrc Makefile & test improvements

2018-06-06 Thread Todd Zullinger
Hi, I noticed failures from the contrib/credential/netrc tests while building 2.18.0 release candidates. I was surprised to see the tests being run when called with a simple 'make' command. The first patch in the series adds an empty 'all::' make target to match most of our other Makefiles and

[RFC PATCH 1/2] git-credential-netrc: make "all" default target of Makefile

2018-06-06 Thread Todd Zullinger
Running "make" in contrib/credential/netrc should run the "all" target rather than the "test" target. Add an empty "all::" target like most of our other Makefiles. Signed-off-by: Todd Zullinger --- contrib/credential/netrc/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git

[RFC PATCH 2/2] git-credential-netrc: use in-tree Git.pm for tests

2018-06-06 Thread Todd Zullinger
The netrc test.pl script calls git-credential-netrc which imports the Git module. Pass GITPERLLIB to git-credential-netrc via PERL5LIB to ensure the in-tree Git module is used for testing. Signed-off-by: Todd Zullinger --- contrib/credential/netrc/test.pl | 3 +++ 1 file changed, 3

Re: [PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh

2018-06-06 Thread Jonathan Nieder
Hi, Rick van Hattem wrote: > On 4 June 2018 at 05:40, Junio C Hamano wrote: >> Overlong line, lack of sign-off. > > Apologies for the long lines, I wrote the message on Github where this > message is properly formatted, apparently the submitgit script can be > considered broken as it truncates

[PATCH 1/2] t3418: add testcase showing problems with rebase -i and strategy options

2018-06-06 Thread Elijah Newren
We are not passing the same args to merge strategies when we are doing an --interactive rebase as we do with a --merge rebase. The merge strategy should not need to be aware of which type of rebase is in effect. Add a testcase which checks for the appropriate args. Signed-off-by: Elijah Newren

[PATCH 2/2] Fix use of strategy options with interactive rebases

2018-06-06 Thread Elijah Newren
git-rebase.sh wrote stuff like '--ours' '--renormalize' to .git/rebase-merge/strategy_opts. Note the double spaces. git-rebase--interactive uses sequencer.c to parse that file, and sequencer.c used split_cmdline() to get the individual strategy options. After splitting, sequencer.c prefixed

[PATCH 2/2] git-rebase: error out when incompatible options passed

2018-06-06 Thread Elijah Newren
git rebase has three different types: am, merge, and interactive, all of which are implemented in terms of separate scripts. am builds on git-am, merge builds on git-merge-recursive, and interactive builds on git-cherry-pick. We make use of features in those lower-level commands in the different

[PATCH] git-rebase.sh: handle keep-empty like all other options

2018-06-06 Thread Elijah Newren
Signed-off-by: Elijah Newren --- git-rebase.sh | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index 40be59ecc4..a56b286372 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -276,6 +276,7 @@ do ;; --keep-empty)

[PATCH 1/2] t3422: new testcases for checking when incompatible options passed

2018-06-06 Thread Elijah Newren
git rebase is split into three types: am, merge, and interactive. Various options imply different types, and which mode we are using determine which sub-script (git-rebase--$type) is executed to finish the work. Not all options work with all types, so add tests for combinations where we expect

[PATCH] git-rebase--merge: modernize "git-$cmd" to "git $cmd"

2018-06-06 Thread Elijah Newren
I tend to think git-rebase--merge is less popular than the other rebase types, leading to it being more overlooked and less well tested than the other ones. This git-$cmd usage seems to support that argument. Anyway, this patch may be irrelevant if others agree with my goal to delete

[PATCH] t5407: fix test to cover intended arguments

2018-06-06 Thread Elijah Newren
Test 8 in t5407 appears to be an accidental exact duplicate of of test 5; the testcode is identical and has identical repo state, but the test description is different and suggests that rebase -m followed by rebase --skip was what was actually supposed to be tested. Modify the test to include the

[PATCH] apply: fix grammar error in comment

2018-06-06 Thread Elijah Newren
Signed-off-by: Elijah Newren --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply.c b/apply.c index d79e61591b..85f2c92740 100644 --- a/apply.c +++ b/apply.c @@ -4053,7 +4053,7 @@ static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid)

[PATCH] t3401: add directory rename testcases for rebase and am

2018-06-06 Thread Elijah Newren
Add a simple directory rename testcase, in conjunction with each of the types of rebases: git-rebase--interactive git-rebase--am git-rebase--merge and also use the same testcase for git am --3way This demonstrates an inconsistency between the different rebase backends and which can detect

RFC: rebase inconsistency in 2.18 -- course of action?

2018-06-06 Thread Elijah Newren
Hi everyone, We've got a small rebase problem; I'm curious for thoughts about the best course of action. I'll provide several options below. In short, while interactive-based and merge-based rebases handle directory rename detection fine, am-based rebases do not. This inconsistency may

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 10:23:53PM -0400, Jeff King wrote: > Though maybe I am wrong that the remote-svn stuff requires python. I > thought it did, but poking around, it looks like it's all C, and just > the "svnrdump_sim" helper is python. I think I was getting this mixed up with the

Re: [PATCH 01/10] t: add tool to translate hash-related values

2018-06-06 Thread Jeff King
On Thu, Jun 07, 2018 at 12:57:04AM +, brian m. carlson wrote: > > > Unless I'm wrong, we don't use the "local" keyword ? > > > > We've got a test balloon out; see 01d3a526ad (t: check whether the > > shell supports the "local" keyword, 2017-10-26). I think it's reasonable > > to consider

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 09:49:09PM -0400, Todd Zullinger wrote: > Ramsay Jones wrote: > [...] > > I don't run the p4 or svn tests, so ... :-D > > Heh, lucky you. :) > > I try to run them all as part of the fedora builds since > they cover much more than I'd ever use. That's the main > reason I

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Thu, Jun 07, 2018 at 01:16:14AM +0100, Ramsay Jones wrote: > > Probably. We may want to go the same route as we did for perl in > > a0e0ec9f7d (t: provide a perl() function which uses $PERL_PATH, > > 2013-10-28) so that test writers don't have to remember this. > > > > That said, I wonder if

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Todd Zullinger
Ramsay Jones wrote: [...] > I don't run the p4 or svn tests, so ... :-D Heh, lucky you. :) I try to run them all as part of the fedora builds since they cover much more than I'd ever use. That's the main reason I noticed the bare python. That would trip me up when it came time to build on a

Re: GDPR compliance best practices?

2018-06-06 Thread David Lang
I'm going to take the risk of inserting actual real-world data into the mix rather than just speculation :-) Here is an example of that the Rsyslog project is doing (main developers based in Germany). I'll say as someone who's day job has been very involved with GDPR stuff recently, this

Hi

2018-06-06 Thread Robert Lee
Am a United State Army here in Afghanistan, am seeking your help to evacuate the sum of $ 7,000,000 to you as long as I am assured it will be safe That in your care Until I complete my service here in Afghanistan. This is not stolen money and there are no dangers involved. I count on your

Re: [PATCH 04/10] t0027: use $ZERO_OID

2018-06-06 Thread brian m. carlson
On Wed, Jun 06, 2018 at 09:02:23AM +0200, Torsten Bögershausen wrote: > Nothing wrong with the patch. > There is, however, a trick in t0027 to transform the different IDs back to a > bunch of '0'. > The content of the file use only uppercase letters, and all lowercase ad > digits > are converted

Re: [PATCH 01/10] t: add tool to translate hash-related values

2018-06-06 Thread brian m. carlson
On Wed, Jun 06, 2018 at 04:58:46PM -0400, Jeff King wrote: > On Wed, Jun 06, 2018 at 08:19:27AM +0200, Torsten Bögershausen wrote: > > > > +test_translate_f_ () { > > > + local file="$TEST_DIRECTORY/translate/$2" && > > > > Unless I'm wrong, we don't use the "local" keyword ? > > We've got a

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Ramsay Jones
On 06/06/18 22:03, Jeff King wrote: > On Wed, Jun 06, 2018 at 01:10:52PM -0400, Todd Zullinger wrote: > >> g...@jeffhostetler.com wrote: >>> +# As a sanity check, ask Python to parse our generated JSON. Let Python >>> +# recursively dump the resulting dictionary in sorted order. Confirm that

Re: git rm bug

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Timothy Rice wrote: >> It does seem like something which could be noted in the git >> rm docs. Perhaps you'd care to take a stab at a patch to >> add a note to Documentation/git-rm.txt Thomas? Maybe a note >> at the end of the DISCUSSION section? > > That same

Re: git rm bug

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Thomas Fischer wrote: > I agree that the entire chain of empty directories should not be > tracked, as git tracks content, not files. > > However, when I run 'rm path/to/some/file', I expect path/to/some/ to > still exist. > > Similarly, when I run 'git rm

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Brandon Williams
On 06/07, Ævar Arnfjörð Bjarmason wrote: > > On Wed, Jun 06 2018, Brandon Williams wrote: > > > On 06/05, Ævar Arnfjörð Bjarmason wrote: > >> > >> On Tue, Jun 05 2018, Brandon Williams wrote: > >> > >> > +uploadpack.allowRefInWant:: > >> > +If this option is set, `upload-pack` will

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Brandon Williams wrote: > On 06/05, Ævar Arnfjörð Bjarmason wrote: >> >> On Tue, Jun 05 2018, Brandon Williams wrote: >> >> > +uploadpack.allowRefInWant:: >> > + If this option is set, `upload-pack` will support the `ref-in-want` >> > + feature of the protocol version 2

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Brandon Williams
On 06/05, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jun 05 2018, Brandon Williams wrote: > > > +uploadpack.allowRefInWant:: > > + If this option is set, `upload-pack` will support the `ref-in-want` > > + feature of the protocol version 2 `fetch` command. > > + > > I think it makes sense to

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff Hostetler
On 6/6/2018 5:03 PM, Jeff King wrote: On Wed, Jun 06, 2018 at 01:10:52PM -0400, Todd Zullinger wrote: g...@jeffhostetler.com wrote: +# As a sanity check, ask Python to parse our generated JSON. Let Python +# recursively dump the resulting dictionary in sorted order. Confirm that +# that

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff Hostetler
On 6/6/2018 1:10 PM, Todd Zullinger wrote: g...@jeffhostetler.com wrote: +# As a sanity check, ask Python to parse our generated JSON. Let Python +# recursively dump the resulting dictionary in sorted order. Confirm that +# that matches our expectations. +test_expect_success PYTHON 'parse

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 01:10:52PM -0400, Todd Zullinger wrote: > g...@jeffhostetler.com wrote: > > +# As a sanity check, ask Python to parse our generated JSON. Let Python > > +# recursively dump the resulting dictionary in sorted order. Confirm that > > +# that matches our expectations. > >

Re: [PATCH 01/10] t: add tool to translate hash-related values

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 08:19:27AM +0200, Torsten Bögershausen wrote: > > +test_translate_f_ () { > > + local file="$TEST_DIRECTORY/translate/$2" && > > Unless I'm wrong, we don't use the "local" keyword ? We've got a test balloon out; see 01d3a526ad (t: check whether the shell supports

[PATCH v2 8/8] negotiator/default: use better style in comments

2018-06-06 Thread Jonathan Tan
Signed-off-by: Jonathan Tan --- negotiator/default.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/negotiator/default.c b/negotiator/default.c index b8f45cf78..a9e52c943 100644 --- a/negotiator/default.c +++ b/negotiator/default.c @@ -46,11 +46,10 @@ static

[PATCH v2 5/8] fetch-pack: make negotiation-related vars local

2018-06-06 Thread Jonathan Tan
Reduce the number of global variables by making the priority queue and the count of non-common commits in it local, passing them as a struct to various functions where necessary. This also helps in the case that fetch_pack() is invoked twice in the same process (when tag following is required

[PATCH v2 7/8] fetch-pack: introduce negotiator API

2018-06-06 Thread Jonathan Tan
Introduce the new files fetch-negotiator.{h,c}, which contains an API behind which the details of negotiation are abstracted. Currently, only one algorithm is available: the existing one. This patch is written to be easily reviewed: static functions are moved verbatim from fetch-pack.c to

[PATCH v2 2/8] fetch-pack: clear marks before re-marking

2018-06-06 Thread Jonathan Tan
If tag following is required when using a transport that does not support tag following, fetch_pack() will be invoked twice in the same process, necessitating a clearing of the object flags used by fetch_pack() sometime during the second invocation. This is currently done in find_common(), which

[PATCH v2 0/8] Refactor fetch negotiation into its own API

2018-06-06 Thread Jonathan Tan
Thanks, Jonathan Nieder, for your comments. This patch set now includes a patch at the beginning to split up everything_local(), making it clear which functions have side effects and which don't, and a patch at the end to reformat some comments. While I was implementing the suggestions, there

[PATCH v2 3/8] fetch-pack: directly end negotiation if ACK ready

2018-06-06 Thread Jonathan Tan
When "ACK %s ready" is received, find_common() clears rev_list in an attempt to stop further "have" lines from being sent [1]. It is much more readable to explicitly break from the loop instead, so do this. This means that the memory in priority queue will be reclaimed only upon program exit,

[PATCH v2 1/8] fetch-pack: split up everything_local()

2018-06-06 Thread Jonathan Tan
The function everything_local(), despite its name, also (1) marks commits as COMPLETE and COMMON_REF and (2) invokes filter_refs() as important side effects. Extract (1) into its own function (mark_complete_and_common_ref()) and remove (2). The restoring of save_commit_buffer, which was

[PATCH v2 4/8] fetch-pack: use ref adv. to prune "have" sent

2018-06-06 Thread Jonathan Tan
In negotiation using protocol v2, fetch-pack sometimes does not make full use of the information obtained in the ref advertisement: specifically, that if the server advertises a commit that the client also has, the client never needs to inform the server that it has the commit's parents, since it

[PATCH v2 6/8] fetch-pack: move common check and marking together

2018-06-06 Thread Jonathan Tan
When receiving 'ACK continue' for a common commit, check if the commit was already known to be common and mark it as such if not up front. This should make future refactoring of how the information about common commits is stored more straightforward. No visible change intended. Signed-off-by:

Re: git rm bug

2018-06-06 Thread Robert P. J. Day
On Thu, 7 Jun 2018, Timothy Rice wrote: > > It does seem like something which could be noted in the git > > rm docs. Perhaps you'd care to take a stab at a patch to > > add a note to Documentation/git-rm.txt Thomas? Maybe a note > > at the end of the DISCUSSION section? > > That same

Re: git rm bug

2018-06-06 Thread Timothy Rice
> It does seem like something which could be noted in the git > rm docs. Perhaps you'd care to take a stab at a patch to > add a note to Documentation/git-rm.txt Thomas? Maybe a note > at the end of the DISCUSSION section? That same documentation could mention a common workaround for when

Re: git rm bug

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 04:01:38PM -0400, Todd Zullinger wrote: > Thomas Fischer wrote: > > I agree that the entire chain of empty directories should not be tracked, > > as git tracks content, not files. > > > > However, when I run 'rm path/to/some/file', I expect path/to/some/ to still > >

Re: git rm bug

2018-06-06 Thread Todd Zullinger
Thomas Fischer wrote: > I agree that the entire chain of empty directories should not be tracked, as > git tracks content, not files. > > However, when I run 'rm path/to/some/file', I expect path/to/some/ to still > exist. > > Similarly, when I run 'git rm path/to/some/file', I expect

Re: git rm bug

2018-06-06 Thread Duy Nguyen
On Wed, Jun 6, 2018 at 9:32 PM, Thomas Fischer wrote: > OVERVIEW > > "git rm" will remove more files than specified. This is either a bug or > undocumented behavior (not in the man pages). The behavior is intended, with a question mark. This change is introduced in d9b814cc97 (Add builtin "git

Re: git rm bug

2018-06-06 Thread Robert P. J. Day
On Wed, 6 Jun 2018, Thomas Fischer wrote: > I agree that the entire chain of empty directories should not be > tracked, as git tracks content, not files. > > However, when I run 'rm path/to/some/file', I expect path/to/some/ > to still exist. why? > Similarly, when I run 'git rm

Re: git rm bug

2018-06-06 Thread Thomas Fischer
I agree that the entire chain of empty directories should not be tracked, as git tracks content, not files. However, when I run 'rm path/to/some/file', I expect path/to/some/ to still exist. Similarly, when I run 'git rm path/to/some/file', I expect path/to/some/ to exist, *albeit untracked*.

Re: [PATCH 03/35] object: add repository argument to lookup_unknown_object

2018-06-06 Thread Duy Nguyen
On Wed, May 30, 2018 at 2:47 AM, Stefan Beller wrote: > diff --git a/object.c b/object.c > index 4de4fa58d59..def3c71cac2 100644 > --- a/object.c > +++ b/object.c > @@ -177,7 +177,7 @@ void *object_as_type(struct object *obj, enum object_type > type, int quiet) > } > } > > -struct

Re: git rm bug

2018-06-06 Thread Robert P. J. Day
On Wed, 6 Jun 2018, Thomas Fischer wrote: > OVERVIEW > > "git rm" will remove more files than specified. This is either a bug or > undocumented behavior (not in the man pages). > > SETUP > > 1. In a git repository, create an empty directory OR a chain of empty > directories > > $ mkdir -p

Re: [PATCH 28/35] commit.c: migrate the commit buffer to the parsed object store

2018-06-06 Thread Duy Nguyen
On Wed, May 30, 2018 at 2:48 AM, Stefan Beller wrote: > Signed-off-by: Stefan Beller > --- > commit.c | 29 +++-- > commit.h | 2 ++ > object.c | 5 + > object.h | 2 ++ > 4 files changed, 32 insertions(+), 6 deletions(-) > > diff --git a/commit.c b/commit.c >

git rm bug

2018-06-06 Thread Thomas Fischer
OVERVIEW "git rm" will remove more files than specified. This is either a bug or undocumented behavior (not in the man pages). SETUP 1. In a git repository, create an empty directory OR a chain of empty directories $ mkdir -p path/to/some/ 2. Create a file in the deepest directory and add

Re: [PATCH 07/35] tree: add repository argument to lookup_tree

2018-06-06 Thread Duy Nguyen
On Wed, May 30, 2018 at 2:47 AM, Stefan Beller wrote: > Add a repository argument to allow the callers of lookup_tree > to be more specific about which repository to act on. This is a small > mechanical change; it doesn't change the implementation to handle > repositories other than

Re: [RFC PATCH 0/5] format-patch: automate cover letter range-diff

2018-06-06 Thread Duy Nguyen
On Wed, May 30, 2018 at 10:03 AM, Eric Sunshine wrote: > Dscho recently implemented a 'tbdiff' replacement as a Git builtin named > git-branch-diff[1] which computes differences between two versions of a > patch series. Such a diff can be a useful aid for reviewers when > inserted into a cover

Re: BUG: submodule code prints '(null)'

2018-06-06 Thread Kaartic Sivaraam
On Tuesday 05 June 2018 09:01 PM, Duy Nguyen wrote: > I'll leave it to submodule people to fix this :) > I'm Ccing the only one I know to gain attention. -- Sivaraam QUOTE: “The three principal virtues of a programmer are Laziness, Impatience, and Hubris.” - Camel book Sivaraam?

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Eric Sunshine
On Wed, Jun 6, 2018 at 1:18 PM, Anthony Sottile wrote: > On Wed, Jun 6, 2018 at 10:17 AM, Eric Sunshine > wrote: >> On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine >> wrote: >>> On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: + for w in I am all CRLF; do echo $w; done |

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Anthony Sottile
On Wed, Jun 6, 2018 at 10:17 AM, Eric Sunshine wrote: > On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine wrote: >> On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: >>> + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && >> >> Simpler: printf "%s\n" I am all CRLF |

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Eric Sunshine
On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine wrote: > On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: >> + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && > > Simpler: printf "%s\n" I am all CRLF | append_cr >allcrlf && Or even simpler: printf "%s\r\n" I am all

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Eric Sunshine
On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: > A regression introduced in 8462ff43e42ab67cecd16fdfb59451a53cc8a945 caused > autocrlf rewrites to produce a warning message despite setting safecrlf=false. > > Signed-off-by: Anthony Sottile > --- > diff --git a/t/t0020-crlf.sh

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Todd Zullinger
g...@jeffhostetler.com wrote: > +# As a sanity check, ask Python to parse our generated JSON. Let Python > +# recursively dump the resulting dictionary in sorted order. Confirm that > +# that matches our expectations. > +test_expect_success PYTHON 'parse JSON using Python' ' [...] > + python

Re: [PATCH v3 17/20] cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Nguyễn Thái Ngọc Duy wrote: > Make some index API take an index_state instead of assuming the_index > in read-cache.c. All external call sites are converted blindly to keep > the patch simple and retain current behavior. Individual call sites > may receive further updates to use the

[PATCH v4 07/23] attr: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make the attr API take an index_state instead of assuming the_index in attr code. All call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. There is one ugly temporary

[PATCH v4 18/23] apply.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply.c b/apply.c index fc42a0eadf..82f681972f 100644 --- a/apply.c +++ b/apply.c @@ -4090,7 +4090,7 @@ static int build_fake_ancestor(struct apply_state *state, struct patch

[PATCH v4 15/23] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Since attr checking API now take the index, there's no need to set an index in advance with this call. Most call sites are straightforward because they either pass the_index or NULL (which defaults back to the_index previously). There's only one suspicious call site in unpack-trees.c where it sets

[PATCH v4 17/23] read-cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make some index API take an index_state instead of assuming the_index in read-cache.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by:

[PATCH v4 21/23] resolve-undo.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- resolve-undo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resolve-undo.c b/resolve-undo.c index 383231b011..2377995d6d 100644 --- a/resolve-undo.c +++ b/resolve-undo.c @@ -1,3 +1,4 @@ +#define NO_THE_INDEX_COMPATIBILITY_MACROS

[PATCH v4 12/23] pathspec.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- pathspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pathspec.c b/pathspec.c index 897cb9cbbe..6f005996fd 100644 --- a/pathspec.c +++ b/pathspec.c @@ -37,7 +37,7 @@ void add_pathspec_matches_against_index(const struct pathspec

[PATCH v4 19/23] difftool: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/difftool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/difftool.c b/builtin/difftool.c index fb2ccfe6f0..c7d6296762 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -321,7 +321,7 @@ static int

[PATCH v4 22/23] grep: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index 2eae397e92..a8cef2b159 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -497,7 +497,7 @@ static int grep_cache(struct grep_opt

[PATCH v4 10/23] dir.c: remove an implicit dependency on the_index in pathspec code

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make the match_patchspec API and friends take an index_state instead of assuming the_index in dir.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index.

[PATCH v4 09/23] convert.c: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make the convert API take an index_state instead of assuming the_index in convert.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by:

[PATCH v4 11/23] ls-files: correct index argument to get_convert_attr_ascii()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
write_eolinfo() does take an istate as function argument and it should be used instead of the_index. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/ls-files.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/builtin/ls-files.c b/builtin/ls-files.c index

[PATCH v4 14/23] entry.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
checkout-index.c needs update because if checkout->istate is NULL, ie_match_stat() will crash. Previously this is ie_match_stat(_index, ..) so it will not crash, but it is not technically correct either. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout-index.c | 1 + entry.c

[PATCH v4 23/23] cache.h: make the_index part of "compatibility macros"

2018-06-06 Thread Nguyễn Thái Ngọc Duy
While the_index is not actually a macro, its use throughout the code base is dangerous because developers sometimes may not see that some function is using the_index (instead of some other index that the devs are interested in). By keeping the_index part of this NO_ macro, we try to reduce its

[PATCH v4 20/23] checkout: avoid the_index when possible

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index d2257e0d82..4dbcab3727 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -230,7 +230,7 @@ static int

[PATCH v4 16/23] preload-index.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- preload-index.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/preload-index.c b/preload-index.c index d61d7662d5..cc2b579791 100644 --- a/preload-index.c +++ b/preload-index.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2008 Linus

[PATCH v4 13/23] submodule.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- submodule.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/submodule.c b/submodule.c index 955560bdbb..3aed76e3ee 100644 --- a/submodule.c +++ b/submodule.c @@ -93,7 +93,7 @@ int update_path_in_gitmodules(const char *oldpath,

[PATCH v4 08/23] convert.h: drop 'extern' from function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- convert.h | 56 --- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/convert.h b/convert.h index 01385d9288..0a0fa15b58 100644 --- a/convert.h +++ b/convert.h @@ -57,35 +57,36 @@ struct

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Duy Nguyen wrote: > On Wed, Jun 6, 2018 at 6:50 PM, Brandon Williams wrote: > > On 06/06, Nguyễn Thái Ngọc Duy wrote: > >> Make the attr API take an index_state instead of assuming the_index in > >> attr code. All call sites are converted blindly to keep the patch > >> simple and retain

[PATCH v4 06/23] attr.h: drop extern from function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/attr.h b/attr.h index 442d464db6..46340010bb 100644 --- a/attr.h +++ b/attr.h @@ -42,31 +42,31 @@ struct attr_check { struct attr_stack *stack;

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Duy Nguyen
On Wed, Jun 6, 2018 at 6:50 PM, Brandon Williams wrote: > On 06/06, Nguyễn Thái Ngọc Duy wrote: >> Make the attr API take an index_state instead of assuming the_index in >> attr code. All call sites are converted blindly to keep the patch >> simple and retain current behavior. Individual call

Re: [PATCH v3 15/20] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Brandon Williams
On 06/06, Nguyễn Thái Ngọc Duy wrote: > Since attr checking API now take the index, there's no need to set an > index in advance with this call. Most call sites are straightforward > because they either pass the_index or NULL (which defaults back to > the_index previously). There's only one

[PATCH v4 05/23] unpack-trees: avoid the_index in verify_absent()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Both functions that are updated in this commit are called by verify_absent(), which is part of the "unpack-trees" operation that is supposed to work on any index file specified by the caller. Thanks to Brandon [1] [2], an implicit dependency on the_index is exposed. This commit fixes it. In both

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Nguyễn Thái Ngọc Duy wrote: > Make the attr API take an index_state instead of assuming the_index in > attr code. All call sites are converted blindly to keep the patch > simple and retain current behavior. Individual call sites may receive > further updates to use the right index

[PATCH v4 02/23] unpack-trees: add a note about path invalidation

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/unpack-trees.c b/unpack-trees.c index 3a85a02a77..5d06aa9c98 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1545,6 +1545,17 @@ static int verify_uptodate_sparse(const

[PATCH v4 04/23] unpack-tress: convert clear_ce_flags* to avoid the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Prior to fba92be8f7, this code implicitly (and incorrectly) assumes the_index when running the exclude machinery. fba92be8f7 helps show this problem clearer because unpack-trees operation is supposed to work on whatever index the caller specifies... not specifically the_index. Update the code to

[PATCH v4 03/23] unpack-trees: don't shadow global var the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
This function mark_new_skip_worktree() has an argument named the_index which is also the name of a global variable. While they have different types (the global the_index is not a pointer) mistakes can easily happen and it's also confusing for readers. Rename the function argument to something

[PATCH v4 00/23] Fix incorrect use of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
v4 fixes some commit messages and killed a couple more the_index references after I tried to merge this with 'pu' diff --git a/apply.c b/apply.c index 811ff2ad5e..82f681972f 100644 --- a/apply.c +++ b/apply.c @@ -4090,9 +4090,9 @@ static int build_fake_ancestor(struct apply_state *state, struct

[PATCH v4 01/23] unpack-trees: remove 'extern' on function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpack-trees.h b/unpack-trees.h index c2b434c606..534358fcc5 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -82,8 +82,8 @@ struct unpack_trees_options {

Re: [PATCH] t3200-branch.sh: use "--set-upstream-to" in test

2018-06-06 Thread Kaartic Sivaraam
On Tuesday 05 June 2018 04:54 PM, SZEDER Gábor wrote: > > Though arguably the test name could be more descriptive and tell why > it should fail. > That's arguable, indeed. I was about to send a patch that gives a better description for the test. I didn't do it as I started wondering, Is it even

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Torsten Bögershausen
On Mon, Jun 04, 2018 at 01:17:42PM -0700, Anthony Sottile wrote: > A regression introduced in 8462ff43e42ab67cecd16fdfb59451a53cc8a945 caused > autocrlf rewrites to produce a warning message despite setting safecrlf=false. > > Signed-off-by: Anthony Sottile > --- > config.c| 2 +- >

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Ramsay Jones
On 06/06/18 08:39, Nguyễn Thái Ngọc Duy wrote: > Make the attr API take an index_state instead of assuming the_index in > attr code. All call sites are converted blindly to keep the patch > simple and retain current behavior. Individual call sites may receive > further updates to use the right

Re: [PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Derrick Stolee
On 6/6/2018 8:26 AM, Ævar Arnfjörð Bjarmason wrote: On Wed, Jun 06 2018, Derrick Stolee wrote: On 6/6/2018 8:11 AM, Ævar Arnfjörð Bjarmason wrote: On Wed, Jun 06 2018, Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- builtin/commit-graph.c | 39

Re: [PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Derrick Stolee wrote: > On 6/6/2018 8:11 AM, Ævar Arnfjörð Bjarmason wrote: >> On Wed, Jun 06 2018, Derrick Stolee wrote: >> >>> Signed-off-by: Derrick Stolee >>> --- >>> builtin/commit-graph.c | 39 +-- >>> commit-graph.c |

Re: [PATCH v5 08/21] commit-graph: verify required chunks are present

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Derrick Stolee wrote: > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > index c0c1ff09b9..846396665e 100755 > --- a/t/t5318-commit-graph.sh > +++ b/t/t5318-commit-graph.sh > @@ -249,6 +249,15 @@ test_expect_success 'git commit-graph verify' ' > >

  1   2   >