Thread (7 messages) flat view 7 messages, 4 authors, 2016-06-15

Re: diff against a tag ?

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:41:55


On Thu, 28 Apr 2005, Morten Welinder wrote:
Which begs the question: why wasn't the type of the object made part of the
file name?
Because it would just have complicated the code and made it less flexible.

As it is, we can open an object by just knowing its name, and by "name" I 
mean the true one, the SHA1. No need for "open_blob()" or anything like 
that. You just do

	sha1_file_name(const unsigned char *sha1)

to find out what the filesystem name of the object is, and this works for 
_any_ object.

And thanks to this, we can pass in a sha1 _without_ knowing whether it's a 
tree or a commit (or a tag) and just open in. Then, when we figure out 
that it was a commit rather than a tree, we look up the tree instead. 

Being able to open files _without_ knowing what they are is hugely useful. 
The user passes you a name, and you can just do the right thing. 

Besides, I _still_ don't want scripts mucking around with the objects
directly. Remember? They're encrypted with my super-sekrit zlib encoder
ring, just because people shouldn't be mucking around in them.

Trust me, when the object directories have a million files, you'll thank
me. You do _not_ want to do a readdir and try to figure out tags that way. 
You want to do it the way I _force_ you to do it, ie the right way.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help