All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: tools@linux.kernel.org, users@linux.kernel.org
Subject: b4 feature request: run command before rewriting history
Date: Thu, 10 Oct 2024 13:22:50 +0200	[thread overview]
Message-ID: <87ttdkrylx.fsf@toke.dk> (raw)

Hi Konstantin

I recently started switching my workflow over to 'b4 prep' for preparing
patches, and am loving the workflow. Thanks a lot for working on this!

However, I ran into one little snag, that I'm hoping could be fixed with
a new b4 feature: I am also a big fan of 'stacked git' (stgit)[0], and
often use that instead of 'rebase -i' when preparing a series for
submission.

So naturally, I want to combine 'b4 prep' with stgit. The problem here
is that stgit maintains its own state for the branches it manages, and
gets awfully confused if the git history is rewritten underneath it.
It's still possible to use it with 'b4 prep', as long as I remember to
do 'stg commit --all' before running any of the b4 commands. And, well,
guess what I already forgot several times? :)

So, my feature request is this: add support to b4 for a hook command
that is executed before any operation that will rewrite history - and
abort the rewriting if the command fails. That way, I can make sure that
I don't forget to clear the stgit state before running b4, saving me
from the pain of dealing with a confused tool.

Do you think this would be feasible to implement?

Many thanks!

-Toke

[0] https://stacked-git.github.io/


             reply	other threads:[~2024-10-10 11:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 11:22 Toke Høiland-Jørgensen [this message]
2024-10-30 10:16 ` b4 feature request: run command before rewriting history Toke Høiland-Jørgensen
2024-10-30 17:36   ` Konstantin Ryabitsev
2024-10-31 10:29     ` Toke Høiland-Jørgensen
2025-02-12 15:36       ` Toke Høiland-Jørgensen
2026-03-06 21:14         ` Konstantin Ryabitsev
2026-03-06 21:18 ` B4 Bugbot
2026-03-19 21:38 ` B4 Bugbot

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=87ttdkrylx.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    --cc=users@linux.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.