Re: [PATCH v3 00/38] Teach the sequencer to act as rebase -i's backend
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 17, 2017, 19:50 UTC
- Message-ID
- <xmqq7f5tfouc.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <alpine.DEB.2.20.1701161129240.3469@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 18 quoted lines
>> > The original code is: >> > >> > . "$author_script" >> >> [...] >> >> If the code in the sequencer.c reads things other than the three >> variables we ourselves set, and make them into environment variables >> and propagate to subprocesses (hooks and editors), it would be a >> bug. The original did not intend to do that (the dot-sourcing is >> overly loose than reading three known variables and nothing else, >> but is OK because we do not support the case where end users muck >> with the file). Also, writing FOO=BAR alone (not "export FOO=BAR" >> or "FOO=BAR; export FOO") to the file wouldn't have exported FOO to >> subprocesses anyway. > > That analysis cannot be completely correct, as the GIT_AUTHOR_* variables > *are* used by the `git commit` subprocess.
In the scripted version, do_with_author shell function explicitly exports GIT_AUTHOR_* variables because they are the only ones we care about that are read from existing commit and carried forward via the author-script mechanism. We do not care about, and in fact we do not intend to support, any other variables or shell commands that appear in the author-script.