From: Jeff King Date: Tue, 11 Mar 2014 18:00:20 GMT Subject: Re: [PATCH 4/7] commit: fix patch hunk editing with "commit -p -m" Message-ID: <20140311180020.GA28154@sigill.intra.peff.net> In-Reply-To: On Tue, Mar 11, 2014 at 06:56:02PM +0100, Benoit Pierre wrote: > According to the original commit, the change to GIT_EDITOR is only > here for hooks: > > commit 406400ce4f69e79b544dd3539a71b85d99331820 > Author: Paolo Bonzini > 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 > > 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