git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] tests: make sure rename pretty print works

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 3, 2013, 06:50 UTC
Message-ID
<7vehfxc6yt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1362235092-16914-1-git-send-email-apelisse@gmail.com>
Antoine Pelisse <apelisse@gmail.com> writes:
Show 8 quoted lines
> Add basic use cases and corner cases tests for
> "git diff -M --summary/stat".
>
> Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
> ---
>  t/t4056-rename-pretty.sh |   54 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100755 t/t4056-rename-pretty.sh
I wonder if this needs a new test script of its own.

If we anticipate future additions, it would make sense but otherwise it may be better if we can find an existing one these tests can be folded into.

Show 11 quoted lines
> diff --git a/t/t4056-rename-pretty.sh b/t/t4056-rename-pretty.sh
> new file mode 100755
> index 0000000..806046f
> --- /dev/null
> +++ b/t/t4056-rename-pretty.sh
> @@ -0,0 +1,54 @@
> +#!/bin/sh
> +
> +test_description='Rename pretty print
> +
> +'
A single line would be sufficient...
Show 5 quoted lines
> +test_expect_success common_prefix '
> +	mkdir -p c/d &&
> +	git mv c/b/a c/d/e &&
> +	git commit -m. &&
> +	git show -M --summary >output &&

I guess the unsightly "commit -m." is an attempt to prevent the later grep from matching log message randomly, but if you test the output from "git diff -M --stat/summary HEAD^ HEAD" you do not have to worry about it, no?

Also I wonder if we can verify the filename part in --stat output.
> +	test_i18ngrep "c/{b/a => d/e}" output

We would want to make sure that we do not have random cruft around the paths, and the byte before that 'c' and after that '}' may want to be verified.

Previous: Antoine PelisseNext: Antoine Pelisse
Message 11 of 16 in “diff: Fix rename pretty-print when suffix and prefix overlap”
  1. diff: Fix rename pretty-print when suffix and prefix overlapAntoine Pelisse, Feb 23, 2013
  2. Junio C HamanoFeb 24, 2013
  3. Antoine PelisseFeb 25, 2013
  4. Philip OakleyFeb 25, 2013
  5. Antoine PelisseFeb 25, 2013
  6. diff: Fix rename pretty-print when suffix and prefix overlapAntoine Pelisse, Feb 28, 2013
  7. Thomas RastFeb 28, 2013
  8. Antoine PelisseFeb 28, 2013
  9. Junio C HamanoFeb 28, 2013
  10. tests: make sure rename pretty print worksAntoine Pelisse, Mar 2, 2013
  11. Junio C HamanoMar 3, 2013
  12. tests: make sure rename pretty print worksAntoine Pelisse, Mar 6, 2013
  13. Junio C HamanoMar 6, 2013
  14. diff: prevent pprint_rename from underrunning inputThomas Rast, Feb 26, 2013
  15. Junio C HamanoFeb 26, 2013
  16. Antoine PelisseFeb 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.