tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* b4 prep from detached HEAD
@ 2022-12-23 10:15 Markus Schneider-Pargmann
  2022-12-27 15:14 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Schneider-Pargmann @ 2022-12-23 10:15 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

Hi,

thanks for b4, I am finally trying this after seeing your great blog
post.

Unfortunately it seems that b4 prep is not able to handle not being on a
branch:

	git checkout v6.1
	b4 prep -n up/test -f v6.1
		Not able to get current branch (git symbolic-ref HEAD)
		Not able to get current branch (git symbolic-ref HEAD)
		Not able to get current branch (git symbolic-ref HEAD)
		Not able to get current branch (git symbolic-ref HEAD)
		CRITICAL: fork-point v6.1 is not on the current branch.
		          Switch to the branch you want to use as base and try again.

Also b4 translates my branch name I wanted to use 'up/test' to 'up-test'
is there a reason for that?

Not sure these issues were mentioned before.

Best,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: b4 prep from detached HEAD
  2022-12-23 10:15 b4 prep from detached HEAD Markus Schneider-Pargmann
@ 2022-12-27 15:14 ` Konstantin Ryabitsev
  2022-12-27 16:06   ` Markus Schneider-Pargmann
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Ryabitsev @ 2022-12-27 15:14 UTC (permalink / raw)
  To: Markus Schneider-Pargmann; +Cc: tools

On Fri, Dec 23, 2022 at 11:15:39AM +0100, Markus Schneider-Pargmann wrote:
> Unfortunately it seems that b4 prep is not able to handle not being on a
> branch:
> 
> 	git checkout v6.1
> 	b4 prep -n up/test -f v6.1
> 		Not able to get current branch (git symbolic-ref HEAD)
> 		Not able to get current branch (git symbolic-ref HEAD)
> 		Not able to get current branch (git symbolic-ref HEAD)
> 		Not able to get current branch (git symbolic-ref HEAD)
> 		CRITICAL: fork-point v6.1 is not on the current branch.
> 		          Switch to the branch you want to use as base and try again.

Yes, we currently use "what branch you're currently on" as our base tracking
branch. Knowing the base branch is less important with the default commit
strategy, but it will come in handy when I add the "prep --cleanup" feature
that will remove prep-tracked branches if we find that they have been merged
into the base branch (e.g. master).

I will probably add a --base-branch flag to go with "prep -n", though, so
eventually it will be possible to create new prep-tracked branches from
arbitrary locations in the tree.

In your particular case, you don't need to checkout v6.1 before running prep.
You can just start in master and rerun "b4 prep -n [name] -f v6.1".

> Also b4 translates my branch name I wanted to use 'up/test' to 'up-test'
> is there a reason for that?

Yes, the branch name becomes the base of the message-id, which in turn becomes
the base of lore lookup URL. We replace all non-url-friendly characters to
avoid a url-encoding mess.

Best wishes,
-K

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: b4 prep from detached HEAD
  2022-12-27 15:14 ` Konstantin Ryabitsev
@ 2022-12-27 16:06   ` Markus Schneider-Pargmann
  2022-12-28  9:39     ` Markus Schneider-Pargmann
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Schneider-Pargmann @ 2022-12-27 16:06 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

Hi Konstantin,

On Tue, Dec 27, 2022 at 10:14:33AM -0500, Konstantin Ryabitsev wrote:
> On Fri, Dec 23, 2022 at 11:15:39AM +0100, Markus Schneider-Pargmann wrote:
> > Unfortunately it seems that b4 prep is not able to handle not being on a
> > branch:
> > 
> > 	git checkout v6.1
> > 	b4 prep -n up/test -f v6.1
> > 		Not able to get current branch (git symbolic-ref HEAD)
> > 		Not able to get current branch (git symbolic-ref HEAD)
> > 		Not able to get current branch (git symbolic-ref HEAD)
> > 		Not able to get current branch (git symbolic-ref HEAD)
> > 		CRITICAL: fork-point v6.1 is not on the current branch.
> > 		          Switch to the branch you want to use as base and try again.
> 
> Yes, we currently use "what branch you're currently on" as our base tracking
> branch. Knowing the base branch is less important with the default commit
> strategy, but it will come in handy when I add the "prep --cleanup" feature
> that will remove prep-tracked branches if we find that they have been merged
> into the base branch (e.g. master).
> 
> I will probably add a --base-branch flag to go with "prep -n", though, so
> eventually it will be possible to create new prep-tracked branches from
> arbitrary locations in the tree.
> 
> In your particular case, you don't need to checkout v6.1 before running prep.
> You can just start in master and rerun "b4 prep -n [name] -f v6.1".

Thanks for explaining. The checkout of v6.1 was just an example. I often
use detached HEAD on remote branches and tags to not pollute the
branches that I have. I thought b4 prep would ignore the current state
of my work directory so I used it similarly to a 'git checkout -b'.
I may be creating a git helper for me which does a git checkout -b and a
b4 prep -e afterwards.

> 
> > Also b4 translates my branch name I wanted to use 'up/test' to 'up-test'
> > is there a reason for that?
> 
> Yes, the branch name becomes the base of the message-id, which in turn becomes
> the base of lore lookup URL. We replace all non-url-friendly characters to
> avoid a url-encoding mess.

That does make sense, thank you.

Best,
Markus

> 
> Best wishes,
> -K

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: b4 prep from detached HEAD
  2022-12-27 16:06   ` Markus Schneider-Pargmann
