git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why SHA are 40 bytes? (aka looking for flames)
@ 2007-04-21 13:35 Marco Costalba
  2007-04-21 15:08 ` Andy Parkins
  2007-04-21 15:37 ` Jon Smirl
  0 siblings, 2 replies; 18+ messages in thread
From: Marco Costalba @ 2007-04-21 13:35 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Nicolas Pitre

Well, why to store always the full length SHA?

I know that looking at the code it is better then asking, but indeed
asking is better then guessing and in my case looking at the scary sha
low level code is almost like (bad) guessing.

We use 40 bytes to disambiguate two unlucky revisions or it is due to
UI concerns?

In case it is the former does this apply?

40bytes-sha1 + 40bytes-sha2 == 7**bytes-sha1 + 7bytes-sha2 + "a way to
disambiguate the two"*

(*)  as example calculating on the fly the full length sha in the
unlikely event it is needed,  or storing complete 40bytes sha when
needed.

(**) 7 is my lucky number ;-)

If in the packed tree truncated sha are stored, togheter of course
with corresponding revision data, does it is enough to keep the *same*
information of a complete pack?

For performance reasons, probably the inflating should be done only
when necessary, it means all git code should use shrinked sha-s,
leaving inflating as a remote and unlikely event. What are the real
walls about using small length sha everywhere in git code?

Ok. It's enough for collecting a long list of very bad answers. I
think I've done my day now!

Thanks for your *kind* reply
Marco

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-04-24 16:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-21 13:35 Why SHA are 40 bytes? (aka looking for flames) Marco Costalba
2007-04-21 15:08 ` Andy Parkins
2007-04-21 16:53   ` Karl Hasselström
2007-04-21 17:09     ` Marco Costalba
2007-04-21 16:58   ` Marco Costalba
2007-04-21 15:37 ` Jon Smirl
2007-04-21 17:06   ` Marco Costalba
2007-04-21 17:59     ` Jon Smirl
2007-04-21 18:28       ` Marco Costalba
2007-04-21 19:36         ` Jon Smirl
2007-04-24 14:48         ` Andreas Ericsson
2007-04-24 15:04           ` Nicolas Pitre
2007-04-24 15:18             ` Andreas Ericsson
2007-04-24 16:19               ` Nicolas Pitre
2007-04-22 13:27     ` Nicolas Pitre
2007-04-24  0:46       ` H. Peter Anvin
2007-04-24  2:30         ` Shawn O. Pearce
2007-04-24  2:44         ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).