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

Re: [PATCH 1/2] submodule: ignore trailing slash on superproject URL

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 17, 2016, 19:32 UTC
Message-ID
<2aa41392-a7ed-cd48-2737-bd852757ab35@kdbg.org>
In-Reply-To
<xmqqfunvxxgu.fsf@gitster.mtv.corp.google.com>
Am 17.10.2016 um 09:10 schrieb Junio C Hamano:
Show 15 quoted lines
> And I agree from that point of view that having to spell both sides
> as $(pwd) would mean you are not testing that "Unixy input to
> Windowsy output" expectation, but at the same time, I think you
> would want "Windowsy input to Windowsy output" combination also does
> produce correct result, which is not tested in the three tests shown
> above.  IOW, probably you would want to test both (at least on any
> platform where $PWD and $(pwd) textually disagree) for all these
> [*1*], and the pair
>
>     "../." taken relative to "$(pwd)/." must be "$(pwd)/."
>     "../." taken relative to "$PWD/." must be "$(pwd)/."
>
> test, because of the limitation of your bash, cannot have the latter
> half of the pair, so you'd need to comment it out with in-code
> explanation, perhaps?

No, we do not have to test both cases. Git, the program, never sees Unixy input. It cannot distinguish the two cases. If we did both tests, we would just test that *if* the front-end of git is an MSYS program (such as bash), *then* that MSYS front-end has converted the Unixy path to a Windows-y path in such a way that the end-result is also as expected. It's similar to a test that grep produces expected output.

I think that we could reduce the confusion by converting all $PWD to $(pwd) in these test cases. I don't remember why I suggested to use $PWD for one of the arguments of the test cases (the second must be $(pwd)), but the most likely reason is only that we save a process.

-- Hannes
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 14 in “submodule: ignore trailing slash on superproject URL”
  1. 1/2 submodule: ignore trailing slash on superproject URLStefan Beller, Oct 10, 2016
  2. 2/2 submodule: ignore trailing slash in relative urlStefan Beller, Oct 10, 2016
  3. Dennis KaarsemakerOct 10, 2016
  4. Johannes SchindelinOct 12, 2016
  5. Stefan BellerOct 12, 2016
  6. Johannes SchindelinOct 13, 2016
  7. Junio C HamanoOct 17, 2016
  8. Stefan BellerOct 17, 2016
  9. Junio C HamanoOct 17, 2016
  10. Stefan BellerOct 17, 2016
  11. Junio C HamanoOct 17, 2016
  12. Johannes SixtOct 17, 2016
  13. Junio C HamanoOct 17, 2016
  14. Johannes SixtOct 18, 2016

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.