Re: [PATCH 4/7] commit: fix patch hunk editing with "commit -p -m"
From: Jeff King <hidden>
Date: 2016-06-15 23:00:16
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 [off-list ref]
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 [off-list ref]
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