Re: Finding a commit

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

 



Daniele Segato wrote:
> On Wed, Oct 21, 2009 at 1:29 PM, Soham Mehta <soham@xxxxxxx> wrote:
> > Because SHA1 can change if a commit is cherry-picked around, I cannot just
> > grep for that SHA1 from git-rev-list or git-log on 'y'. I need a way to know
> > if a commit with identical changes (as in 'x') is also present in 'y'.

man git-patch-id (online at http://git.or.cz/man/git-patch-id).

Note that if the cherry-pick conflicted, you'll get a different
patch-id.

> I'm really not an expert of git..
> 
> but A commit is something like:
> 
> Commit -> Tree ---> Blob1, Blob2, Blob3
> 
> Commit, Trees and Blobs are all identified by sha1
> the commit should keep information on the author, the "parent"
> commit(s) and so on..
> the tree should just keep the "snapshot" of the data..
> 
> so I think that if you search for the SHA-1 of the tree you should be fine..

Not if you really want to find out if X was cherry-picked into this
repository, because the tree is the *final state* at that commit,
which of course includes all preceding changes.

So suppose you have two patches A.diff and B.diff introducing files of
the same name; then if you combine them into history as

  A -- B

the tree state at B has both files, and hence is different from the
tree state of B' in

  B' -- A'

because there it only has the file B.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
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]