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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shawn Pearce <spearce@xxxxxxxxxxx> writes:

>> But my main complaint is just that I wouldn't want to see the behavior
>> of defaulting to HEAD--behavior which is simple, easy to explain, and
>> shared by most other git commands--by something significantly more
>> complicated.  That's more a complaint about Junio's suggestion than
>> yours, though.
>
> True, defaulting to HEAD is something that is done almost everywhere.
> Changing it for `git checkout -b` may surprise a lot of people,
> almost as much as --index vs. --cached.

I did not mean to change the default to something other than
HEAD depending on the configuration.

> (0) proceed if there is an explicit branch point specified on
>     the command like, just like now;

... which is the same as before.

> (1) allow omission of branch-point if the current branch has
>     allowbranchbydefault configuration set as in above.  A new
>     branch is created forking off of the current HEAD;

... which allows people to do the same as before, but only on
selected "primary" branches;

> (2) allow omission of branch-point if no branch has such
>     configuration; in other words, existing repositories that
>     do not have the allowbranchbydefault configuration anywhere
>     are not affected.  A new branch is created forking off of
>     the current HEAD;

... which allows people to keep using the current behaviour in
existing repositories;

> (3) otherwise, it barfs if you do not give an explicit
>     branch-point.

... but a newly created repositories would have an
allowbranchbydefault entry on "master" (and only on "master"),
which means new people would be prevented from making mistakes
when on a non-master branch 'foo':

	$ git branch bar

and end up a foobar branch that is not based on 'master'.  They
will instead get an error message that says "Hey, are you sure
you want to fork off of this branch 'foo'?"

But I do not deeply care about this.  An option to disable
"default to HEAD" altogether is fine.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]