Re: several quick questions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, February 14, 2006 - 1:40 pm

On Tue, 14 Feb 2006, Carl Worth wrote:

Well, it's pretty common in git too. But in git, the notion of "branch" 
really has been made so cheap that it's basically a no-op.

The "overhead" of creating a branch is literally the cost of writing one 
(small) file.


Right. And "git bisect" very much does exactly that. It creates a 
temporary branch for bisection (the branch is called "bisect", one of the 
less confusing naming decisions in git ;)

That's really my point. It all boils down to the same three operations: 
"git branch", "git checkout" and "git reset".

In fact, if you look into git-bisect, you'll notice that it doesn't even 
use "git reset" internally. It _literally_ creates a new branch (which it 
does by hand for some strange reason, but never mind) called "new-bisect", 
and then does "git checkout new-bisect" followed by renaming the branch 
back to "bisect" (which it again does by hand).

So "git bisect" may actually get its hands dirty by knowing a bit too much 
about the internal workings of git branches, but conceptually, it really 
does just

	git checkout -b new-bisect <newrev>

to switch its state around.


Pasky did this before the "multi-branch" thing was common, and calls it 
"cg-seek". 

I think that does exactly what you ask for, I just don't really see the 
point. The downside of cg-seek is that you're really really limited to 
what you can do with it.

For example, it may be "overhead" to have a dummy branch for bisection, 
but it means (for example) that you can actually do real work on the point 
that "git bisect" points you to.

For example, if you hit a compile error, you can _literally_ fix that 
compile error AND COMMIT that state, and when you then mark that commit 
"good" or "bad" when you continue to bisect, bisection will actually do 
the right thing. Something that would be impossible in a "seek" 
environment, where you don't have a branch that you can do development on.

I realize that when you come from an environment where branches are big 
things, this is kind of strange. But in git, a branch is literally a 
single file that is 41 bytes in size. That's it. No more, no less.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
several quick questions, Nicolas Vilz 'niv', (Tue Feb 14, 9:28 am)
Re: several quick questions, Andreas Ericsson, (Tue Feb 14, 10:03 am)
Re: several quick questions, Linus Torvalds, (Tue Feb 14, 10:05 am)
Re: several quick questions, Carl Worth, (Tue Feb 14, 11:10 am)
Re: several quick questions, Linus Torvalds, (Tue Feb 14, 11:34 am)
Re: several quick questions, Carl Worth, (Tue Feb 14, 11:44 am)
Re: several quick questions, Keith Packard, (Tue Feb 14, 11:55 am)
Re: several quick questions, Linus Torvalds, (Tue Feb 14, 12:00 pm)
Re: several quick questions, Linus Torvalds, (Tue Feb 14, 12:04 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 12:13 pm)
Re: several quick questions, Andreas Ericsson, (Tue Feb 14, 12:38 pm)
Re: several quick questions, Keith Packard, (Tue Feb 14, 12:39 pm)
Re: several quick questions, Petr Baudis, (Tue Feb 14, 12:46 pm)
Re: several quick questions, Carl Worth, (Tue Feb 14, 1:10 pm)
Re: several quick questions, Carl Worth, (Tue Feb 14, 1:14 pm)
Re: several quick questions, Petr Baudis, (Tue Feb 14, 1:27 pm)
Re: several quick questions, Johannes Schindelin, (Tue Feb 14, 1:34 pm)
Re: several quick questions, Johannes Schindelin, (Tue Feb 14, 1:37 pm)
Re: several quick questions, Linus Torvalds, (Tue Feb 14, 1:40 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 1:41 pm)
Re: several quick questions, Johannes Schindelin, (Tue Feb 14, 1:54 pm)
Re: several quick questions, Petr Baudis, (Tue Feb 14, 1:55 pm)
Re: several quick questions, Petr Baudis, (Tue Feb 14, 2:19 pm)
Re: several quick questions, Josef Weidendorfer, (Tue Feb 14, 2:30 pm)
Re: several quick questions, Nicolas Vilz 'niv', (Tue Feb 14, 2:30 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 2:40 pm)
Re: several quick questions, Petr Baudis, (Tue Feb 14, 2:41 pm)
Re: several quick questions, Carl Worth, (Tue Feb 14, 2:53 pm)
Re: several quick questions, Josef Weidendorfer, (Tue Feb 14, 3:17 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 3:26 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 3:39 pm)
Re: several quick questions, Andreas Ericsson, (Tue Feb 14, 4:00 pm)
Re: several quick questions, Johannes Schindelin, (Tue Feb 14, 4:23 pm)
Re: several quick questions, Andreas Ericsson, (Tue Feb 14, 5:08 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 5:34 pm)
Re: several quick questions, Martin Langhoff, (Tue Feb 14, 9:11 pm)
Re: several quick questions, Keith Packard, (Tue Feb 14, 10:25 pm)
Re: several quick questions, Junio C Hamano, (Tue Feb 14, 11:27 pm)
Re: several quick questions, Carl Worth, (Wed Feb 15, 1:21 am)
Re: several quick questions, Andreas Ericsson, (Wed Feb 15, 2:06 am)
Re: several quick questions, Junio C Hamano, (Wed Feb 15, 2:21 am)
[PATCH] More useful/hinting error messages in git-checkout, Josef Weidendorfer, (Wed Feb 15, 12:22 pm)
Re: [PATCH] New git-seek command with documentation and test., Andreas Ericsson, (Fri Feb 24, 3:00 am)
Re: [PATCH] New git-seek command with documentation and test., Johannes Schindelin, (Fri Feb 24, 2:48 pm)