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

2018-08-19 Thread brian m. carlson
On Sun, Aug 19, 2018 at 07:06:14PM -0400, Eric Sunshine wrote: > On Sun, Aug 19, 2018 at 5:50 PM brian m. carlson > wrote: > > I think what I'd like to do instead is store in a variable and make > > test_oid return unsuccessfully if the value doesn't exist. I think > > that's better for writing

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

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 5:50 PM brian m. carlson wrote: > On Sun, Aug 19, 2018 at 03:40:22PM -0400, Eric Sunshine wrote: > > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > > wrote: > > > + test "$(test_oid hexsz)" -eq $(wc -c > > + test $(( $(test_oid rawsz) * 2)) -eq

Re: [PATCH v2 05/11] t0027: make hash size independent'

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 5:57 PM brian m. carlson wrote: > On Sun, Aug 19, 2018 at 04:10:21PM -0400, Eric Sunshine wrote: > > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > > > - tr '\015\000abcdef0123456789' QN0 <"$2" >"$exp" && > > > + tr

[PATCH 4/4] tests: use 'test_must_be_empty' instead of 'test_cmp '

2018-08-19 Thread SZEDER Gábor
Using 'test_must_be_empty' is shorter and more idiomatic than >empty && test_cmp empty out as it saves the creation of an empty file. Furthermore, sometimes the expected empty file doesn't have such a descriptive name like 'empty', and its creation is far away from the place where it's

[PATCH 2/4] tests: use 'test_must_be_empty' instead of 'test ! -s'

2018-08-19 Thread SZEDER Gábor
Using 'test_must_be_empty' is preferable to 'test ! -s', because it gives a helpful error message if the given file is unexpectedly no empty, while the latter remains completely silent. Furthermore, it also catches cases when the given file unexpectedly does not exist at all. This patch was

[PATCH 0/4] tests: make more use of 'test_must_be_empty'

2018-08-19 Thread SZEDER Gábor
This series is a continuation of and applies on top of 'ab/test-must-be-empty-for-master', and converts even more places to use 'test_must_be_empty'. There are still a bunch of cases in the form of 'test -z "$(cmd...)"' that could use 'test_must_be_empty'... maybe someday. SZEDER Gábor (4):

Re: [PATCH v2 05/11] t0027: make hash size independent'

2018-08-19 Thread brian m. carlson
On Sun, Aug 19, 2018 at 04:10:21PM -0400, Eric Sunshine wrote: > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > wrote: > > We transform various object IDs into all-zero object IDs for comparison. > > Adjust the length as well so that this works for all hash algorithms. > > > > Signed-off-by:

[PATCH 1/4] tests: use 'test_must_be_empty' instead of '! test -s'

2018-08-19 Thread SZEDER Gábor
Using 'test_must_be_empty' is preferable to '! test -s', because it gives a helpful error message if the given file is unexpectedly not empty, while the latter remains completely silent. Furthermore, it also catches cases when the given file unexpectedly does not exist at all. This patch was

[PATCH 3/4] tests: use 'test_must_be_empty' instead of 'test_cmp /dev/null '

2018-08-19 Thread SZEDER Gábor
Using 'test_must_be_empty' is more idiomatic than 'test_cmp /dev/null out', and its message on error is perhaps a bit more to the point. This patch was basically created by running: sed -i -e 's%test_cmp /dev/null%test_must_be_empty%' t[0-9]*.sh with the exception of the change in 'should not

Re: [PATCH v2 03/11] t0000: update tests for SHA-256

2018-08-19 Thread brian m. carlson
On Sun, Aug 19, 2018 at 04:01:05PM -0400, Eric Sunshine wrote: > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > > diff --git a/t/t-basic.sh b/t/t-basic.sh > > @@ -868,8 +870,9 @@ test_expect_success 'writing tree out with git > > write-tree' ' > > +test_expect_success 'validate object

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

2018-08-19 Thread brian m. carlson
On Sun, Aug 19, 2018 at 03:40:22PM -0400, Eric Sunshine wrote: > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > wrote: > > diff --git a/t/oid-info/oid b/t/oid-info/oid > > @@ -0,0 +1,29 @@ > > +# All zeros or Fs missing one or two hex segments. > > +zero_1

Re: [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test

2018-08-19 Thread Jeff King
On Sun, Aug 19, 2018 at 11:37:59PM +0200, Andrei Rybak wrote: > On 19/08/18 22:32, Jeff King wrote: > > On Sun, Aug 19, 2018 at 07:50:42PM +0200, Andrei Rybak wrote: > > > >> 1. Check both files at the same time (combination with Gábor's > >> function): > >> > >>test_cmp () { > >>

Re: [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test

2018-08-19 Thread Andrei Rybak
On 19/08/18 22:32, Jeff King wrote: > On Sun, Aug 19, 2018 at 07:50:42PM +0200, Andrei Rybak wrote: > >> 1. Check both files at the same time (combination with Gábor's >> function): >> >> test_cmp () { >> if test "$1" != - && >> test "$2" != - && >>

Re: git-bug: Distributed bug tracker embedded in git

2018-08-19 Thread Jeff King
On Sat, Aug 18, 2018 at 03:08:21PM -0700, Jonathan Nieder wrote: > > So we don't get to say "you never asked us about git-annex, we're using > > that name now" without considering how widely used it is. It's us who > > decided to expose the API of seamlessly integrating 3rd party tools. > > I

Re: [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test

2018-08-19 Thread Jeff King
On Sun, Aug 19, 2018 at 07:50:42PM +0200, Andrei Rybak wrote: > > I actually think the above gives way too confusing output, when the > > actual output is empty and we are expecting some output. > > > > The tester wants to hear from test_cmp "your 'git cmd' produced some > > output when we are

Re: [PATCH v2 05/11] t0027: make hash size independent

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson wrote: > We transform various object IDs into all-zero object IDs for comparison. > Adjust the length as well so that this works for all hash algorithms. > > Signed-off-by: brian m. carlson > --- > diff --git a/t/t0027-auto-crlf.sh

Re: [PATCH v2 04/11] t0002: abstract away SHA-1 specific constants

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson wrote: > Adjust the test so that it computes variables for object IDs instead of > using hard-coded hashes. Nit: s/hashes/hash values/ > Signed-off-by: brian m. carlson > --- > diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh > @@ -92,11

Re: [PATCH v2 03/11] t0000: update tests for SHA-256

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson wrote: > Test t tests the "basics of the basics" and as such, checks that we > have various fixed hard-coded object IDs. The tests relying on these > assertions have been marked with the SHA1 prerequisite, as they will > obviously not function

Re: [PATCH v2 02/11] t0000: use hash translation table

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson wrote: > If the hash we're using is 32 bytes in size, attempting to insert a > 20-byte object name won't work. Since these are synthesized objects > that are almost all zeros, look them up in a translation table. > > Signed-off-by: brian m.

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

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson wrote: > diff --git a/t/oid-info/oid b/t/oid-info/oid > @@ -0,0 +1,29 @@ > +# All zeros or Fs missing one or two hex segments. > +zero_1 sha1:000 > +zero_2 >

[PATCH v2 07/11] t1006: make hash size independent

2018-08-19 Thread brian m. carlson
Compute the size of the tree and commit objects we're creating by checking for the size of an object ID and computing the resulting sizes accordingly. Signed-off-by: brian m. carlson --- t/t1006-cat-file.sh | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v2 05/11] t0027: make hash size independent

2018-08-19 Thread brian m. carlson
We transform various object IDs into all-zero object IDs for comparison. Adjust the length as well so that this works for all hash algorithms. Signed-off-by: brian m. carlson --- t/t0027-auto-crlf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t0027-auto-crlf.sh

[PATCH v2 10/11] t1406: make hash-size independent

2018-08-19 Thread brian m. carlson
Instead of hard-coding a 40-based constant, split the output of for-each-ref and for-each-reflog by field. Signed-off-by: brian m. carlson --- t/t1406-submodule-ref-store.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t1406-submodule-ref-store.sh

[PATCH v2 09/11] t1405: make hash size independent

2018-08-19 Thread brian m. carlson
Instead of hard-coding a 40-based constant, split the output of for-each-ref and for-each-reflog by field. Signed-off-by: brian m. carlson --- t/t1405-main-ref-store.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh

[PATCH v2 00/11] Hash-independent tests (part 3)

2018-08-19 Thread brian m. carlson
This is next in the series of improvements to make tests hash-independent. This round modifies the helpers to more closely follow the lighter-weight design that Eric Sunshine suggested in v1, at the cost of requiring lookup keys to be shell identifiers. If that's judged to be undesirable, I can

[PATCH v2 04/11] t0002: abstract away SHA-1 specific constants

2018-08-19 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/t0002-gitfile.sh | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh index

[PATCH v2 06/11] t0064: make hash size independent

2018-08-19 Thread brian m. carlson
Compute test values of the appropriate size instead of hard-coding 40-character values. Rename the echo20 function to echoid, since the values may be of varying sizes. Signed-off-by: brian m. carlson --- t/t0064-sha1-array.sh | 49 --- 1 file changed, 27

[PATCH v2 11/11] t1407: make hash size independent

2018-08-19 Thread brian m. carlson
Instead of hard-coding a 40-based constant, split the output of for-each-ref and for-each-reflog by field. Signed-off-by: brian m. carlson --- t/t1407-worktree-ref-store.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1407-worktree-ref-store.sh

[PATCH v2 01/11] t: add tool to translate hash-related values

2018-08-19 Thread brian m. carlson
Add a test function helper, test_oid, that produces output that varies depending on the hash in use. Add an additional helper, test_oid_cache, that can be used to load data for test_oid, either through a list of filenames or on standard input. Check that these functions work in t, as the

[PATCH v2 08/11] t1400: switch hard-coded object ID to variable

2018-08-19 Thread brian m. carlson
Switch a hard-coded all-zeros object ID to use a variable instead. Signed-off-by: brian m. carlson --- t/t1400-update-ref.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 7c8df20955..6072650686 100755 ---

[PATCH v2 02/11] t0000: use hash translation table

2018-08-19 Thread brian m. carlson
If the hash we're using is 32 bytes in size, attempting to insert a 20-byte object name won't work. Since these are synthesized objects that are almost all zeros, look them up in a translation table. Signed-off-by: brian m. carlson --- t/t-basic.sh | 13 +++-- 1 file changed, 7

[PATCH v2 03/11] t0000: update tests for SHA-256

2018-08-19 Thread brian m. carlson
Test t tests the "basics of the basics" and as such, checks that we have various fixed hard-coded object IDs. The tests relying on these assertions have been marked with the SHA1 prerequisite, as they will obviously not function in their current form with SHA-256. Use the test_oid helper to

Re: [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test

2018-08-19 Thread Andrei Rybak
On 17/08/18 22:09, Junio C Hamano wrote: > Andrei Rybak writes: >> >> I'll try something like the following on the weekend: >> >> test_cmp () { >> if test "$1" != - && ! test -s "$1" >> then >> echo >&4 "error: trying to compare empty file '$1'"

[PATCH] remote: improve argument help for add --mirror

2018-08-19 Thread René Scharfe
Group the possible values using a pair of parentheses and don't mark them for translation, as they are literal strings that have to be used as-is in any locale. Signed-off-by: Rene Scharfe --- builtin/remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/remote.c

[PATCH] parseopt: group literal string alternatives in argument help

2018-08-19 Thread René Scharfe
This formally clarifies that the "--option=" part is the same for all alternatives. Signed-off-by: Rene Scharfe --- builtin/pull.c | 2 +- builtin/push.c | 4 ++-- builtin/send-pack.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/pull.c

[PATCH] checkout-index: improve argument help for --stage

2018-08-19 Thread René Scharfe
Spell out all alternatives and avoid using a numerical range operator, as it is not mentioned in CodingGuidelines and the resulting string is still concise. Wrap them in parentheses to document clearly that the "--stage=" part is common among them. Signed-off-by: Rene Scharfe ---

Re: Git Project Leadership Committee

2018-08-19 Thread Ævar Arnfjörð Bjarmason
On Thu, Aug 16 2018, Jeff King wrote: > - Christian Couder > - Ævar Arnfjörð Bjarmason Thanks for the nomination. I'm happy to help the project by serving on the leadership committee if you'll have me. > Both are active, have been around a long time, and have taken part in > non-code

Re: [PATCH v7 09/16] fetch: support filters

2018-08-19 Thread Duy Nguyen
On Fri, Dec 8, 2017 at 5:00 PM Jeff Hostetler wrote: > > From: Jeff Hostetler > > Teach fetch to support filters. This is only allowed for the remote > configured in extensions.partialcloneremote. > > Signed-off-by: Jonathan Tan > --- > builtin/fetch.c | 23 +-- >

[PATCH] generate-cmdlist.sh: collect config from all config.txt files

2018-08-19 Thread Nguyễn Thái Ngọc Duy
This script uses Documentation/config.txt as input for "git help --config" and "git config" completion but it misses the fact that config.txt includes other txt files. Include all *config.txt as input when scanning for config keys. This could produce false positives, but as long as we stick to the

Hi, pretty

2018-08-19 Thread Larry
Hallo schön, ich bin Larry aus den Vereinigten Staaten, ich hoffe, dass diese Nachricht gut zu dir gelangt? .. Ich bin ein einzelner Mann, ich war noch nie verheiratet, bevor ich dich wirklich besser kennenlernen will, ich bin ein unbekümmerter mann, und ich suche gerade nach einem ernsten

Re: [GSoC][PATCH v7 26/26] stash: replace all "git apply" child processes with API calls

2018-08-19 Thread Thomas Gummerer
On 08/08, Paul-Sebastian Ungureanu wrote: > `apply_all_patches()` does not provide a method to apply patches > from strbuf. Because of this, this commit introduces a new > function `apply_patch_from_buf()` which applies a patch from buf. > It works by saving the strbuf as a file. This way we can

Re: [GSoC][PATCH v7 25/26] stash: replace all `write-tree` child processes with API calls

2018-08-19 Thread Thomas Gummerer
On 08/08, Paul-Sebastian Ungureanu wrote: > This commit replaces spawning `git write-tree` with API calls. > --- > builtin/stash.c | 40 > 1 file changed, 12 insertions(+), 28 deletions(-) Nice reduction in lines here! > > diff --git a/builtin/stash.c