* small b4 feature request @ 2024-12-09 22:13 ` Jeff Layton 2024-12-09 22:33 ` Vishal Verma 2024-12-10 22:16 ` Konstantin Ryabitsev 0 siblings, 2 replies; 4+ messages in thread From: Jeff Layton @ 2024-12-09 22:13 UTC (permalink / raw) To: tools First, let me say that I love b4. It's great for managing a patch series over time. I often carry around the b4 commit at the base of my patch pile and end up having to rebase on top of it. It would be great to have a way to specify the b4 tracking commit symbolically to git so I could do this without having to lookup the commit ID of the b4 head: $ git rebase -i B4_HEAD git recognizes HEAD, FETCH_HEAD, ORIG_HEAD, that are specified as files in the .git/ directory. Is there a way we could keep a B4_HEAD reference in there that always points to the b4 tracking commit (if there is one)? Thanks, -- Jeff Layton <jlayton@kernel.org> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: small b4 feature request 2024-12-09 22:13 ` small b4 feature request Jeff Layton @ 2024-12-09 22:33 ` Vishal Verma 2024-12-10 22:16 ` Konstantin Ryabitsev 1 sibling, 0 replies; 4+ messages in thread From: Vishal Verma @ 2024-12-09 22:33 UTC (permalink / raw) To: Jeff Layton, tools On Mon, 2024-12-09 at 17:13 -0500, Jeff Layton wrote: > First, let me say that I love b4. It's great for managing a patch > series over time. > > I often carry around the b4 commit at the base of my patch pile and end > up having to rebase on top of it. It would be great to have a way to > specify the b4 tracking commit symbolically to git so I could do this > without having to lookup the commit ID of the b4 head: > > $ git rebase -i B4_HEAD > > git recognizes HEAD, FETCH_HEAD, ORIG_HEAD, that are specified as files > in the .git/ directory. Is there a way we could keep a B4_HEAD > reference in there that always points to the b4 tracking commit (if > there is one)? > I second this idea. I've been scripting around this problem (of rebasing my b4-prep managed series) using a script - so I just call 'git reb4'. $ cat ~/bin/git-reb4 #!/bin/bash # git-reb4 - rebase -i --autosquash to the base commit of a patch series # Determine the base commit using preferred methods for b4, stg, and fall # back to the git @{upstream} as a last resort. # try b4 first if command -v b4 > /dev/null; then base="$(b4 prep --show-info 2>/dev/null | grep "^start-commit" | cut -d' ' -f2)" if [[ ! $base ]]; then # try the stg way if command -v stg > /dev/null; then base="$(stg id $(stg ser --noprefix | head -n 1)^)" if [[ ! $base ]]; then # try the git upstream base="$(git rev-parse "@{u}")" fi fi fi fi if [[ ! $base ]]; then echo "couldn't determine base commit" exit 1 fi git rebase -i --autosquash "$base" "$@" ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: small b4 feature request 2024-12-09 22:13 ` small b4 feature request Jeff Layton 2024-12-09 22:33 ` Vishal Verma @ 2024-12-10 22:16 ` Konstantin Ryabitsev 2024-12-11 18:06 ` Jeff Layton 1 sibling, 1 reply; 4+ messages in thread From: Konstantin Ryabitsev @ 2024-12-10 22:16 UTC (permalink / raw) To: Jeff Layton; +Cc: tools On Mon, Dec 09, 2024 at 05:13:31PM -0500, Jeff Layton wrote: > First, let me say that I love b4. It's great for managing a patch > series over time. Great to hear, thanks! > I often carry around the b4 commit at the base of my patch pile and end > up having to rebase on top of it. It would be great to have a way to > specify the b4 tracking commit symbolically to git so I could do this > without having to lookup the commit ID of the b4 head: > > $ git rebase -i B4_HEAD I'm having a hard time wrapping my head around this (pun not intended). Is the commit in question the tip of the b4 branch, or the base commit? In either case there is already a way to obtain this information with b4, e.g.: b4 prep --show-info base-commit b4 prep --show-info end-commit b4 prep --show-info series-range So, e.g. if you want to rebase one prep-managed branch on top of another, you could do [1]: git rebase -i $(b4 prep --show-info b4/some-branch:end-commit) Does this do what you need, or am I misunderstanding the situation? [1]: apparently, show-info for a non-current branch was broken in master and 0.14.y, so you'll need the latest master or stable-0.14.y. -K ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: small b4 feature request 2024-12-10 22:16 ` Konstantin Ryabitsev @ 2024-12-11 18:06 ` Jeff Layton 0 siblings, 0 replies; 4+ messages in thread From: Jeff Layton @ 2024-12-11 18:06 UTC (permalink / raw) To: Konstantin Ryabitsev; +Cc: tools On Tue, 2024-12-10 at 17:16 -0500, Konstantin Ryabitsev wrote: > On Mon, Dec 09, 2024 at 05:13:31PM -0500, Jeff Layton wrote: > > First, let me say that I love b4. It's great for managing a patch > > series over time. > > Great to hear, thanks! > > > I often carry around the b4 commit at the base of my patch pile and end > > up having to rebase on top of it. It would be great to have a way to > > specify the b4 tracking commit symbolically to git so I could do this > > without having to lookup the commit ID of the b4 head: > > > > $ git rebase -i B4_HEAD > > I'm having a hard time wrapping my head around this (pun not intended). Is the > commit in question the tip of the b4 branch, or the base commit? > > In either case there is already a way to obtain this information with b4, > e.g.: > > b4 prep --show-info base-commit > b4 prep --show-info end-commit > b4 prep --show-info series-range > > So, e.g. if you want to rebase one prep-managed branch on top of another, you > could do [1]: > > git rebase -i $(b4 prep --show-info b4/some-branch:end-commit) > > Does this do what you need, or am I misunderstanding the situation? > > [1]: apparently, show-info for a non-current branch was broken in master and > 0.14.y, so you'll need the latest master or stable-0.14.y. > That does help. I was thinking that B4_HEAD to be the empty commit at the bottom of the series-range that b4 uses to track the series. IOW: b4 prep --show-info series-range | cut -d'.' -f1 ...but now that I look at the b4 innards, I see that there are different cover-letter tracking strategies. Maybe just using "base- commit" would be simplest. So I guess I can do what I need with: $ git rebase -i $(b4 prep --show-info base-commit) It has the empty tracking commit in my setup, but I can live with that. Thanks! -- Jeff Layton <jlayton@kernel.org> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-11 18:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <p8ViV3yfc4oH3IgmIkXuiuhx92Va2KrVMYttHaXXGDsnnqtVmaqllPhcfSp-nYuqIL5udMcc8W-7_Vm8JlSPyQ==@protonmail.internalid>
2024-12-09 22:13 ` small b4 feature request Jeff Layton
2024-12-09 22:33 ` Vishal Verma
2024-12-10 22:16 ` Konstantin Ryabitsev
2024-12-11 18:06 ` Jeff Layton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).