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

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

 




On Tue, 21 Jun 2005, Jeff Garzik wrote:
> 
> git-checkout-script is now switching branches correctly :)

Goodie.

> Now stay tuned for my next email, where I demonstrate how to reproduce 
> git-prune-script eating data :)

Before you demonstrate that, let me give you a quick warning on a very 
useful but also very peculiar and perhaps baffling feature of my version 
of "git checkout" as opposed to your "git switch".

In particular, think about what happens when you have changes in your
working directory, and you use "git checkout <newbranch>" (that is,
without the "-f" flag).

Now, if those changes actually _clash_ with the difference in the branch
you're switching to, you'll get an error (something like "Entry 'filename'
not uptodate. Cannot merge."). But if you have only edited files that are
the _same_ in both branches, then when you switch branches, those edits
will literally _follow_ you into the new branch.

Before, with your "git switch" script, any pending dirty state just got
thrown away.

Now, I'm convinced this is actually exactly the behaviour you want, but I 
thought I'd mention it before you notice it on your own and get confused.

And hey, if you don't like the feature, you can always just use the "-f"  
flag, which will act the way your old script did, and always just throw
any pending changes away when you check out a new branch.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux