mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Dave Airlie <airlied@linux.ie>, linux-kernel@vger.kernel.org
Subject: Re: git-pull-script on my linus tree fails..
Date: Tue, 21 Jun 2005 11:08:05 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0506211103370.2268@ppc970.osdl.org> (raw)
In-Reply-To: <42B8542A.9020700@pobox.com>



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

  reply	other threads:[~2005-06-21 18:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-21 12:07 Dave Airlie
2005-06-21 15:39 ` Linus Torvalds
2005-06-21 15:56   ` Jeff Garzik
2005-06-21 17:06     ` Linus Torvalds
2005-06-21 17:28       ` Jeff Garzik
2005-06-21 17:42         ` Linus Torvalds
2005-06-21 17:53           ` Jeff Garzik
2005-06-21 18:08             ` Linus Torvalds [this message]
2005-06-21 18:17               ` Jeff Garzik
2005-06-21 18:25                 ` Linus Torvalds
2005-06-21 23:52                   ` Jeff Garzik
2005-06-21 23:54                     ` Jeff Garzik
2005-06-22  0:13                       ` Linus Torvalds
2005-06-22  0:46                         ` Jeff Garzik
2005-06-22  1:18                           ` Linus Torvalds
2005-06-22  5:51                             ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0506211103370.2268@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=airlied@linux.ie \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®