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

Re: [PATCH] t: use LF variable defined in the test harness

From
Taylor Blau <me@ttaylorr.com>
Date
Sep 5, 2019, 18:52 UTC
Message-ID
<20190905185243.GA50575@syl.local>
In-Reply-To
<xmqq7e6mr4iy.fsf@gitster-ct.c.googlers.com>
On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Taylor Blau <me@ttaylorr.com> writes:
>
> >   - t/t3005: this script calls the variable '$new_line', but could be
> >     renamed to LF and then removed in a second patch
>
> It is worse than that, isn't it?
>
> If it used $new_line, then it would probably have been a good idea
> to somehow make a separate patch related to this one and make a
> series about "use $LF from test-lib", but ever since its beginning
> at 0f64bfa9 ("ls-files: fix pathspec display on error", 2011-08-01),
> $new_line is assigned once but never used in the script.

Ah, thanks for catching it ;-). I think the patch below the scissors is totally right; there's obviously no need for a preparatory patch here other than the one you provided.

Show 27 quoted lines
> Somebody may want to go clean-up the use of various $sq and $SQ
> locally defined by giving a unified $SQ in test-lib.sh, by the way.
>
> -- >8 --
> Subject: t3005: remove unused variable
>
> Since the beginning of the script, $new_line variable was never used.
> Remove it.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  t/t3005-ls-files-relative.sh | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
> index 209b4c7cd8..583e467683 100755
> --- a/t/t3005-ls-files-relative.sh
> +++ b/t/t3005-ls-files-relative.sh
> @@ -7,8 +7,6 @@ This test runs git ls-files with various relative path arguments.
>
>  . ./test-lib.sh
>
> -new_line='
> -'
>  sq=\'
>
>  test_expect_success 'prepare' '

Thanks, Taylor

Previous: Denton Liu
Message 10 of 10 in “t: use LF variable defined in the test harness”
  1. t: use LF variable defined in the test harnessJunio C Hamano, Sep 3, 2019
  2. Taylor BlauSep 4, 2019
  3. Junio C HamanoSep 5, 2019
  4. Jeff KingSep 5, 2019
  5. Junio C HamanoSep 5, 2019
  6. t: use common $SQ variableDenton Liu, Sep 5, 2019
  7. Taylor BlauSep 5, 2019
  8. Taylor BlauSep 5, 2019
  9. Denton LiuSep 6, 2019
  10. Taylor BlauSep 5, 2019

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.