Re: [PATCH v1 2/3] cvsexportcommit: do not run git programs in dashed form
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 26, 2020, 16:08 UTC
- Message-ID
- <xmqqa6yhxucq.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAPig+cR-eYCVQLRa0rVhgJ8L60-zCS_aK6_nVERcrXSyApdihw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 7 quoted lines
> On Tue, Aug 25, 2020 at 9:17 PM Junio C Hamano <gitster@pobox.com> wrote: >> This ancient script runs "git-foo" all over the place. A strange >> thing is that it has t9200 tests successfully running, even though >> it does not seem to futz with PATH to prepend $(git --exec-path) >> output. > > t/test-lib.sh takes care of that for us, doesn't it?
Actually, it is "git" itself.
The tests spawn "git cvsexportcommit" via the "git" dispatcher. The dispatcher adds GIT_EXEC_PATH to PATH in exec-cmd.c::setup_path() and that is used to (1) locate "git-foo" from /usr/libexec/git-core/ that are not builtin and (2) passed to any processes we invoke. I think the latter was originally done primarily for not breaking hooks, but that is what allows this script going in this particular case.
If this were only a fluke in the test that kept otherwise unrunnable script passing, I'd say it is an evidence enough that lets us drop the cvsexportcommit immediately, but now I rediscovered how it was supposed to work and saw how it actually does work as designed, I would not be surprised if it is still used in the wild.
Thanks.