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

Re: rebase invoking pre-commit

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 5, 2024, 16:26 UTC
Message-ID
<xmqqttnroig4.fsf@gitster.g>
In-Reply-To
<m0sf3vi86g.fsf@epic96565.epic.com>
Sean Allred <allred.sean@gmail.com> writes:
Show 8 quoted lines
> Is there a current reason why pre-commit shouldn't be invoked during
> rebase, or is this just waiting for a reviewable patch?
>
> This was brought up before at [1] in 2015, but that thread so old at
> this point that it seemed prudent to double-check before investing time
> in a developing and testing a patch.
>
> [1]: https://lore.kernel.org/git/1m55i3m.1fum4zo1fpnhncM%25lists@haller-berlin.de/

If you are trying to make it less likely that your developers would commit conflict markers by mistake, I think an effective way would be to give "git rebase" an option (or a configuration variable) that forbids it from making a new commit upon "git rebase --continue", which AFAIK was added merely to help "lazy" folks to omit the explicit "git commit" step in the following sequence:

    $ git rebase origin/master
    ... stops with conflicts
    $ edit
    ... now the conflicts are resolved (and hopefully you have
    ... tested the result)
    $ git commit
    $ git rebase --continue
Previous: Elijah Newren
Message 8 of 8 in “rebase invoking pre-commit”
  1. Sean AllredDec 21, 2023
  2. Phillip WoodDec 22, 2023
  3. Sean AllredDec 22, 2023
  4. Junio C HamanoDec 26, 2023
  5. Elijah NewrenDec 23, 2023
  6. Sean AllredDec 31, 2023
  7. Elijah NewrenJan 5, 2024
  8. Junio C HamanoJan 5, 2024

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.