Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Junio, On Mon, 7 May 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> If tbdiff were "Thomas's branch diff", I would call this jbdiff ;-) > >> but I think the 't' in there stands for "topic", not "Thomas's". > >> > >> How about "git topic-diff"?

Re: [PATCH v2 13/18] color: provide inverted colors, too

2018-05-06 Thread Johannes Schindelin
Hi Junio, On Mon, 7 May 2018, Junio C Hamano wrote: > Jeff King writes: > > > So really, I guess all I am arguing for is having GIT_COLOR_INV (or > > REVERSE) as a constant, and then teaching the code to combine it with > > the existing "new" color. It's perfectly OK to have: >

Re: What's cooking in git.git (Apr 2018, #04; Mon, 30)

2018-05-06 Thread Junio C Hamano
Elijah Newren writes: > Hi Junio, > > On Sun, Apr 29, 2018 at 8:25 PM, Junio C Hamano wrote: >> * en/rename-directory-detection-reboot (2018-04-25) 36 commits > >> >> Reboot of an attempt to detect wholesale directory renames and use >> it while merging.

Re: [PATCH 2/2] Documentation: render revisions correctly under Asciidoctor

2018-05-06 Thread Martin Ågren
On 6 May 2018 at 22:42, brian m. carlson wrote: > When creating a literal block from an indented block without any sort of > delimiters, Asciidoctor strips off all leading whitespace, resulting in > a misrendered chart. Use an explicit literal block to indicate to >

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-06 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Right, and I'm with you so far, this makes sense to me for all existing > uses of the peel syntax, otherwise v2.17.0^{tree} wouldn't be the same > as rev-parse v2.17.0^{tree}^{tree}... More importantly, you could spell v2.17.0 part of the

Re: [PATCH] mailmap: update brian m. carlson's email address

2018-05-06 Thread Junio C Hamano
"brian m. carlson" writes: > The order of addresses in the mailmap file was reversed, leading to git > preferring the crustytoothpaste.ath.cx address, which is obsolete, over > the crustytoothpaste.net address, which is current. Switch the order of > the addresses

Re: [PATCH 1/2] Documentation: use 8-space tabs with Asciidoctor

2018-05-06 Thread Junio C Hamano
"brian m. carlson" writes: > Asciidoctor expands tabs at the beginning of a line. However, it does > not expand them into 8 spaces by default. Since we use 8-space tabs, > tell Asciidoctor that we want 8 spaces by setting the tabsize attribute. > This ensures that

Re: [PATCH 00/28] Hash-independent tests (part 2)

2018-05-06 Thread brian m. carlson
On Sun, May 06, 2018 at 09:49:45PM -0400, Eric Sunshine wrote: > On Sun, May 6, 2018 at 7:17 PM, brian m. carlson > wrote: > > This series introduces an SHA1 prerequisite which checks if the hash in > > use is SHA-1, and can be used to skip the test if it is not. > >

Re: [PATCH 16/28] t4008: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
On Sun, May 06, 2018 at 08:07:46PM -0400, Eric Sunshine wrote: > On Sun, May 6, 2018 at 7:17 PM, brian m. carlson > wrote: > > Adjust the test so that it computes variables for blobs instead of using > > hard-coded hashes. > > > > Signed-off-by: brian m. carlson

Re: [PATCH 14/28] t3905: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
On Sun, May 06, 2018 at 08:03:27PM -0400, Eric Sunshine wrote: > On Sun, May 6, 2018 at 7:17 PM, brian m. carlson > wrote: > > Adjust the test so that it computes variables for blobs instead of using > > hard-coded hashes. > > > > Signed-off-by: brian m. carlson

Re: [PATCH 04/28] t/test-lib: introduce FULL_HEX

2018-05-06 Thread brian m. carlson
On Sun, May 06, 2018 at 07:53:42PM -0400, Eric Sunshine wrote: > On Sun, May 6, 2018 at 7:17 PM, brian m. carlson > wrote: > > Currently we have a variable, $_x40, which contains a regex that matches > > a full 40-character hex constant. However, with NewHash, we'll

Re: [PATCH v2 00/18] Add `branch-diff`, a `tbdiff` lookalike