@ 2022-12-28  9:39     ` Markus Schneider-Pargmann
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Schneider-Pargmann @ 2022-12-28  9:39 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

Hi Konstantin,

On Tue, Dec 27, 2022 at 05:06:33PM +0100, Markus Schneider-Pargmann wrote:
> Hi Konstantin,
> 
> On Tue, Dec 27, 2022 at 10:14:33AM -0500, Konstantin Ryabitsev wrote:
> > On Fri, Dec 23, 2022 at 11:15:39AM +0100, Markus Schneider-Pargmann wrote:
> > > Unfortunately it seems that b4 prep is not able to handle not being on a
> > > branch:
> > > 
> > > 	git checkout v6.1
> > > 	b4 prep -n up/test -f v6.1
> > > 		Not able to get current branch (git symbolic-ref HEAD)
> > > 		Not able to get current branch (git symbolic-ref HEAD)
> > > 		Not able to get current branch (git symbolic-ref HEAD)
> > > 		Not able to get current branch (git symbolic-ref HEAD)
> > > 		CRITICAL: fork-point v6.1 is not on the current branch.
> > > 		          Switch to the branch you want to use as base and try again.
> > 
> > Yes, we currently use "what branch you're currently on" as our base tracking
> > branch. Knowing the base branch is less important with the default commit
> > strategy, but it will come in handy when I add the "prep --cleanup" feature
> > that will remove prep-tracked branches if we find that they have been merged
> > into the base branch (e.g. master).
> > 
> > I will probably add a --base-branch flag to go with "prep -n", though, so
> > eventually it will be possible to create new prep-tracked branches from
> > arbitrary locations in the tree.
> > 
> > In your particular case, you don't need to checkout v6.1 before running prep.
> > You can just start in master and rerun "b4 prep -n [name] -f v6.1".
> 
> Thanks for explaining. The checkout of v6.1 was just an example. I often
> use detached HEAD on remote branches and tags to not pollute the
> branches that I have. I thought b4 prep would ignore the current state
> of my work directory so I used it similarly to a 'git checkout -b'.
> I may be creating a git helper for me which does a git checkout -b and a
> b4 prep -e afterwards.

A short follow-up. Using
	git checkout -b BRANCH BASETAG
	b4 prep -e BASETAG

unfortunately doesn't work as the code requires another branch to exist
that contains the tag (not a remote branch only local branches are
accepted).

I am not really sure how the normal workflow for non commit strategies
is supposed to work? Do I need to keep a local master branch that tracks
linus/master? (I usually don't have that at all and always start new
branches from remote branches)

Thanks,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-28  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23 10:15 b4 prep from detached HEAD Markus Schneider-Pargmann
2022-12-27 15:14 ` Konstantin Ryabitsev
2022-12-27 16:06   ` Markus Schneider-Pargmann
2022-12-28  9:39     ` Markus Schneider-Pargmann

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).