Re: [PATCH 1/4 v2] Allow detached form (e.g. "-S foo" instead of "-Sfoo") for diff options
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 29, 2010, 02:00 UTC
- Message-ID
- <20100729020031.GI29156@dert.cs.uchicago.edu>
- In-Reply-To
- <1280310062-16793-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy wrote:
> 5 files changed, 90 insertions(+), 16 deletions(-) > create mode 100644 t/t4013/diff.log_-S_F_master
Well, I like it, though I’m obviously biased.
Show 5 quoted lines
> --- /dev/null > +++ b/t/t4013/diff.log_-S_F_master > @@ -0,0 +1,7 @@ > +$ git log -S F master > +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Note to self: a nice mini-series might be to blur these out.
Show 16 quoted lines
> +++ b/t/t4202-log.sh
> @@ -101,11 +101,16 @@ test_expect_success 'oneline' '
> test_expect_success 'diff-filter=A' '
>
> actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&
> + actual_detached=$(git log --pretty="format:%s" --diff-filter A HEAD) &&
> expect=$(echo fifth ; echo fourth ; echo third ; echo initial) &&
> test "$actual" = "$expect" || {
> echo Oops
> echo "Actual: $actual"
> false
> + } &&
> + test "$actual" = "$actual_detached" || {
> + echo Oops. Detached form broken
> + echo "Actual_detached: $actual_detached"
> }You left out the crucial "false"! :)
Below is an add-on patch to use a more readable style. With or without that change:
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 3352935..36870c5 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -100,18 +100,11 @@ test_expect_success 'oneline' ' test_expect_success 'diff-filter=A' ' - actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) && - actual_detached=$(git log --pretty="format:%s" --diff-filter A HEAD) && - expect=$(echo fifth ; echo fourth ; echo third ; echo initial) && - test "$actual" = "$expect" || { - echo Oops - echo "Actual: $actual" - false - } && - test "$actual" = "$actual_detached" || { - echo Oops. Detached form broken - echo "Actual_detached: $actual_detached" - } + git log --pretty="format:%s" --diff-filter=A HEAD > actual && + git log --pretty="format:%s" --diff-filter A HEAD > actual-detached && + printf "fifth\nfourth\nthird\ninitial" > expect && + test_cmp expect actual && + test_cmp expect actual-detached '