Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so

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

 



Hi,

On Tue, 6 Oct 2009, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
> 
> >> 4. Are there any (scripted?) use-cases where git-checkout should fail
> >>    because it was given an invalid branch name?
> >> 
> >> The following gives a hint, though they could of course be fixed and
> >> the ^0 case doesn't really count:
> >> 
> >>   $ git grep 'git checkout .*||' -- "*.sh"
> >>   git-bisect.sh:        git checkout "$start_head" -- || exit
> >>   git-rebase--interactive.sh:  output git checkout $first_parent 2> /dev/null ||
> >>   git-rebase--interactive.sh:  output git checkout "$1" ||
> >>   git-rebase.sh:git checkout -q "$onto^0" || die "could not detach HEAD"
> >>   t/t2007-checkout-symlink.sh:git checkout -f master || exit
> >
> > Actually, in said cases (with exception of the test case, which should be 
> > fine, however, having no remote branches), I would expect the user to be 
> > grateful if the DWIMery would happen.
> 
> Did you check the context before making that assertion?

No, but I checked the _names_ of the scripts.

In case of bisect, if I know upstream is good, I might indeed say "git 
bisect good next", even if I haven't checked myself earlier.

In case of "rebase", about the same happens: if I say "git rebase next", 
and there is no "next", but an "origin/next", and no other remote branch 
"*/next", it is pretty clear what I mean, too.

In any case, it seems pretty clear to me that this DWIMery, while I am 
pretty certain would be useful for actual users without commits in 
git.git, will not make it into git.git.

So I'll stop wasting my time with this discussion.

Ciao,
Dscho
--
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]