Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 6, 2009, 12:02 UTC
- Message-ID
- <alpine.DEB.1.00.0910061359560.4686@intel-tinevez-2-302>
- In-Reply-To
- <7vvdis21qk.fsf@alter.siamese.dyndns.org>
Hi,
On Tue, 6 Oct 2009, Junio C Hamano wrote:
Show 20 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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