Re: [PATCH 2/6] commit: fix patch hunk editing with "commit -p -m"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 6, 2014, 21:47 UTC
- Message-ID
- <xmqqeh2fvw1h.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <xmqqr46fvx39.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Name it run_hook_le() (name modelled after execle()), and call it in > your change where you add new calls to this function, and add a thin > wrapper run_hook() that preserves the traditional "We can pass only > the index-file" for new callers we do not even know about on the > topics in flight. > > Later we can eradicate callers of run_hook() that treats the index-file > specially, which was a grave mistake in a public API.
I am also OK if the patch _removed_ run_hook() and renamed the one with the current semantics to run_hook_with_custom_index() or something.
It would allow us to catch any in-flight topic we do not know about that adds a call to run_hook() expecting that it would take a custom index file. We will see a link failure, and then we can evil-merge to update such a callsite to call run_hook_with_custom_index().
An updated run_hook() with different function signature (which is in this patch) will also let us notice, but the evil-merge to fix the resulting mess will have to be larger than necessary, which is not what we want.
Thanks.