Re: [PATCH 1/2] Allow users to require source branch on git-checkout -b.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Thursday, December 7, 2006 - 12:48 pm

"Shawn O. Pearce" <spearce@spearce.org> writes:


I'm not sure about this.

Often after you started to code something while on 'master' you
realize that work is not trivial and needs its own branch and
then "checkout -b" without having to say 'master' (or HEAD) is
very handy.

I think requring an explicit fork-point when you are _not_ on
'master' might be a better behaviour.

In other words, you allow "checkout -b" (and "branch") to
default to HEAD only while on the branches marked in your
configuration file:

Then:

	[branch]
        	allowbranchbydefault = main
        	allowbranchbydefault = test

can be used to say "while on 'main' and 'test' branch, 'git
checkout -b' and 'git branch' without branch point defaults to
the current branch".

You could turn it around and make it a per-branch configuration,
like:

	[branch "main"]
        	allowbranchbydefault = true


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/2] Allow users to require source branch on gi ..., Junio C Hamano, (Thu Dec 7, 12:48 pm)