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
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
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
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
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
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):
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:
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
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
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
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
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 () {
> >>
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" != - &&
>>
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
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
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
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
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
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.
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
>
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
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
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
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
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
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
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
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
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
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
---
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
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
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'"
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
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
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
---
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
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 +--
>
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
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
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
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
42 matches
Mail list logo