Re: [PATCH 4/7] commit: fix patch hunk editing with "commit -p -m"
- From
Jeff King <peff@peff.net>
- Date
- Mar 11, 2014, 18:00 UTC
- Message-ID
- <20140311180020.GA28154@sigill.intra.peff.net>
- In-Reply-To
- <CA+SSzV04KCGyTkFTtSx_9sYAZyh=UzHOPV6tf9JT82w_DsSLHg@mail.gmail.com>
On Tue, Mar 11, 2014 at 06:56:02PM +0100, Benoit Pierre wrote:
Show 16 quoted lines
> According to the original commit, the change to GIT_EDITOR is only > here for hooks: > > commit 406400ce4f69e79b544dd3539a71b85d99331820 > Author: Paolo Bonzini <bonzini@gnu.org> > Date: Tue Feb 5 11:01:45 2008 +0100 > > git-commit: set GIT_EDITOR=: if editor will not be launched > > This is a preparatory patch that provides a simple way for the future > prepare-commit-msg hook to discover if the editor will be launched. > > Signed-off-by: Junio C Hamano <gitster@pobox.com> > > So there is really no reason to set it earlier, and not just in the > hook subprocess environment.
Ah, you're right. I was thinking that our invocation of launch_editor also respected it. It does, but we never get there at all because use_editor is set to 0. So yeah, it really is just needed for the hook.
Your patch, even though it is a bigger change, keeps the setting to the minimal area, which is cleaner and more maintainable in the long run.
-Peff