Re: [PATCHv2 2/7] revision.h: introduce blob/tree walking in order of the commits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 1, 2017, 03:50 UTC
- Message-ID
- <xmqqr2tiveqp.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171031211852.13001-3-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 25 quoted lines
> diff --git a/t/t6100-rev-list-in-order.sh b/t/t6100-rev-list-in-order.sh > new file mode 100755 > index 0000000000..651666979b > --- /dev/null > +++ b/t/t6100-rev-list-in-order.sh > @@ -0,0 +1,46 @@ > +#!/bin/sh > + > +test_description='miscellaneous rev-list tests' > + > +. ./test-lib.sh > + > + > +test_expect_success 'setup' ' > + for x in one two three four > + do > + echo $x >$x && > + git add $x && > + git commit -m "add file $x" > + done && > + for x in four three > + do > + git rm $x && > + git commit -m "remove $x" > + done &&
When "git commit -m 'remove four'" fails, this loop would still continue, so the &&-chain in "done &&" would still be rendered ineffetive.
Show 22 quoted lines
> + git rev-list --in-commit-order --objects HEAD >actual.raw &&
> + cut -c 1-40 >actual <actual.raw &&
> +
> + git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
> + HEAD^{commit}
> + HEAD^{tree}
> + HEAD^{tree}:one
> + HEAD^{tree}:two
> + HEAD~1^{commit}
> + HEAD~1^{tree}
> + HEAD~1^{tree}:three
> + HEAD~2^{commit}
> + HEAD~2^{tree}
> + HEAD~2^{tree}:four
> + HEAD~3^{commit}
> + # HEAD~3^{tree} skipped
> + HEAD~4^{commit}
> + # HEAD~4^{tree} skipped
> + HEAD~5^{commit}
> + HEAD~5^{tree}
> + EOF
> + grep -v "#" >expect <expect.raw &&Hmm, that is unfortunate that we still have to filter them out, but these have documentation values, so perhaps this is as good as it would get.
These "skipped" are shorthand for "not shown here, because it was already shown as X"; it would be good to come up with a phrasing to force us show what X is for each of them.
"already shown as X", perhaps?
Show 5 quoted lines
> + > + test_cmp expect actual > +' > + > +test_done