Re: [PATCH v5 8/9] sequencer: try to commit without forking 'git commit'
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 11, 2018, 20:21 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1801112120390.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
- In-Reply-To
- <5efbad65-6afe-e135-4681-ba380cd6797f@talktalk.net>
Hi Phillip,
On Thu, 11 Jan 2018, Phillip Wood wrote:
Show 24 quoted lines
> On 10/01/18 22:40, Johannes Schindelin wrote:
> > Hi,
> >
> > On Wed, 10 Jan 2018, Jonathan Nieder wrote:
> >
> >> that this causes the prepare-commit-msg hook not to be invoked, which
> >> I think is unintentional. Should we check for such a hook and take
> >> the slowpath when it is present?
> >
> > We could also easily recreate the functionality:
> >
> > if (find_hook("pre-commit")) {
> > struct argv_array hook_env = ARGV_ARRAY_INIT;
> >
> > argv_array_pushf(&hook_env, "GIT_INDEX_FILE=%s",
> > get_index_file());
> > argv_array_push(&hook_env, "GIT_EDITOR=:");
> > ret = run_hook_le(hook_env.argv, "pre-commit", NULL);
> > argv_array_clear(&hook_env);
> > }
>
> Thanks Johannes, though it needs to run the 'prepare-commit-msg' hook,
> the current code in master only runs the 'pre-commit' hook when we edit
> the message. I'll send a patch with a test.Sorry, yes, that's the hook I meant ;-) the quoted text by Jonathan even mentions it explicitly.
Ciao, Johannes