1

I have a .patch file with two commits in it:

From 6551a3bb
From <redacted>
Date: Tue, 23 Jun 2015 13:42:58 -0700
Subject: <redacted>

From 224fbe
From: <redacted>
Date: Tue, 30 Jun 2015 21:15:16 +0100
Subject: <redacted>

How can I tell what SHA the patch was generated from? Assume I know the branch.

Andrew Lauer Barinov
  • 5,694
  • 10
  • 59
  • 83
  • Do you mean how to disambiguate 6551a3bb? (as in http://stackoverflow.com/questions/27428441/how-to-disambiguate-an-ambiguous-abbreviated-sha1-in-git)? – VonC Jul 01 '15 at 07:08
  • @VonC no I have a patch but am not sure what commit the HEAD was on when it was generated – Andrew Lauer Barinov Jul 01 '15 at 17:03

1 Answers1

0

but am not sure what commit the HEAD was on when it was generated

Looking at git format-patch, the patch was generated in a way which included 224fbe and 6551a3bb:

  • either by specifying a range of commits which includes those two.
    In that case, HEAD could have been anywhere.
  • or by specifying a <since> commit, where are included the commits leading to the tip of the current branch that are not in the history that leads to the <since>.
    In that sec ond case, HEAD might have been 224fbe
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250