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

Re: Regression in v2.26.0-rc0 and Magit

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 13, 2020, 19:07 UTC
Message-ID
<xmqqy2s4axa2.fsf@gitster.c.googlers.com>
In-Reply-To
<xmqq36accdpt.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 21 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> ...
> If nobody complains in the coming 4 hours or so, I'll squash this in
> to e6c57b49 ("prefix_path: show gitdir if worktree unavailable",
> 2020-03-02) and mark the topic as "ready for 'next'".
>
> Thanks.
>
>  t/t6136-pathspec-in-bare.sh | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> ...
> +test_expect_success 'log and ls-files in .git directory' '
> +	(
> +		cd .git &&
> +		test_must_fail git log -- .. &&
> +		test_must_fail git ls-files -- ..
> +	) >out 2>err &&
> +	test_i18ngrep "outside repository" err
> +'
> +
> +test_done

This is outside the scope of fixing the regression e0020b2f ("prefix_path: show gitdir when arg is outside repo", 2020-02-14) brought in, but I wonder if this last piece should even fail in the first place.

If you give "." instead of ".." to these commands, they behave as if we did so from the top-level of the working tree, i.e. these are equivalent:

    git -C .git ls-files -- .
    git -C .git/info/ ls-files -- .
    git ls-files -- .

which somehow does not sound quite right, but that is how tools written in the past 15 years expect and is hard to change?

That does not still explain why Magit (which is sufficiently mature) is expecting "cd .git && ls-files .." to show the entire working tree, though.

Previous: Jonathan NiederNext: Kyle Meyer
Message 6 of 9 in “Regression in v2.26.0-rc0 and Magit”
  1. Jean-Noël AVILAMar 12, 2020
  2. Jonathan NiederMar 12, 2020
  3. Junio C HamanoMar 13, 2020
  4. Junio C HamanoMar 13, 2020
  5. Jonathan NiederMar 13, 2020
  6. Junio C HamanoMar 13, 2020
  7. Kyle MeyerMar 14, 2020
  8. SZEDER GáborMar 15, 2020
  9. Junio C HamanoMar 15, 2020

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.