git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Junio C HamanoNext: Benoit Pierre
Message 7 of 16 in “fix hunk editing with 'commit -p -m'”
  1. 0/6 fix hunk editing with 'commit -p -m'Benoit Pierre, Mar 6, 2014
  2. 1/6 test patch hunk editing with "commit -p -m"Benoit Pierre, Mar 6, 2014
  3. Eric SunshineMar 6, 2014
  4. Junio C HamanoMar 6, 2014
  5. 2/6 commit: fix patch hunk editing with "commit -p -m"Benoit Pierre, Mar 6, 2014
  6. Junio C HamanoMar 6, 2014
  7. Junio C HamanoMar 6, 2014
  8. 3/6 merge: fix GIT_EDITOR override for commit hookBenoit Pierre, Mar 6, 2014
  9. 4/6 merge hook tests: fix and update testsBenoit Pierre, Mar 6, 2014
  10. Eric SunshineMar 6, 2014
  11. 5/6 merge hook tests: fix missing '&&' in testBenoit Pierre, Mar 6, 2014
  12. Junio C HamanoMar 6, 2014
  13. 6/6 merge hook tests: use 'test_must_fail' instead of '!'Benoit Pierre, Mar 6, 2014
  14. Junio C HamanoMar 6, 2014
  15. Junio C HamanoMar 7, 2014
  16. Junio C HamanoMar 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.