Re: git-pull-script on my linus tree fails..

From: Linus Torvalds
Date: Tue Jun 21 2005 - 13:08:02 EST




On Tue, 21 Jun 2005, Jeff Garzik wrote:
>
> If I want my working dir updated to reflect the desired branch -- the
> whole purpose of git-switch-tree -- I would have to do
>
> git-checkout-script && switch HEAD && git-checkout-script

No, you don't understand. The git-checkout-script already takes a
parameter to indicate _what_ to check out. It just defaults to head.

So you'd do

git-checkout-script branch && switch branch

and you'd be done.

Anyway, I liked the branch semantics for "git checkout" so much that I
just made it do that by default. In other words, if you do

git checkout 'branch'

it will both check out the new branch contents and switch HEAD to branch.
It will refuse to overwrite any data, but as before, you can force that
with "git checkout -f branch" instead.

If the argument to "git checkout" isn't a branch-name, but some other
name (like "v2.6.12" or an extended expression like "HEAD^" for "parent of
HEAD"), it will just check it out, but it obviously won't be switching any
branches around (and it will leave HEAD untouched).

These seem like sane and useful semantics, and your "switch" script should
really fall out as "git checkout -f".

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/