From: Nakul V S <vsnakul@gmail.com>
To: phillip.wood123@gmail.com
Cc: git@vger.kernel.org, gitster@pobox.com, ps@pks.im,
phillip.wood@dunelm.org.uk, gitgitgadget@gmail.com,
vsnakul@gmail.com
Subject: Re: [PATCH] sequencer: refuse to revert shallow boundary commits by default
Date: Sat, 31 Oct 2026 22:52:38 +0530 [thread overview]
Message-ID: <20261031172238.66306-1-vsnakul@gmail.com> (raw)
In-Reply-To: <235e7dcd-2d29-47e4-b68f-9b02f80085dd@gmail.com>
Hi Phillip,
> From the user's point of view, I think do_pick_commit() is a bit late
> to error out. It would be nicer to refuse to add a shallow commit to
> the todo list in the first place which means we'd need a helper
> function that's called from sequencer_make_script(),
> make_script_with_merges(), single_pick() and
> sequencer_pick_revisions().
You're right, and I hadn't thought about it from the user's side. I
tried "git revert <tip> <boundary>" with v1. It reverted the tip, made
a commit, then failed on the boundary and left .git/sequencer behind.
That's a messy state to be left in.
So v2 does what you describe. The check is made where each command
builds its list of commits, and they all call the one helper. If any
of the commits is a boundary, the command refuses up front: no commit
is created, HEAD doesn't move, and there is nothing to abort.
"rebase --apply" doesn't go through the sequencer, so it gets a small
check of its own before it rewinds HEAD. That check does nothing in a
repository that isn't shallow.
One thing to be aware of: if someone types a "pick" or "revert" line
for a boundary commit into the rebase todo list by hand, it won't be
caught, because the check runs when the list is generated and not
after the editor. Git doesn't catch that today either, and the person
would have to type the hash on purpose, so I think it's an acceptable
price for failing early. If you'd prefer, I can add a second check in
do_pick_commit() as well.
Thanks,
Nakul
next prev parent reply other threads:[~2026-10-31 17:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 10:09 [PATCH] sequencer: refuse to revert shallow boundary commits by default Nakul V S via GitGitGadget
2026-10-21 15:20 ` Phillip Wood
2026-10-21 19:11 ` Junio C Hamano
2026-10-26 10:58 ` Phillip Wood
2026-10-31 17:22 ` Nakul V S [this message]
2026-10-31 17:29 ` Nakul V S
2026-10-31 17:18 ` Nakul V S
2026-10-31 14:05 ` [PATCH v2] sequencer: refuse to pick or revert shallow boundary commits Nakul V S via GitGitGadget
2026-11-01 2:30 ` Junio C Hamano
2026-11-01 18:08 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261031172238.66306-1-vsnakul@gmail.com \
--to=vsnakul@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=phillip.wood123@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox