[PATCH v2 1/4] sequencer: fix "rebase -i --root" corrupting author header

2018-07-31 Thread Eric Sunshine
When "git rebase -i --root" creates a new root commit (say, by swapping in a different commit for the root), it corrupts the commit's "author" header with trailing garbage: author A U Thor @1112912773 -0700...@example.com This is a result of read_author_ident() neglecting to NUL-terminate th

[PATCH v2 2/4] sequencer: fix "rebase -i --root" corrupting author header timezone

2018-07-31 Thread Eric Sunshine
When "git rebase -i --root" creates a new root commit, it corrupts the "author" header's timezone by repeating the last digit: author A U Thor @1112912773 -07000 This is due to two bugs. First, write_author_script() neglects to add the closing quote to the value of GIT_AUTHOR_DATE when gene

[PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Eric Sunshine
This is a re-roll of [1] which fixes sequencer bugs resulting in commit object corruption when "rebase -i --root" swaps in a new commit as root. Unfortunately, those bugs made it into v2.18.0 and have already corrupted at least one repository (a local project of mine). Patches 3/4 and 4/4 are new.

[PATCH v2 4/4] sequencer: don't die() on bogus user-edited timestamp

2018-07-31 Thread Eric Sunshine
read_author_ident() is careful to handle errors "gently" when parsing "rebase-merge/author-script" by printing a suitable warning and returning NULL; it never die()'s. One possible reason that parsing might fail is that "rebase-merge/author-script" has been hand-edited in such a way which corrupts

[PATCH v2 3/4] sequencer: fix "rebase -i --root" corrupting author header timestamp

2018-07-31 Thread Eric Sunshine
When "git rebase -i --root" creates a new root commit, it corrupts the "author" header's timestamp by prepending a "@": author A U Thor @1112912773 -0700 The commit parser is very strict about the format of the "author" header, and does not allow a "@" in that position. The "@" comes from G

Re: [PATCH 1/1] Highlight keywords in remote sideband output.

2018-07-31 Thread Ævar Arnfjörð Bjarmason
On Mon, Jul 30 2018, Han-Wen Nienhuys wrote: > + if (sideband_use_color < 0) { > + const char *key = "color.remote"; > + char *value = NULL; > + if (!git_config_get_string(key, &value)) > + sideband_use_color = git_config_colorbool(key

Re: [PATCH 1/1] Add the `p4-pre-submit` hook

2018-07-31 Thread SZEDER Gábor
> diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh > index 4849edc4e..2b7baa95d 100755 > --- a/t/t9800-git-p4-basic.sh > +++ b/t/t9800-git-p4-basic.sh > @@ -261,6 +261,35 @@ test_expect_success 'unresolvable host in P4PORT should > display error' ' > ) > ' > > +# Test foll

[no subject]

2018-07-31 Thread Mr.Manfred Robert
Ich habe einen Wohltätigkeitsfonds für Sie im Wert von € 4,800,000. Diese Spende ist für die ersten 5 Personen, die auf diese E-Mail antworten, die als Form von Wohltätigkeitshäusern zu Ehren meiner verstorbenen Frau gegeben wird, die an Krebs gestorben ist. Kontaktieren Sie meinen Anwalt über

[no subject]

2018-07-31 Thread Mr.Manfred Robert
Ich habe einen Wohltätigkeitsfonds für Sie im Wert von € 4,800,000. Diese Spende ist für die ersten 5 Personen, die auf diese E-Mail antworten, die als Form von Wohltätigkeitshäusern zu Ehren meiner verstorbenen Frau gegeben wird, die an Krebs gestorben ist. Kontaktieren Sie meinen Anwalt über

Re: [PATCH v2 2/4] sequencer: fix "rebase -i --root" corrupting author header timezone

2018-07-31 Thread Phillip Wood
On 31/07/18 08:33, Eric Sunshine wrote: When "git rebase -i --root" creates a new root commit, it corrupts the "author" header's timezone by repeating the last digit: author A U Thor @1112912773 -07000 This is due to two bugs. First, write_author_script() neglects to add the closing quot

Re: [PATCH v2 3/4] sequencer: fix "rebase -i --root" corrupting author header timestamp

2018-07-31 Thread Phillip Wood
On 31/07/18 08:33, Eric Sunshine wrote: When "git rebase -i --root" creates a new root commit, it corrupts the "author" header's timestamp by prepending a "@": author A U Thor @1112912773 -0700 The commit parser is very strict about the format of the "author" header, and does not allow a

Re: [PATCH v2 4/4] sequencer: don't die() on bogus user-edited timestamp

2018-07-31 Thread Phillip Wood
On 31/07/18 08:33, Eric Sunshine wrote: read_author_ident() is careful to handle errors "gently" when parsing "rebase-merge/author-script" by printing a suitable warning and returning NULL; it never die()'s. One possible reason that parsing might fail is that "rebase-merge/author-script" has been

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Phillip Wood
Hi Eric On 31/07/18 08:33, Eric Sunshine wrote: This is a re-roll of [1] which fixes sequencer bugs resulting in commit object corruption when "rebase -i --root" swaps in a new commit as root. Unfortunately, those bugs made it into v2.18.0 and have already corrupted at least one repository (a lo

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
I have just replied to https://github.com/cr-marcstevens/sha1collisiondetection/pull/42 I checked a gcc compiler on AIX, and I have the defines for vac. I do not have access yet to SLES or RHEL (or Ubuntu), just a "free Debian" on my Power6. * my conclusions|recommendations: a) AIX is alway

Re: [PATCH v2 2/4] sequencer: fix "rebase -i --root" corrupting author header timezone

2018-07-31 Thread Eric Sunshine
On Tue, Jul 31, 2018 at 5:50 AM Phillip Wood wrote: > On 31/07/18 08:33, Eric Sunshine wrote: > > - sq_dequote(in); > > + if (!sq_dequote(in)) { > > + warning(_("bad quoting on %s value in '%s'"), > > + keys[i], rebase_path_au

Re: [PATCH v2 3/4] sequencer: fix "rebase -i --root" corrupting author header timestamp

2018-07-31 Thread Eric Sunshine
On Tue, Jul 31, 2018 at 6:01 AM Phillip Wood wrote: > Now that the author is correct, can we test_cmp() it against its > expected value to make sure there are no hidden surprises in the name > and email in the future. (It would be reassuring to test an author with > "'" in the name as well but tha

Re: [PATCH v2 4/4] sequencer: don't die() on bogus user-edited timestamp

2018-07-31 Thread Eric Sunshine
On Tue, Jul 31, 2018 at 6:02 AM Phillip Wood wrote: > On 31/07/18 08:33, Eric Sunshine wrote: > > + /* validate date since fmt_ident() will die() on bad value */ > > + if (parse_date(val[2], &out)){ > > + warning(_("invalid date format '%s' in '%s'"), > > +

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
A small step back... On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: On Sun, Jul 29 2018, Michael wrote: On 29/07/2018 22:06, brian m. carlson wrote: On Sun, Jul 29, 2018 at 09:48:43PM +0200, Michael wrote: On 29/07/2018 21:27, brian m. carlson wrote: Well, that explains it. I would

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Eric Sunshine
On Tue, Jul 31, 2018 at 6:06 AM Phillip Wood wrote: > On 31/07/18 08:33, Eric Sunshine wrote: > > Patch 2/4 of this series conflicts with Akinori MUSHA's > > 'am/sequencer-author-script-fix' which takes a stab at fixing one of the > > four (or so) bugs fixed by this series (namely, adding a missin

Re: [PATCH 1/1] Highlight keywords in remote sideband output.

2018-07-31 Thread Han-Wen Nienhuys
On Mon, Jul 30, 2018 at 11:39 PM Junio C Hamano wrote: > > + */ > > +void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) > > I'll make this "static" to this file while queuing. Does that mean the patch is in? -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich R

[PATCH v2 1/2] sequencer: handle errors in read_author_ident()

2018-07-31 Thread Phillip Wood
From: Phillip Wood The calling code treated NULL as a valid return value, so fix this by returning and integer and passing in a parameter to receive the author. Signed-off-by: Phillip Wood --- sequencer.c | 49 ++--- 1 file changed, 26 insertions(+),

[PATCH v2 2/2] sequencer: fix quoting in write_author_script

2018-07-31 Thread Phillip Wood
From: Phillip Wood Single quotes should be escaped as \' not \\'. Note that this only affects authors that contain a single quote and then only external scripts that read the author script and users whose git is upgraded from the shell version of rebase -i while rebase was stopped. This is becaus

[PATCH v2 0/2] Fix author script quoting

2018-07-31 Thread Phillip Wood
From: Phillip Wood These build on Eric's patches. The first patch would be better if it was integrated into Eric's patches. The second is a rebased version of my previous patch for fixing quoting in the author script with some additions by Johannes and rebased on top of Eric's fixes. The special

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Phillip Wood
Hi Eric On 31/07/18 11:46, Eric Sunshine wrote: > On Tue, Jul 31, 2018 at 6:06 AM Phillip Wood > wrote: >> On 31/07/18 08:33, Eric Sunshine wrote: >>> Patch 2/4 of this series conflicts with Akinori MUSHA's >>> 'am/sequencer-author-script-fix' which takes a stab at fixing one of the >>> four (or

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Eric Sunshine
On Tue, Jul 31, 2018 at 6:46 AM Eric Sunshine wrote: > Anyhow, thanks for reading over the series. I appreciate it even if > our "sense of priority" doesn't always align (as evidenced by your > review comments and my responses). To be clear, the changes you suggest all make sense, and would be we

[GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
As pointed out by SZEDER Gábor, git-rebase.sh wrote to to 'quiet' with an `echo`: echo "$GIT_QUIET" > "$state_dir/quiet" This mean that even if $GIT_QUIET is empty, a newline is written to quiet. The rewrite of write_basic_state() changed this behaviour, which could lead to problems. This p

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: > The reason we're in this hole is because we use this > sha1collisiondetection library to do SHA-1, and the reason we have > issues with it specifically (not OpenSSL et al) is because its only > method of detecting endianness is at compile ti

Re: [PATCH v2 01/10] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-07-31 Thread Jeff King
On Mon, Jul 30, 2018 at 05:38:06PM -0400, Eric Sunshine wrote: > > I wonder if it should look for something like [A-Z][A-Z_]* to catch > > all of these. > > I considered that, but it doesn't handle nested here-docs, which we > actually have in the test suite. For instance, from t9300-fast-import:

[PATCH v2 03/10] push tests: fix logic error in "push" test assertion

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Fix a logic error that's been here since this test was added in dbfeddb12e ("push: require force for refs under refs/tags/", 2012-11-29). The intent of this test is to force-create a new tag pointing to HEAD~, and then assert that pushing it doesn't work without --force. Instead, the code was not

[PATCH v2 02/10] push tests: remove redundant 'git push' invocation

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Remove an invocation of 'git push' that's exactly the same as the one on the preceding line. This was seemingly added by mistake in dbfeddb12e ("push: require force for refs under refs/tags/", 2012-11-29) and doesn't affect the result of the test, the second "push" was a no-op as there was nothing

[PATCH v2 04/10] push tests: add more testing for forced tag pushing

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Improve the tests added in dbfeddb12e ("push: require force for refs under refs/tags/", 2012-11-29) to assert that the same behavior applies various other combinations of command-line option and refspecs. Supplying either "+" in refspec or "--force" is sufficient to clobber the reference. With --n

[PATCH v2 10/10] fetch: stop clobbering existing tags without --force

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Change "fetch" to treat "+" in refspecs (aka --force) to mean we should clobber a local tag of the same name. This changes the long-standing behavior of "fetch" added in 853a3697dc ("[PATCH] Multi-head fetch.", 2005-08-20), before this change all tag fetches effectively had --force enabled. See th

[PATCH v2 08/10] fetch tests: add a test clobbering tag behavior

2018-07-31 Thread Ævar Arnfjörð Bjarmason
The test suite only incidentally (and unintentionally) tested for the current behavior of eager tag clobbering on "fetch". This follow-up to the previous "push tests: assert re-pushing annotated tags" change tests for it explicitly. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t5516-fetch-push.s

[PATCH v2 05/10] push tests: assert re-pushing annotated tags

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Change the test that asserts that lightweight tags can only be clobbered by a force-push to check do the same tests for annotated tags. There used to be less exhaustive tests for this with the code added in 40eff17999 ("push: require force for annotated tags", 2012-11-29), but Junio removed them i

[PATCH v2 07/10] fetch tests: correct a comment "remove it" -> "remove them"

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Correct a comment referring to the removal of just the branch to also refer to the tag. This should have been changed in my ca3065e7e7 ("fetch tests: add a tag to be deleted to the pruning tests", 2018-02-09) when the tag deletion was added, but I missed it at the time. Signed-off-by: Ævar Arnfjör

[PATCH v2 06/10] push doc: correct lies about how push refspecs work

2018-07-31 Thread Ævar Arnfjörð Bjarmason
There's complex rules governing whether a push is allowed to take place depending on whether we're pushing to refs/heads/*, refs/tags/* or refs/not-that/*. See is_branch() in refs.c, and the various assertions in refs/files-backend.c. (e.g. "trying to write non-commit object %s to branch '%s'"). T

[PATCH v2 09/10] pull doc: fix a long-standing grammar error

2018-07-31 Thread Ævar Arnfjörð Bjarmason
It should be "is not an empty string" not "is not empty string". This fixes wording originally introduced in ab9b31386b ("Documentation: multi-head fetch.", 2005-08-24). Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/pull-fetch-param.txt | 2 +- 1 file changed, 1 insertion(+), 1 deleti

[PATCH v2 01/10] fetch tests: change "Tag" test tag to "testTag"

2018-07-31 Thread Ævar Arnfjörð Bjarmason
Calling the test tag "Tag" will make for confusing reading later in this series when making use of the "git push tag " feature. Let's call the tag testTag instead. Changes code initially added in dbfeddb12e ("push: require force for refs under refs/tags/", 2012-11-29). Signed-off-by: Ævar Arnfjör

[PATCH v2 00/10] "git fetch" should not clobber existing tags without --force

2018-07-31 Thread Ævar Arnfjörð Bjarmason
It took me a long time to submit a re-roll for this, but this should solve all issues noted with v1, see https://public-inbox.org/git/20180429202100.32353-1-ava...@gmail.com/ for the notes on that. A range-diff with v1 follows below. 2: a47d861704 ! 1: 77a612e89c push tests: fix logic error i

Re: [PATCH 1/1] Add the `p4-pre-submit` hook

2018-07-31 Thread Luke Diamand
I think there is an error in the test harness. On 31 July 2018 at 10:46, SZEDER Gábor wrote: >> + test_must_fail git-p4 submit --dry-run >errs 2>&1 &&> >> + ! grep "Would apply" err It writes to the file "errs" but then looks for the message in "err". Luke

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
I hope a I have a "leap forward" On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: > Perhaps it's worth taking a step back here and thinking about whether > this whole thing is unworkable. It was hard enough to get this to work > on the combination of Linux, *BSD and Solaris, but I suspect we

git merge -s subtree seems to be broken.

2018-07-31 Thread George Shammas
At work, we recently updated from a massively old version of git (1.7.10) to 2.18. There are a few code bases that use subtrees, and they seem to have completely broke when trying to merge in updates. I have confirmed that it works correctly in 1.7.10. The 2.18 behavior is clearly incorrect. git

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Ævar Arnfjörð Bjarmason
On Tue, Jul 31 2018, Michael Felt wrote: > I hope a I have a "leap forward" > > > On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: >> Perhaps it's worth taking a step back here and thinking about whether >> this whole thing is unworkable. It was hard enough to get this to work >> on the com

Re: [PATCH 1/1] Add the `p4-pre-submit` hook

2018-07-31 Thread Junio C Hamano
Luke Diamand writes: > I think there is an error in the test harness. > > On 31 July 2018 at 10:46, SZEDER Gábor wrote: >>> + test_must_fail git-p4 submit --dry-run >errs 2>&1 &&> >>> + ! grep "Would apply" err > > It writes to the file "errs" but then looks for the messa

Re: [PATCH 1/1] Highlight keywords in remote sideband output.

2018-07-31 Thread Junio C Hamano
Han-Wen Nienhuys writes: > On Mon, Jul 30, 2018 at 11:39 PM Junio C Hamano wrote: >> > + */ >> > +void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) >> >> I'll make this "static" to this file while queuing. > > Does that mean the patch is in? It depends on your definition

Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-31 Thread Ævar Arnfjörð Bjarmason
On Mon, Jul 16 2018, Jonathan Tan wrote: Didn't catch this until this was in next, sorry. Re-arranged the diff a bit: > -void fetch_negotiator_init(struct fetch_negotiator *negotiator) > +void fetch_negotiator_init(struct fetch_negotiator *negotiator, > +const char *alg

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread George Shammas
Bisecting around, this might be the commit that introduced the breakage. https://github.com/git/git/commit/d8febde I really hope that it hasn't been broken for 5 years and I am just doing something wrong. On Tue, Jul 31, 2018 at 10:09 AM George Shammas wrote: > At work, we recently updated fro

Re: [PATCH 1/1] Highlight keywords in remote sideband output.

2018-07-31 Thread Duy Nguyen
On Tue, Jul 31, 2018 at 09:37:51AM +0200, Ævar Arnfjörð Bjarmason wrote: > > On Mon, Jul 30 2018, Han-Wen Nienhuys wrote: > > > > + if (sideband_use_color < 0) { > > + const char *key = "color.remote"; > > + char *value = NULL; > > + if (!git_config_get_string(key

Re: [PATCH 0/3] config: fix case sensitive subsection names on writing

2018-07-31 Thread Junio C Hamano
Stefan Beller writes: > It turns out it doesn't quite do that; > The parsing code takes the old notation into account and translates any > [V.A] > r = ... > into a lower cased "v.a." for ease of comparison. That happens in > get_base_var, which would call further into get_extended_base_var

Re: [PATCH v4 11/21] range-diff: add tests

2018-07-31 Thread Junio C Hamano
Stefan Beller writes: > On Mon, Jul 30, 2018 at 1:18 PM Junio C Hamano wrote: > >> > I already pushed an update to https://github.com/gitgitgadget/git/pull/1. >> >> Should I take "pushed to ... GGG" to mean "do not merge what you >> have to 'next' yet, as there will be an updated series (not >>

Re: [GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Junio C Hamano
Alban Gruin writes: > As pointed out by SZEDER Gábor, git-rebase.sh wrote to to 'quiet' with > an `echo`: > > echo "$GIT_QUIET" > "$state_dir/quiet" > > This mean that even if $GIT_QUIET is empty, a newline is written to > quiet. The rewrite of write_basic_state() changed this behaviour, whi

Re: [PATCH v2 0/4] Speed up unpack_trees()

2018-07-31 Thread Duy Nguyen
On Mon, Jul 30, 2018 at 8:10 PM Ben Peart wrote: > I ran "git checkout" on a large repo and averaged the results of 3 runs. > This clearly demonstrates the benefit of the optimized unpack_trees() > as even the final "diff-index" is essentially a 3rd call to unpack_trees(). > > baselinene

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread Jeff King
On Tue, Jul 31, 2018 at 11:03:17AM -0400, George Shammas wrote: > Bisecting around, this might be the commit that introduced the breakage. > > https://github.com/git/git/commit/d8febde > > I really hope that it hasn't been broken for 5 years and I am just doing > something wrong. Unfortunately,

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread Junio C Hamano
George Shammas writes: > Bisecting around, this might be the commit that introduced the breakage. > > https://github.com/git/git/commit/d8febde Interesting. I've never used the "-s subtree" strategy without "-Xsubtree=..." to explicitly tell where the thing should go for a long time, so I am no

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread George Shammas
While debugging this, I did try -X subtree=src/ however the effect was the same. On Tue, Jul 31, 2018 at 11:53 AM Junio C Hamano wrote: > George Shammas writes: > > > Bisecting around, this might be the commit that introduced the breakage. > > > > https://github.com/git/git/commit/d8febde > > I

Re: [GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
Hi Junio, Le 31/07/2018 à 17:23, Junio C Hamano a écrit : > Alban Gruin writes: > >> As pointed out by SZEDER Gábor, git-rebase.sh wrote to to 'quiet' with >> an `echo`: >> >> echo "$GIT_QUIET" > "$state_dir/quiet" >> >> This mean that even if $GIT_QUIET is empty, a newline is written to >>

Re: [PATCH] refspec: allow @ on the left-hand side of refspecs

2018-07-31 Thread Brandon Williams
On 07/30, brian m. carlson wrote: > On Mon, Jul 30, 2018 at 10:50:51AM -0700, Brandon Williams wrote: > > On 07/29, brian m. carlson wrote: > > > The object ID parsing machinery is aware of "@" as a synonym for "HEAD" > > > and this is documented accordingly in gitrevisions(7). The push > > > docu

Re: [GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Junio C Hamano
Alban Gruin writes: >> Hmph, from reading your other message >> >> >> https://public-inbox.org/git/dce8c99b-51e9-4ed1-8ae4-28049cb6e...@gmail.com/ >> >> I got an impression that a rerolled version is coming anyway. Is >> this fix so urgent that it needs tobe squashed in in the meantime >> a

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread Junio C Hamano
Jeff King writes: > The problem introduced in that commit is that each iteration through the > loop advances the tree pointers. Ah, indeed. The original used tree_entry_extract() and update_tree_entry() separately, but the update does tree_entry() on both sides. > So the assertion in that co

Re: [PATCH/RFC] Color merge conflicts

2018-07-31 Thread Elijah Newren
On Mon, Jul 30, 2018 at 10:40 AM, Stefan Beller wrote: > On Mon, Jul 30, 2018 at 9:00 AM Nguyễn Thái Ngọc Duy > wrote: >> >> One of the things I notice when watching a normal git user face a >> merge conflicts is the output is very verbose (especially when there >> are multiple conflicts) and it

Re: [PATCH v2 0/2] Preserve skip_worktree bit in merges when necessary

2018-07-31 Thread Elijah Newren
On Fri, Jul 27, 2018 at 5:59 AM, Ben Peart wrote: > Sending this update as Elijah is on vacation. This only updates the test > case based on feedback from the list. Thanks! One less thing for me to catch up on. :-)

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread Jeff King
On Tue, Jul 31, 2018 at 08:53:23AM -0700, Junio C Hamano wrote: > George Shammas writes: > > > Bisecting around, this might be the commit that introduced the breakage. > > > > https://github.com/git/git/commit/d8febde > > Interesting. I've never used the "-s subtree" strategy without > "-Xsubt

Re: [PATCH 2/2] refs: switch for_each_replace_ref back to use a ref_store

2018-07-31 Thread Duy Nguyen
On Tue, Jul 31, 2018 at 2:41 AM Stefan Beller wrote: > > Taking a step back, was there anything that prompted these patches? > > I am flailing around on how to approach the ref store and the repository: > * I dislike having to pass a repository 'r' twice. (current situation after > patch 1. That

First test of t5552 fails on Windows

2018-07-31 Thread Johannes Sixt
I'm testing origin/next on Windows with a few other topics on top. The first test fails like this. Do you see what is wrong? Where should I start looking? Is it perhaps that upload-pack is responding too soon so that fetch does not send 'have c1'? this is the console output ...(truncated)...

Re: [PATCH v2 0/4] Speed up unpack_trees()

2018-07-31 Thread Ben Peart
On 7/31/2018 11:31 AM, Duy Nguyen wrote: On Mon, Jul 30, 2018 at 8:10 PM Ben Peart wrote: I ran "git checkout" on a large repo and averaged the results of 3 runs. This clearly demonstrates the benefit of the optimized unpack_trees() as even the final "diff-index" is essentially a 3rd call

Re: [PATCH] DO-NOT-MERGE: write and read commit-graph always

2018-07-31 Thread Jakub Narebski
Stefan Beller writes: >> I wonder though if all those changes to the testsuite shouldn't be >> merged. > > I think Stolee doesn't want this to be merged after rereading > subject and the commit message. Yes, I understand that, and for the most part I agree with it. This commit main purpose is t

[PATCH v2] checkout: optimize "git checkout -b "

2018-07-31 Thread Ben Peart
From: Ben Peart Skip merging the commit, updating the index and working directory if and only if we are creating a new branch via "git checkout -b ." Any other checkout options will still go through the former code path. If sparse_checkout is on, require the user to manually opt in to this opti

[PATCH v3 0/2] Address recovery failures with directory/file conflicts

2018-07-31 Thread Elijah Newren
This patch series fixes several "recovery" commands that outright fail or do not fully recover when directory-file conflicts are present. This includes: * git read-tree --reset HEAD * git am --skip * git am --abort * git merge --abort (or git reset --merge) * git reset --hard Change

[PATCH v3 1/2] t1015: demonstrate directory/file conflict recovery failures

2018-07-31 Thread Elijah Newren
Several "recovery" commands outright fail or do not fully recover when directory-file conflicts are present. This includes: * git read-tree --reset HEAD * git am --skip * git am --abort * git merge --abort * git reset --hard Add testcases documenting these shortcomings. Signed-off-by:

[PATCH v3 2/2] read-cache: fix directory/file conflict handling in read_index_unmerged()

2018-07-31 Thread Elijah Newren
read_index_unmerged() has two intended purposes: * return 1 if there are any unmerged entries, 0 otherwise * drops any higher-stage entries down to stage #0 There are several callers of read_index_unmerged() that check the return value to see if it is non-zero, all of which then die() if that

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread Junio C Hamano
Jeff King writes: > +... > + } else if (cmp > 0) { > /* path2 does not appear in one */ > + score += score_missing(two.entry.mode, two.entry.path); > + update_tree_entry(&two); > + continue; > +

Question on range-diff and notes.displayref

2018-07-31 Thread Elijah Newren
Should git notes show up in a range-diff? I happened to have notes.displayref=refs/notes/amlog set in my git.git repo, and saw the below in my range-diff: On Tue, Jul 31, 2018 at 10:12 AM, Elijah Newren wrote: > 1: 4a1c9c3368 ! 1: 00f94a8b41 t1015: demonstrate directory/file conflict > re

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread Jeff King
On Tue, Jul 31, 2018 at 10:17:15AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > +... > > + } else if (cmp > 0) { > > /* path2 does not appear in one */ > > + score += score_missing(two.entry.mode, two.entry.path); > > +

Re: [GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Junio C Hamano
Junio C Hamano writes: > As the number of his or her own topics each contributor needs to > keep track of by definition is the number of all topics I need to s/is the/is smaller than the/; Sorry for the noise X-<. > take care of, I do not want to have to keep track of things myself > more than

Re: [PATCH v2 0/4] Speed up unpack_trees()

2018-07-31 Thread Ben Peart
On 7/31/2018 12:50 PM, Ben Peart wrote: On 7/31/2018 11:31 AM, Duy Nguyen wrote: In the performance game of whack-a-mole, that call to repair cache-tree is now looking quite expensive... Yeah and I think we can whack that mole too. I did some measurement. Best case possible, we just n

[PATCH 1/2] Document git config getter return value.

2018-07-31 Thread Han-Wen Nienhuys
--- config.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index b95bb7649..d39256eb1 100644 --- a/config.h +++ b/config.h @@ -178,10 +178,16 @@ struct config_set { }; extern void git_configset_init(struct config_set *cs); -extern int git_co

[PATCH 2/2] Highlight keywords in remote sideband output.

2018-07-31 Thread Han-Wen Nienhuys
The highlighting is done on the client-side. Supported keywords are "error", "warning", "hint" and "success". The colorization is controlled with the config setting "color.remote". Co-authored-by: Duy Nguyen Signed-off-by: Han-Wen Nienhuys --- Documentation/config.txt| 9 +++ hel

[PATCH 0/2 v3] Highlight keywords in remote sideband output.

2018-07-31 Thread Han-Wen Nienhuys
squash in Duy's patch Han-Wen Nienhuys (2): Document git config getter return value. Highlight keywords in remote sideband output. Documentation/config.txt| 9 +++ config.h| 10 ++- help.c | 1 + help.h

Re: [PATCH] DO-NOT-MERGE: write and read commit-graph always

2018-07-31 Thread Elijah Newren
On Wed, Jul 18, 2018 at 8:22 AM, Derrick Stolee wrote: > The following test fails because the repo has ambiguous merge-bases, and > the commit-graph changes the walk order so we select a different one. > This alters the resulting merge from the expected result. > > t6024-recursive-merge.sh, Test 4

Re: [PATCH v2 06/10] push doc: correct lies about how push refspecs work

2018-07-31 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > The is often the name of the branch you would want to push, but > -it can be any arbitrary "SHA-1 expression", such as `master~4` or > -`HEAD` (see linkgit:gitrevisions[7]). > +it can be any arbitrary expression to a commit, such as `master~4` or > +`HEAD` (se

Re: [PATCH v2 08/10] fetch tests: add a test clobbering tag behavior

2018-07-31 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > The test suite only incidentally (and unintentionally) tested for the > current behavior of eager tag clobbering on "fetch". This follow-up to > the previous "push tests: assert re-pushing annotated tags" change > tests for it explicitly. > > Signed-off-by: Ævar

[GSoC][PATCH v5 02/20] rebase -i: rewrite append_todo_help() in C

2018-07-31 Thread Alban Gruin
This rewrites append_todo_help() from shell to C. It also incorporates some parts of initiate_action() and complete_action() that also write help texts to the todo file. This also introduces the source file rebase-interactive.c. This file will contain functions necessary for interactive rebase tha

[GSoC][PATCH v5 06/20] rebase -i: rewrite setup_reflog_action() in C

2018-07-31 Thread Alban Gruin
This rewrites (the misnamed) setup_reflog_action() from shell to C. The new version is called prepare_branch_to_be_rebased(). A new command is added to rebase--helper.c, “checkout-base”, as well as a new flag, “verbose”, to avoid silencing the output of the checkout operation called by checkout_ba

[GSoC][PATCH v5 04/20] rebase -i: rewrite the edit-todo functionality in C

2018-07-31 Thread Alban Gruin
This rewrites the edit-todo functionality from shell to C. To achieve that, a new command mode, `edit-todo`, is added, and the `write-edit-todo` flag is removed, as the shell script does not need to write the edit todo help message to the todo list anymore. The shell version is then stripped in f

[GSoC][PATCH v5 03/20] editor: add a function to launch the sequence editor

2018-07-31 Thread Alban Gruin
As part of the rewrite of interactive rebase, the sequencer will need to open the sequence editor to allow the user to edit the todo list. Instead of duplicating the existing launch_editor() function, this refactors it to a new function, launch_specified_editor(), which takes the editor as a parame

[GSoC][PATCH v5 05/20] sequencer: add a new function to silence a command, except if it fails

2018-07-31 Thread Alban Gruin
This adds a new function, run_command_silent_on_success(), to redirect the stdout and stderr of a command to a strbuf, and then to run that command. This strbuf is printed only if the command fails. It is functionnaly similar to output() from git-rebase.sh. run_git_commit() is then refactored to u

[GSoC][PATCH v5 00/20] rebase -i: rewrite in C

2018-07-31 Thread Alban Gruin
This patch series rewrite the interactive rebase from shell to C. It is based on ffc6fa0e39 ("Fourth batch for 2.19 cycle", 2018-07-24). The v4 was based on b7bd9486 ("Third batch for 2.19 cycle", 2018-07-18). I wanted to make sure my series works well with 'bb/pedantic', 'jk/empty-pick-fix', and

[GSoC][PATCH v5 01/20] sequencer: make two functions and an enum from sequencer.c public

2018-07-31 Thread Alban Gruin
This makes rebase_path_todo(), get_missing_commit_check_level() and the enum check_level accessible outside sequencer.c, renames check_level to missing_commit_check_level, and prefixes its value names by MISSING_COMMIT_ to avoid namespace pollution. This function and this enum will eventually be m

[GSoC][PATCH v5 12/20] rebase -i: remove unused modes and functions

2018-07-31 Thread Alban Gruin
This removes the modes `--skip-unnecessary-picks`, `--append-todo-help`, and `--checkout-onto` from rebase--helper.c, the functions of git-rebase--interactive.sh that were rendered useless by the rewrite of complete_action(), and append_todo_help_to_file() from rebase-interactive.c. skip_unnecessa

[GSoC][PATCH v5 11/20] rebase -i: rewrite complete_action() in C

2018-07-31 Thread Alban Gruin
This rewrites complete_action() from shell to C. A new mode is added to rebase--helper (`--complete-action`), as well as a new flag (`--autosquash`). Finally, complete_action() is stripped from git-rebase--interactive.sh. The original complete_action() would return the code 2 when the todo list

[GSoC][PATCH v5 08/20] sequencer: refactor append_todo_help() to write its message to a buffer

2018-07-31 Thread Alban Gruin
This refactors append_todo_help() to write its message to a buffer instead of the todo-list. This is needed for the rewrite of complete_action(), which will come after the next commit. As rebase--helper still needs the file manipulation part of append_todo_help(), it is extracted to a temporary f

[GSoC][PATCH v5 10/20] t3404: todo list with commented-out commands only aborts

2018-07-31 Thread Alban Gruin
If the todo list generated by `--make-script` is empty, complete_action() writes a noop, but if it has only commented-out commands, it will abort with the message "Nothing to do", and does not launch the editor. This adds a new test to ensure that complete_action() behaves this way. Signed-off-by

[GSoC][PATCH v5 07/20] rebase -i: rewrite checkout_onto() in C

2018-07-31 Thread Alban Gruin
This rewrites checkout_onto() from shell to C. A new command (“checkout-onto”) is added to rebase--helper.c. The shell version is then stripped. Signed-off-by: Alban Gruin --- No changes since v4. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25

[GSoC][PATCH v5 09/20] sequencer: change the way skip_unnecessary_picks() returns its result

2018-07-31 Thread Alban Gruin
Instead of skip_unnecessary_picks() printing its result to stdout, it returns it into a struct object_id, as the rewrite of complete_action() (to come in the next commit) will need it. rebase--helper then is modified to fit this change. Signed-off-by: Alban Gruin --- No changes since v4. built

[GSoC][PATCH v5 15/20] rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
This rewrites write_basic_state() from git-rebase.sh in C. This is the first step in the conversion of init_basic_state(), hence the mode in rebase--helper.c is called INIT_BASIC_STATE. init_basic_state() will be converted in the next commit. The part of read_strategy_opts() that parses the stat

[GSoC][PATCH v5 17/20] rebase -i: implement the main part of interactive rebase as a builtin

2018-07-31 Thread Alban Gruin
This rewrites the part of interactive rebase which initializes the basic state, make the script and complete the action, as a buitin, named git-rebase--interactive2 for now. Others modes (`--continue`, `--edit-todo`, etc.) will be rewritten in the next commit. git-rebase--interactive.sh is modifi

[GSoC][PATCH v5 19/20] rebase -i: remove git-rebase--interactive.sh

2018-07-31 Thread Alban Gruin
This removes git-rebase--interactive.sh, as its functionnality has been replaced by git-rebase--interactive2. git-rebase--interactive2.c is then renamed to git-rebase--interactive.c. Signed-off-by: Alban Gruin --- No changes since v4. .gitignore| 1 - Makef

[GSoC][PATCH v5 18/20] rebase--interactive2: rewrite the submodes of interactive rebase in C

2018-07-31 Thread Alban Gruin
This rewrites the submodes of interactive rebase (`--continue`, `--skip`, `--edit-todo`, and `--show-current-patch`) in C. git-rebase.sh is then modified to call directly git-rebase--interactive2 instead of git-rebase--interactive.sh. Signed-off-by: Alban Gruin --- No changes since v4. builtin

[GSoC][PATCH v5 16/20] rebase -i: rewrite init_basic_state() in C

2018-07-31 Thread Alban Gruin
This rewrites init_basic_state() from shell to C. The call to write_basic_state() in cmd_rebase__helper() is replaced by a call to the new function. The shell version is then stripped from git-rebase--interactive.sh. Signed-off-by: Alban Gruin --- No changes since v4. builtin/rebase--helper.c

[GSoC][PATCH v5 13/20] rebase -i: implement the logic to initialize $revisions in C

2018-07-31 Thread Alban Gruin
This rewrites the part of init_revisions_and_shortrevisions() needed by `--make-script` from shell to C. The new version is called get_revision_ranges(), and is a static function inside of rebase--helper.c. As this does not initialize $shortrevision, the original shell version is not yet stripped

  1   2   >