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

Re: [PATCH] git-sh: Avoid sourcing scripts with git --exec-path

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 29, 2017, 03:58 UTC
Message-ID
<xmqqtvzmxij5.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170929034856.GB28303@aiede.mtv.corp.google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> This has been broken for a while, but better late than never to
> address it.

I am not sure if this is broken in the first place. We do want to make sure that the scripted porcelains will source the shell helper library from matching Git release. The proposed patch goes directly against that and I do not see how it could be an improvement.

Show 12 quoted lines
>> --- a/contrib/rerere-train.sh
>> +++ b/contrib/rerere-train.sh
>> @@ -7,7 +7,8 @@ USAGE="$me rev-list-args"
>>  
>>  SUBDIRECTORY_OK=Yes
>>  OPTIONS_SPEC=
>> -. "$(git --exec-path)/git-sh-setup"
>> +PATH="$(git --exec-path):$PATH"
>> +. git-sh-setup
>
> This makes me similarly unhappy about PATH pollution, but it may be
> that there's nothing to be done about that.

To me, all the instances of the unhappiness in your review seem to be caused by the unjustified declaration that it is bad to source from the directory "gti --exec-path" reports. If a user wants to tweak things Git does, why should the user futz with his own copy of sh-setup and force scripted Porcelains to read from it, which would only affect the scripted Porcelains and have no chance of affecting compiled commands? Is building from the source so bad for an open source tool?

Previous: Jonathan NiederNext: Jonathan Nieder
Message 3 of 6 in “git-sh: Avoid sourcing scripts with git --exec-path”
  1. git-sh: Avoid sourcing scripts with git --exec-pathDridi Boukelmoune, Sep 28, 2017
  2. Jonathan NiederSep 29, 2017
  3. Junio C HamanoSep 29, 2017
  4. Jonathan NiederSep 29, 2017
  5. Junio C HamanoSep 29, 2017
  6. Dridi BoukelmouneSep 29, 2017

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.