Re: suggested feature: someone mails me a blob, git please tell me what it is

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

 



On Fri, 16 Feb 2007, Mike Coleman wrote:

> Here's a suggestion for a git feature, if git doesn't already have it.
> Since git generally doesn't use RCS-style keyword cookies (like
> "$Id$"), it'd be nice to have some other way to identify an installed
> file.  Perhaps you'd want to know exactly what rev a user is running,
> for example.
> 
> It seems like it should be fairly easy, given a blob (the file), for
> git to describe what it knows about it.  For example, it could provide
> a list of commits that it's a part of, etc.  

That is possible, but would be expensive similar to git-fsck-objects.  
All objects for each commit would need to be searched for the matching 
sha1.

> It'd be *really* nice if only the output of the sha1sum command on the 
> blob were needed.  (I can't recall exactly how git's blob SHA1's are 
> computed--maybe this isn't feasible.)

GIT adds a header of its own before object data.  You therefore need to 
use git-hash-object not sha1sum to get the right sha1 value.


Nicolas
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]