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

Re: [PATCH 3/4] Clean: Remove unnecessary `\' (line continuation)

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2011, 19:21 UTC
Message-ID
<7v8vvwo1n2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<a59d19d0-f279-43fe-8ac6-06c4bd13c941-mfwitten@gmail.com>
Michael Witten <mfwitten@gmail.com> writes:
Show 16 quoted lines
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
>  t/t8001-annotate.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
> index 45cb60e..68ac828 100755
> --- a/t/t8001-annotate.sh
> +++ b/t/t8001-annotate.sh
> @@ -8,7 +8,7 @@ PROG='git annotate'
>  
>  test_expect_success \
>      'Annotating an old revision works' \
> -    '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") -eq 2 ] && \
> +    '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") -eq 2 ] &&
>       [ $(git annotate file master | awk "{print \$3}" | grep -c "^B$") -eq 2 ]'

While this is not wrong per-se, I don't want to take too much half-way churning.

If we were to properly do this, we should first rewrite it to use the more modern style:

	test_expect_success 'Annotating an old revision works' '
		... test script comes here ...
        '
and just run annotate once without having any downstream pipe, i.e.
	git annotate file master >result &&
	awk "{ print \$3; }" <result >authors &&
	test 2 = $(grep A <authors | wc -l) &&
	test 2 = $(grep B <authors | wc -l)

so that we can catch breakage in "git annotate" itself more reliably (e.g. even if the command showed two lines for each author, it is a failure if the command itself did not exit with status 0).

Previous: Michael Witten
Message 8 of 8 in “Clean: Remove useless parameters from both get_commit_info() functions”
  1. 4/4 Clean: Remove useless parameters from both get_commit_info() functionsMichael Witten, Feb 11, 2011
  2. 0/4 Miscellaneous ImprovementsMichael Witten, Mar 30, 2011
  3. 2/4 Clean: Remove superfluous strbuf 'docs'Michael Witten, Feb 15, 2011
  4. 1/4 Typos: t/READMEMichael Witten, Feb 22, 2011
  5. Junio C HamanoMar 30, 2011
  6. Michael WittenMar 30, 2011
  7. 3/4 Clean: Remove unnecessary `\' (line continuation)Michael Witten, Mar 2, 2011
  8. Junio C HamanoMar 30, 2011

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.