2018-05-06 Thread Johannes Schindelin
Hi Brian, On Sun, 6 May 2018, brian m. carlson wrote: > On Fri, May 04, 2018 at 05:34:27PM +0200, Johannes Schindelin wrote: > > The incredibly useful `git-tbdiff` tool to compare patch series (say, > > to see what changed between two iterations sent to the Git mailing > > list) is slightly less

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Eric, On Sun, 6 May 2018, Eric Sunshine wrote: > On Sun, May 6, 2018 at 8:21 AM, Johannes Schindelin > wrote: > > On Sun, 6 May 2018, Junio C Hamano wrote: > >> Johannes Schindelin writes: > >> > On Sat, 5 May 2018, Jeff King wrote: >

Re: [PATCH v2 07/18] branch-diff: indent the diffs just like tbdiff

2018-05-06 Thread Johannes Schindelin
Hi Martin, On Sun, 6 May 2018, Martin Ågren wrote: > On 4 May 2018 at 17:34, Johannes Schindelin > wrote: > > @@ -353,6 +358,7 @@ static void output(struct string_list *a, struct > > string_list *b, > > int cmd_branch_diff(int argc, const char **argv, const char

Re: [PATCH v2 12/18] branch-diff: use color for the commit pairs

2018-05-06 Thread Johannes Schindelin
Hi Todd, On Sat, 5 May 2018, Todd Zullinger wrote: > > @@ -430,6 +451,8 @@ int cmd_branch_diff(int argc, const char **argv, const > > char *prefix) > > struct string_list branch1 = STRING_LIST_INIT_DUP; > > struct string_list branch2 = STRING_LIST_INIT_DUP; > > > > +

Re: [PATCH 00/28] Hash-independent tests (part 2)

2018-05-06 Thread Eric Sunshine
On Sun, May 6, 2018 at 7:17 PM, brian m. carlson wrote: > This series introduces an SHA1 prerequisite which checks if the hash in > use is SHA-1, and can be used to skip the test if it is not. > Additionally, because NewHash will be 256-bit, I introduced aliases for

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Junio C Hamano
Johannes Schindelin writes: >> If tbdiff were "Thomas's branch diff", I would call this jbdiff ;-) >> but I think the 't' in there stands for "topic", not "Thomas's". >> >> How about "git topic-diff"? > > Or `git topic-branch-diff`? Yeah something along that line,

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Buga, On Sun, 6 May 2018, Igor Djordjevic wrote: > On 06/05/2018 14:10, Johannes Schindelin wrote: > > > I think Todd's idea to shift it from a full-blown builtin to a cmdmode > > of `branch` makes tons of sense. > > I don`t know, I still find it a bit strange that in order to "diff >

Re: [PATCH v2 13/18] color: provide inverted colors, too

2018-05-06 Thread Junio C Hamano
Jeff King writes: > On Sun, May 06, 2018 at 02:35:44AM -0400, Jeff King wrote: > >> You'd have to introduce GIT_COLOR_REVERSE. I don't think we have a >> constant for it yet, but it's \x[7m. > > Heh, of course you knew that already, as I just noticed your patch is > using the

Re: [PATCH v2 18/18] completion: support branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Duy, On Sun, 6 May 2018, Duy Nguyen wrote: > On Fri, May 04, 2018 at 05:35:11PM +0200, Johannes Schindelin wrote: > > Tab completion of `branch-diff` is very convenient, especially given > > that the revision arguments that need to be passed to `git branch-diff` > > are typically more complex

Re: [PATCH v2 13/18] color: provide inverted colors, too

2018-05-06 Thread Johannes Schindelin
Hi Peff, On Sun, 6 May 2018, Jeff King wrote: > On Sun, May 06, 2018 at 02:35:44AM -0400, Jeff King wrote: > > > You'd have to introduce GIT_COLOR_REVERSE. I don't think we have a > > constant for it yet, but it's \x[7m. > > Heh, of course you knew that already, as I just noticed your patch is

Re: [PATCH 16/28] t4008: abstract away SHA-1-specific constants

2018-05-06 Thread Eric Sunshine
On Sun, May 6, 2018 at 7:17 PM, brian m. carlson wrote: > Adjust the test so that it computes variables for blobs instead of using > hard-coded hashes. > > Signed-off-by: brian m. carlson > --- > diff --git

Re: [PATCH 14/28] t3905: abstract away SHA-1-specific constants

2018-05-06 Thread Eric Sunshine
On Sun, May 6, 2018 at 7:17 PM, brian m. carlson wrote: > Adjust the test so that it computes variables for blobs instead of using > hard-coded hashes. > > Signed-off-by: brian m. carlson > --- > diff --git

[RFC] Other chunks for commit-graph, part 2 - reachability indexes

2018-05-06 Thread Jakub Narebski
Hello, In previous email I wrote: JN> As this post is getting long, I'll post other ideas, about commit JN> labeling for faster reachability queries in a separate email. This is this email. Here is second part of series dedicated to discussing what other data, like various reachability

Re: [PATCH 04/28] t/test-lib: introduce FULL_HEX

2018-05-06 Thread Eric Sunshine
On Sun, May 6, 2018 at 7:17 PM, brian m. carlson wrote: > Currently we have a variable, $_x40, which contains a regex that matches > a full 40-character hex constant. However, with NewHash, we'll have > object IDs that are longer than 40 characters. In such a case,

Re: [PATCH v10 18/36] merge-recursive: add get_directory_renames()

2018-05-06 Thread SZEDER Gábor
> diff --git a/merge-recursive.c b/merge-recursive.c > index 30894c1cc7..22c5e8e5c9 100644 > --- a/merge-recursive.c > +++ b/merge-recursive.c > +static struct hashmap *get_directory_renames(struct diff_queue_struct *pairs, > + struct tree *tree) > +{ > +

Re: [bug] Multiline value should error if the next line is section

2018-05-06 Thread SZEDER Gábor
> On Sun, 6 May 2018 22:03:10 +0200 > Martin Ågren wrote: > > On 6 May 2018 at 21:03, Shulhan wrote: > > > [alias] > > > tree = --no-pager log --graph \ > > > -n 20 \ > > > [user] > > > name = Shulhan > > > > > > (2) Run

[PATCH] mailmap: update brian m. carlson's email address

2018-05-06 Thread brian m. carlson
The order of addresses in the mailmap file was reversed, leading to git preferring the crustytoothpaste.ath.cx address, which is obsolete, over the crustytoothpaste.net address, which is current. Switch the order of the addresses so that git log displays the correct address. Signed-off-by: brian

[PATCH 19/28] t4022: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4022-diff-rewrite.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t4022-diff-rewrite.sh

[PATCH 24/28] t4205: sort log output in a hash-independent way

2018-05-06 Thread brian m. carlson
This test enumerates log entries and then sorts them. For SHA-1, this produces results that happen to sort in the order specified in the test, but for other hash algorithms they sort differently. Ensure we sort the log entries in a hash-independent way by sorting on the ref name instead of the

[PATCH 27/28] t4208: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4208-log-magic-pathspec.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t4208-log-magic-pathspec.sh

[PATCH 25/28] t4042: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4042-diff-textconv-caching.sh | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git

[PATCH 22/28] t4030: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4030-diff-textconv.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t4030-diff-textconv.sh

[PATCH 23/28] t/lib-diff-alternative: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test code so that it computes variables for blobs instead of using hard-coded hashes. This makes t4033 and t4050 (the patience and histogram tests) pass. Signed-off-by: brian m. carlson --- t/lib-diff-alternative.sh | 12 1 file changed, 8

[PATCH 13/28] t3702: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Strip out the index lines in the diff before comparing them, as these will differ between hash algorithms. This leads to a smaller, simpler change than editing the index line. Signed-off-by: brian m. carlson --- t/t3702-add-edit.sh | 7 +++ 1 file changed, 3

[PATCH 15/28] t4007: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs and uses the ZERO_OID variable instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4007-rename-3.sh | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git

[PATCH 08/28] t1512: skip test if not using SHA-1

2018-05-06 Thread brian m. carlson
This test relies on objects with colliding short names which are necessarily dependent on the hash used. Skip the test if we're not using SHA-1. Signed-off-by: brian m. carlson --- t/t1512-rev-parse-disambiguation.sh | 6 ++ 1 file changed, 6 insertions(+)

[PATCH 28/28] t5300: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t5300-pack-object.sh | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/t/t5300-pack-object.sh

[PATCH 26/28] t4045: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4045-diff-relative.sh | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t4045-diff-relative.sh

[PATCH 17/28] t4014: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes values for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4014-format-patch.sh | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/t/t4014-format-patch.sh

[PATCH 18/28] t4020: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4020-diff-external.sh | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/t4020-diff-external.sh

[PATCH 20/28] t4029: fix test indentation

2018-05-06 Thread brian m. carlson
We typically indent our tests with a single tab, partially so that we can take advantage of indented heredocs. Make this change and move the quote marks to be in the typical position for our tests. Signed-off-by: brian m. carlson --- t/t4029-diff-trailing-space.sh

[PATCH 21/28] t4029: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4029-diff-trailing-space.sh | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/t4029-diff-trailing-space.sh

[PATCH 16/28] t4008: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t4008-diff-break-rewrite.sh | 59 +++ 1 file changed, 32 insertions(+), 27 deletions(-) diff --git

[PATCH 11/28] t2203: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t2203-add-intent.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t2203-add-intent.sh

[PATCH 14/28] t3905: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t3905-stash-include-untracked.sh | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git

[PATCH 10/28] t: skip pack tests if not using SHA-1

2018-05-06 Thread brian m. carlson
These tests rely on creating packs with specially named objects which are necessarily dependent on the hash used. Skip these tests if we're not using SHA-1. Signed-off-by: brian m. carlson --- t/t5308-pack-detect-duplicates.sh | 6 ++

[PATCH 07/28] t1007: annotate with SHA1 prerequisite

2018-05-06 Thread brian m. carlson
Since this is a core test that tests basic functionality, annotate the assertions that have dependencies on SHA-1 with the appropriate prerequisite. Signed-off-by: brian m. carlson --- t/t1007-hash-object.sh | 16 1 file changed, 8 insertions(+), 8

[PATCH 04/28] t/test-lib: introduce FULL_HEX

2018-05-06 Thread brian m. carlson
Currently we have a variable, $_x40, which contains a regex that matches a full 40-character hex constant. However, with NewHash, we'll have object IDs that are longer than 40 characters. In such a case, $_x40 will be a confusing name. Create a $FULL_HEX variable which will always reflect a

[PATCH 09/28] t4044: skip test if not using SHA-1

2018-05-06 Thread brian m. carlson
This test relies on objects with colliding short names which are necessarily dependent on the hash used. Skip the test if we're not using SHA-1. Signed-off-by: brian m. carlson --- t/t4044-diff-index-unique-abbrev.sh | 6 ++ 1 file changed, 6 insertions(+)

[PATCH 02/28] t/test-lib: introduce ZERO_OID

2018-05-06 Thread brian m. carlson
Currently we have a variable, $_z40, which contains the all-zero object ID. However, with NewHash, we'll have an all-zero object ID which is longer than 40 hex characters. In such a case, $_z40 will be a confusing name. Create a $ZERO_OID variable which will always reflect the all-zeros object

[PATCH 12/28] t3103: abstract away SHA-1-specific constants

2018-05-06 Thread brian m. carlson
Adjust the test so that it uses variables and command substitution for trees instead of hard-coded hashes. This also has the benefit of making it more obvious how the test works. Signed-off-by: brian m. carlson --- t/t3103-ls-tree-misc.sh | 3 ++- 1 file changed,

[PATCH 06/28] t0000: annotate with SHA1 prerequisite

2018-05-06 Thread brian m. carlson
Since this is a core test that tests basic functionality, annotate the assertions that have dependencies on SHA-1 with the appropriate prerequisite. Signed-off-by: brian m. carlson --- t/t-basic.sh | 24 1 file changed, 12

[PATCH 00/28] Hash-independent tests (part 2)

2018-05-06 Thread brian m. carlson
This is part 2 in the series to make tests hash independent. This series introduces an SHA1 prerequisite which checks if the hash in use is SHA-1, and can be used to skip the test if it is not. Additionally, because NewHash will be 256-bit, I introduced aliases for the test constants $_x40 and

[PATCH 01/28] t/test-lib: add an SHA1 prerequisite

2018-05-06 Thread brian m. carlson
There are some basic tests in our codebase that test that we get fixed SHA-1 values. These are valuable because they make sure that our SHA-1 implementation is free of bugs, but obviously these tests will fail with a different hash. There are also tests which intentionally produce objects that

[PATCH 03/28] t: switch $_z40 to $ZERO_OID

2018-05-06 Thread brian m. carlson
Switch all uses of $_z40 to $ZERO_OID so that they work correctly with larger hashes. This commit was created by using the following sed command to modify all files in the t directory except t/test-lib.sh: sed -i 's/\$_z40/$ZERO_OID/g' Signed-off-by: brian m. carlson

[PATCH 05/28] t: switch $_x40 to $FULL_HEX

2018-05-06 Thread brian m. carlson
Switch all uses of $_x40 to $FULL_HEX so that they work correctly with larger hashes. This commit was created by using the following sed command to modify all files in the t directory except t/test-lib.sh: sed -i 's/\$_x40/$FULL_HEX/g' Signed-off-by: brian m. carlson

Re: [bug] Multiline value should error if the next line is section

2018-05-06 Thread Shulhan
On Sun, 6 May 2018 22:03:10 +0200 Martin Ågren wrote: > Hi Shulhan > > Thank you for your report. I'm abbreviating a bit: > > On 6 May 2018 at 21:03, Shulhan wrote: > > [alias] > > tree = --no-pager log --graph \ > > -n 20 \ >

Re: [PATCH v2 00/18] Add `branch-diff`, a `tbdiff` lookalike

2018-05-06 Thread brian m. carlson
On Fri, May 04, 2018 at 05:34:27PM +0200, Johannes Schindelin wrote: > The incredibly useful `git-tbdiff` tool to compare patch series (say, to see > what changed between two iterations sent to the Git mailing list) is slightly > less useful for this developer due to the fact that it requires the

Re: [bug] Multiline value should error if the next line is section

2018-05-06 Thread brian m. carlson
On Sun, May 06, 2018 at 10:03:10PM +0200, Martin Ågren wrote: > This behavior looks correct to me, though. It seems very hard to me to > second-guess what the user meant. For example, what if that third line > contained a "="? Like: > > [alias] > huh = !dd \ > bs=1024 ... >

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Eric Sunshine
On Sun, May 6, 2018 at 8:21 AM, Johannes Schindelin wrote: > On Sun, 6 May 2018, Junio C Hamano wrote: >> Johannes Schindelin writes: >> > On Sat, 5 May 2018, Jeff King wrote: >> >> One minor point about the name: will it become annoying as

[PATCH 1/2] Documentation: use 8-space tabs with Asciidoctor

2018-05-06 Thread brian m. carlson
Asciidoctor expands tabs at the beginning of a line. However, it does not expand them into 8 spaces by default. Since we use 8-space tabs, tell Asciidoctor that we want 8 spaces by setting the tabsize attribute. This ensures that our ASCII art renders properly. Signed-off-by: brian m. carlson

[PATCH 2/2] Documentation: render revisions correctly under Asciidoctor

2018-05-06 Thread brian m. carlson
When creating a literal block from an indented block without any sort of delimiters, Asciidoctor strips off all leading whitespace, resulting in a misrendered chart. Use an explicit literal block to indicate to Asciidoctor that we want to keep the leading whitespace. Signed-off-by: brian m.

Re: [bug] Multiline value should error if the next line is section

2018-05-06 Thread Martin Ågren
Hi Shulhan Thank you for your report. I'm abbreviating a bit: On 6 May 2018 at 21:03, Shulhan wrote: > [alias] > tree = --no-pager log --graph \ > -n 20 \ > [user] > name = Shulhan > > (2) Run `git config -f git.config -l` > > The command print

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Martin Ågren
On 6 May 2018 at 19:42, Duy Nguyen wrote: > On Sun, May 6, 2018 at 7:26 PM, Duy Nguyen wrote: >> On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: >>> These `struct lock_file`s are local to their respective functions and we >>> can

[bug] Multiline value should error if the next line is section

2018-05-06 Thread Shulhan
## Environment OS: Arch Linux Git version: git@next d54016d9e ## Reproduction Steps (1) Create the following `git.config`, ``` [alias] tree = --no-pager log --graph \ --date=format:'%Y-%m-%d' \ --pretty=format:'%C(auto,dim)%ad %<(7,trunc) %an %Creset%m

Weak option parsing in `git submodule`

2018-05-06 Thread Kaartic Sivaraam
I recently faced the consequence of the weak option parsing done by in `git submodule`. Initially tried to add a new submodule using the `git submodule add` sub-command in the following way, $ git submodule add ./foo/bar This cloned the submodule into a new directory named 'bar' in the

Re: [PATCH v4 7/7] contrib/git-jump/git-jump: jump to match column in addition to line

2018-05-06 Thread Ævar Arnfjörð Bjarmason
On Sun, May 06 2018, Martin Ågren wrote: > On 5 May 2018 at 04:43, Taylor Blau wrote: >> Take advantage of 'git-grep(1)''s new option, '--column' in order to >> teach Peff's 'git-jump' script how to jump to the correct column for any >> given match. >> >> 'git-grep(1)''s

Re: [PATCH v4 5/7] builtin/grep.c: add '--column' option to 'git-grep(1)'

2018-05-06 Thread Ævar Arnfjörð Bjarmason
On Sat, May 05 2018, Taylor Blau wrote: > + test_expect_success "grep -w $L (with --{line,column}-number)" ' It's now --column in v4 but this still refers to v3 --column-number.

Re: [PATCH v4 4/4] rebase --skip: clean up commit message after a failed fixup/squash

2018-05-06 Thread Phillip Wood
Hi Johannes, sorry it's taken me a while to look at this. I think it mostly makes sense to me, the code is well documented. I've got one comment below On 27/04/18 21:48, Johannes Schindelin wrote: > > During a series of fixup/squash commands, the interactive rebase builds > up a commit message

Re: [PATCH v4 5/7] builtin/grep.c: add '--column' option to 'git-grep(1)'

2018-05-06 Thread Phillip Wood
Hi Taylor On 05/05/18 03:43, Taylor Blau wrote: > > Teach 'git-grep(1)' a new option, '--column', to show the column > number of the first match on a non-context line. > > For example: > > $ git grep -n --column foo | head -n3 > .clang-format:51:14:# myFunction(foo, bar, baz); >

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Duy Nguyen
On Sun, May 6, 2018 at 7:26 PM, Duy Nguyen wrote: > On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: >> These `struct lock_file`s are local to their respective functions and we >> can drop their staticness. >> >> Signed-off-by: Martin Ågren

Re: [PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Duy Nguyen
On Sun, May 6, 2018 at 4:10 PM, Martin Ågren wrote: > These `struct lock_file`s are local to their respective functions and we > can drop their staticness. > > Signed-off-by: Martin Ågren > --- > apply.c| 2 +- > builtin/describe.c

Re: [PATCH 2/5] refs.c: do not die if locking fails in `write_pseudoref()`

2018-05-06 Thread Martin Ågren
On 6 May 2018 at 17:48, David Turner wrote: > On Sun, 2018-05-06 at 16:10 +0200, Martin Ågren wrote: >> While at it, make the lock non-static. > Re making the lock static, I wonder about the following case: > > if (read_ref(pseudoref, _old_oid)) > > die("could not read

Re: [PATCH 3/5] refs.c: drop dead code checking lock status in `delete_pseudoref()`

2018-05-06 Thread David Turner
Same concern here about staticness. On Sun, 2018-05-06 at 16:10 +0200, Martin Ågren wrote: > After taking the lock we check whether we got it and die otherwise. > But > since we take the lock using `LOCK_DIE_ON_ERROR`, we would already > have > died. > > Unlike in the previous patch, this

Re: [PATCH 2/5] refs.c: do not die if locking fails in `write_pseudoref()`

2018-05-06 Thread David Turner
Re making the lock static, I wonder about the following case: if (read_ref(pseudoref, _old_oid)) die("could not read ref '%s'", pseudoref); I think this calls exit(), and then atexit tries to clean up the lock files. But since lock is no longer static,

Re: [PATCH] refs: handle null-oid for pseudorefs

2018-05-06 Thread David Turner
LGTM. (This is the current best address to reach me, but do not expect fast responses over the next few days as I'm out of town) On Sun, 2018-05-06 at 15:35 +0200, Martin Ågren wrote: > According to the documentation on `git update-ref`, it is possible to > "specify 40 '0' or an empty string

Re: [PATCH v4 7/7] contrib/git-jump/git-jump: jump to match column in addition to line

2018-05-06 Thread Martin Ågren
On 5 May 2018 at 04:43, Taylor Blau wrote: > Take advantage of 'git-grep(1)''s new option, '--column' in order to > teach Peff's 'git-jump' script how to jump to the correct column for any > given match. > > 'git-grep(1)''s output is in the correct format for Vim's jump list,

Re: [PATCH v2 07/18] branch-diff: indent the diffs just like tbdiff

2018-05-06 Thread Martin Ågren
On 4 May 2018 at 17:34, Johannes Schindelin wrote: > @@ -353,6 +358,7 @@ static void output(struct string_list *a, struct > string_list *b, > int cmd_branch_diff(int argc, const char **argv, const char *prefix) > { > struct diff_options diffopt = { NULL }; >

[PATCH 5/5] lock_file: move static locks into functions

2018-05-06 Thread Martin Ågren
Each of these `struct lock_file`s is used from within a single function. Move them into the respective functions to make the scope clearer. While doing so, we can drop the staticness. After this commit, the remaing occurences of "static struct lock_file" are locks that are used from within

[PATCH 1/5] t/helper/test-write-cache: clean up lock-handling

2018-05-06 Thread Martin Ågren
Die in case writing the index fails, so that the caller can notice (instead of, say, being impressed by how performant the writing is). While at it, note that after opening a lock with `LOCK_DIE_ON_ERROR`, we do not need to worry about whether we succeeded. Also, we can move the `struct

[PATCH 3/5] refs.c: drop dead code checking lock status in `delete_pseudoref()`

2018-05-06 Thread Martin Ågren
After taking the lock we check whether we got it and die otherwise. But since we take the lock using `LOCK_DIE_ON_ERROR`, we would already have died. Unlike in the previous patch, this function is not prepared for indicating errors via a `strbuf err`, so let's just drop the dead code. Any

[PATCH 2/5] refs.c: do not die if locking fails in `write_pseudoref()`

2018-05-06 Thread Martin Ågren
If we could not take the lock, we add an error to the `strbuf err` and return. However, this code is dead. The reason is that we take the lock using `LOCK_DIE_ON_ERROR`. Drop the flag to allow our more gentle error-handling to actually kick in. We could instead just drop the dead code and die

[PATCH 4/5] lock_file: make function-local locks non-static

2018-05-06 Thread Martin Ågren
These `struct lock_file`s are local to their respective functions and we can drop their staticness. Signed-off-by: Martin Ågren --- apply.c| 2 +- builtin/describe.c | 2 +- builtin/difftool.c | 2 +- builtin/gc.c | 2 +- builtin/merge.c

[PATCH 0/5] getting rid of most "static struct lock_file"s

2018-05-06 Thread Martin Ågren
This series addresses two classes of "static struct lock_file", removing the staticness: Those locks that already live inside a function, and those that can simply be moved into the function they are used from. The first three patches are some cleanups I noticed along the way, where we first take

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Igor Djordjevic
Hi Dscho, On 06/05/2018 14:10, Johannes Schindelin wrote: > > > > > > This builtin does not do a whole lot so far, apart from showing a > > > > > usage that is oddly similar to that of `git tbdiff`. And for a > > > > > good reason: the next commits will turn `branch-diff` into a > > > > >

[PATCH] refs: handle null-oid for pseudorefs

2018-05-06 Thread Martin Ågren
According to the documentation on `git update-ref`, it is possible to "specify 40 '0' or an empty string as to make sure that the ref you are creating does not exist." But in the code for pseudorefs, we do not implement this. If we fail to read the old ref, we immediately die. A failure to read

Re: [GSoC] A blog about 'git stash' project

2018-05-06 Thread Kaartic Sivaraam
Hi Sebi, On Friday 04 May 2018 03:18 AM, Paul-Sebastian Ungureanu wrote: > Hello everybody, > > The community bonding period started. It is well known that for a > greater rate of success, it is recommended to send weekly reports > regarding project status. But, what would be a good form for

Re: [PATCH v2 00/18] Add `branch-diff`, a `tbdiff` lookalike

2018-05-06 Thread Johannes Schindelin
Hi Junio, On Sun, 6 May 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Johannes Schindelin (17): > > Add a function to solve least-cost assignment problems > > Add a new builtin: branch-diff > > Perhaps retitling these to > > hungarian: a

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Junio, On Sun, 6 May 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > > On Sat, 5 May 2018, Jeff King wrote: > > > >> On Fri, May 04, 2018 at 05:34:32PM +0200, Johannes Schindelin wrote: > >> > >> > This builtin does not do a whole lot so far, apart

Re: [PATCH v2 05/18] branch-diff: also show the diff between patches

2018-05-06 Thread Johannes Schindelin
Hi Buga, On Sun, 6 May 2018, Igor Djordjevic wrote: > On 04/05/2018 17:34, Johannes Schindelin wrote: > > Just like tbdiff, we now show the diff between matching patches. This is > > a "diff of two diffs", so it can be a bit daunting to read for the > > beginner. > > > > And just like tbdiff,

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Buga, On Sun, 6 May 2018, Igor Djordjevic wrote: > On 05/05/2018 23:57, Johannes Schindelin wrote: > > > > > > This builtin does not do a whole lot so far, apart from showing a > > > > usage that is oddly similar to that of `git tbdiff`. And for a > > > > good reason: the next commits will

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Duy, On Sun, 6 May 2018, Duy Nguyen wrote: > On Sun, May 6, 2018 at 6:53 AM, Jacob Keller wrote: > > On Sat, May 5, 2018 at 6:05 PM, Igor Djordjevic > > wrote: > >> > >> On 05/05/2018 23:57, Johannes Schindelin wrote: > >>> > >>> > > This

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Johannes Schindelin
Hi Todd, On Sat, 5 May 2018, Todd Zullinger wrote: > I wrote: > > Would it be possible and reasonable to teach 'git branch' to > > call this as a subcommand, i.e. as 'git branch diff'? Then > > the completion wouldn't offer git branch-diff. > > Of course right after I sent this, it occurred to

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-06 Thread Duy Nguyen
On Sun, May 6, 2018 at 6:53 AM, Jacob Keller wrote: > On Sat, May 5, 2018 at 6:05 PM, Igor Djordjevic > wrote: >> Hi Dscho, >> >> On 05/05/2018 23:57, Johannes Schindelin wrote: >>> >>> > > This builtin does not do a whole lot so far, apart

Re: [PATCH v2 18/18] completion: support branch-diff

2018-05-06 Thread Duy Nguyen
On Fri, May 04, 2018 at 05:35:11PM +0200, Johannes Schindelin wrote: > Tab completion of `branch-diff` is very convenient, especially given > that the revision arguments that need to be passed to `git branch-diff` > are typically more complex than, say, your grandfather's `git log` > arguments. >

Re: [PATCH v2 13/18] color: provide inverted colors, too

2018-05-06 Thread Jeff King
On Sun, May 06, 2018 at 02:35:44AM -0400, Jeff King wrote: > You'd have to introduce GIT_COLOR_REVERSE. I don't think we have a > constant for it yet, but it's \x[7m. Heh, of course you knew that already, as I just noticed your patch is using the reverse attribute internally (I had thought at

Re: [PATCH v2 13/18] color: provide inverted colors, too

2018-05-06 Thread Jeff King
On Sun, May 06, 2018 at 12:03:50AM +0200, Johannes Schindelin wrote: > > There's a "reverse" attribute (which we already parse and support) that > > can do this without having to repeat the colors. AFAIK it's well > > supported everywhere, but I could be wrong. > > How would I use that here,