Re: [PATCH] Add tests for git log --pretty, --format and --oneline.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:

> More specifically; --pretty=format, tformat and new %foo shortcut.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
> ---
>  t/t4202-log.sh |   40 ++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 40 insertions(+), 0 deletions(-)

Because 4202 seems to be about testing the log functionality and they rely
on correctly working format output to verify other aspects of the
operation of "git log", I initially was not sure if this is the right
place to add these new tests.  After looking around I didn't find any
existing test that checks the various --pretty output formats that the new
tests can be added, so this probably is as good a place as any.

> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 7b976ee..f1287fe 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -37,6 +37,46 @@ test_expect_success setup '
>  
>  '
>  
> +echo -ne "sixth\nfifth\nfourth\nthird\nsecond\ninitial" > expect
> +test_expect_success 'pretty' '
> +
> +	git log --pretty="format:%s" > actual &&
> +	test_cmp expect actual
> +'
> +
> +echo -ne "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect

We avoid "echo -e" to cater to people whose echo does not like it and
instead use printf for things like this.

Other than that, the patch looked Ok.  I queued it with a minor fixup.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux