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

Re: [PATCH 1/2] subtree: fix the GIT_EXEC_PATH sanity check to work on Windows

From
Jeff King <peff@peff.net>
Date
Jun 16, 2021, 07:49 UTC
Message-ID
<YMms+I9gT2eWbye+@coredump.intra.peff.net>
In-Reply-To
<xmqq8s3avdf1.fsf@gitster.g>
On Wed, Jun 16, 2021 at 09:52:34AM +0900, Junio C Hamano wrote:
Show 13 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >> So,... is contrib/subtree for Windows only?
> >
> > I read it as "this workaround is needed only on Windows, and will kick
> > in only there; on other platforms, the "-ef" code will not run at all,
> > so we don't have to worry about its portability".
> 
> Yes, in the latest round that I queued yesterday, it is clear that
> the use of non-POSIX "test" comes after the original condition
> followed by "||", and even if "test" may sometimes be a builtin, I
> do not think we will trigger an error at parse-time [*1*], so it is
> a safe change.
Yep, thanks for saying that last part out loud.
Show 13 quoted lines
> *1* I recall we had one interesting breakage of a script that tried
>     to do what is essentially:
> 
>         if are we running a shell with that funky feature?
>         then
>             shell commands that use the funky feature
>         else
>             portable POSIX shell feature
>         fi
> 
>     but the part that were supposed to be excluded from the
>     "portable" codepath by being between "then" and "else" still
>     were parsed and caused a parse error.

IIRC, one instance was trying to redirect descriptors over 9. That works in bash but not elsewhere, but we ran into shells that choke on the parsing.

So yeah, that is an important distinction in any portability workarounds. Sometimes an extra layer of "eval" can get around it, though.

-Peff
Previous: Junio C HamanoNext: Johannes Schindelin via GitGitGadget
Message 15 of 27 in “Fix git subtree on Windows”
  1. 0/2 Fix git subtree on WindowsJohannes Schindelin via GitGitGadget, Jun 10, 2021
  2. 1/2 subtree: fix the GIT_EXEC_PATH sanity check to work on WindowsJohannes Schindelin via GitGitGadget, Jun 10, 2021
  3. Luke ShumakerJun 11, 2021
  4. Junio C HamanoJun 11, 2021
  5. Luke ShumakerJun 11, 2021
  6. Johannes SchindelinJun 11, 2021
  7. Luke ShumakerJun 11, 2021
  8. Johannes SchindelinJun 14, 2021
  9. Junio C HamanoJun 15, 2021
  10. Jeff KingJun 15, 2021
  11. Bagas SanjayaJun 15, 2021
  12. Jeff KingJun 15, 2021
  13. Johannes SchindelinJun 15, 2021
  14. Junio C HamanoJun 16, 2021
  15. Jeff KingJun 16, 2021
  16. 2/2 subtree: fix assumption about the directory separatorJohannes Schindelin via GitGitGadget, Jun 10, 2021
  17. Luke ShumakerJun 11, 2021
  18. Johannes SchindelinJun 11, 2021
  19. Luke ShumakerJun 11, 2021
  20. Johannes SchindelinJun 11, 2021
  21. Luke ShumakerJun 11, 2021
  22. Felipe ContrerasJun 11, 2021
  23. Luke ShumakerJun 12, 2021
  24. 0/2 Fix git subtree on WindowsJohannes Schindelin via GitGitGadget, Jun 14, 2021
  25. 2/2 subtree: fix assumption about the directory separatorJohannes Schindelin via GitGitGadget, Jun 14, 2021
  26. 1/2 subtree: fix the GIT_EXEC_PATH sanity check to work on WindowsJohannes Schindelin via GitGitGadget, Jun 14, 2021
  27. Junio C HamanoJun 15, 2021

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.