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

Re: [PATCH] sequencer: refuse to revert shallow boundary commits by default

From
NSNakul V S <vsnakul@gmail.com>
Date
Oct 31, 2026, 17:29 UTC
Message-ID
<20261031172900.69612-1-vsnakul@gmail.com>
In-Reply-To
<xmqqqzhina26.fsf@gitster.g>
Hi Junio,
Thanks for the review, and for the question.
Show 5 quoted lines
> The next natural question is where the modification should go if we
> want to make sure we protect these shallow boundaries not just from
> revert but also from "cherry-pick", "rebase", and possibly "commit
> --amend".  Is sequencer.c:do_pick_commit() the right place to cover
> all of them?

No, it isn't. When I wrote v1 I was only thinking about "revert", since that is what the original thread was about. do_pick_commit() is where every pick and revert ends up, so it looked like the easiest place for a single check. I honestly didn't think about cherry-pick or rebase at that point, or about how late that is for the user.

v2 moves it. The check now happens where each command builds its list of commits, and they all share one helper. "rebase --apply" doesn't go through the sequencer, so it gets a small check of its own before HEAD is touched.

I've left "git commit --amend" alone for now. It is a different code path, so I'd rather do it as a separate patch than make this one bigger. Let me know if you'd prefer it in the same series.

v2 is here: https://lore.kernel.org/git/pull.2273.v2.git.1793455522168.gitgitgadget@gmail.com

Thanks, Nakul

Previous: Nakul V SNext: Nakul V S
Message 6 of 11 in “sequencer: refuse to revert shallow boundary commits by default”
  1. sequencer: refuse to revert shallow boundary commits by defaultNakul V S via GitGitGadget, Oct 21, 2026
  2. Phillip WoodOct 21, 2026
  3. Junio C HamanoOct 21, 2026
  4. Phillip WoodOct 26, 2026
  5. Nakul V SOct 31, 2026
  6. Nakul V SOct 31, 2026
  7. Nakul V SOct 31, 2026
  8. sequencer: refuse to pick or revert shallow boundary commitsNakul V S via GitGitGadget, Oct 31, 2026
  9. Junio C HamanoNov 1, 2026
  10. Junio C HamanoNov 1, 2026
  11. Phillip WoodNov 4, 2026

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.