Re: Cherry-pick particular object

From: Linus Torvalds <torvalds@osdl.org>
Date: 2006-03-29 10:24:13
On Wed, 29 Mar 2006, Petr Baudis wrote:

> Dear diary, on Wed, Mar 29, 2006 at 12:44:02AM CEST, I got a letter
> where Linus Torvalds <torvalds@osdl.org> said that...
> > Ie you can have a tree like this:
> > 
> > 	100644 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f    abc
> > 	120000 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f    file
> > 
> > where the first one is a regular file called "abc" (which contains the 
> > string "abc"), and the second is the _symlink_ that points to "abc".
> > 
> > They share the exact same blob, and what distinguishes them is the 
> > filemode info from git-read-tree.
> 
> Huh? Didn't you rather want to say that "file" will point to a blob
> containing just the "abc" string (the symlink target)? ;-)

Well no, maybe I should have called the first file something else.

Both "abc" and "file" from a git perspective have the same _contents_ (the 
blob containing the data 'abc'). 

But the filemode means that those contents have totally different meaning. 
For the pth "file", it means that it's a _symlink_ to "abc", while for the 
path "abc" it's a regular file that just has the _contents_ "abc".

So the end _result_ of this is that "file" points to a file called "abc" 
that also has the contents "abc", and "cat file abc" will result in 
"abcabc".

IOW, this is the result of doing

	echo -n abc > abc
	ln -s abc file

and importing the mess into git.

		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
Received on Wed Mar 29 10:24:58 2006

This archive was generated by hypermail 2.1.8 : 2006-03-29 10:25:21 EST