git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: Any way to get complete diff up to a tag?

From
Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Date
May 6, 2010, 11:20 UTC
Message-ID
<A612847CFE53224C91B23E3A5B48BAC74482E50DE7@xmail3.se.axis.com>
In-Reply-To
<20100506094212.GB9921@atjola.homenet>
Show 20 quoted lines
> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Björn Steinbrink
> Sent: den 6 maj 2010 11:42
> To: Peter Kjellerstedt
> Cc: git@vger.kernel.org
> Subject: Re: Any way to get complete diff up to a tag?
> 
> On 2010.05.06 11:27:40 +0200, Peter Kjellerstedt wrote:
> > If I use
> >
> > $ git diff $(git rev-list --reverse v1.7.1 |head -1)..v1.7.1
> >
> > I almost get what I want, but the initial commit is still missing.
> > Is there any way to get that initial commit included in the diff?
> 
> git internally knows about the empty tree, so you can use:
> git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 v1.7.1
> 
> Björn

Thank you, that was useful. However, I need to be able to do this for an arbitrary repository, and that SHA seems to be specific for the git repository. How do I get the SHA for the empty tree in an arbitrary repository?

//Peter
Previous: Björn SteinbrinkNext: Santi Béjar
Message 4 of 13 in “Any way to get complete diff up to a tag?”
  1. Peter KjellerstedtMay 6, 2010
  2. Bert WesargMay 6, 2010
  3. Björn SteinbrinkMay 6, 2010
  4. Peter KjellerstedtMay 6, 2010
  5. Santi BéjarMay 6, 2010
  6. Johannes SixtMay 6, 2010
  7. Peter KjellerstedtMay 6, 2010
  8. Björn SteinbrinkMay 6, 2010
  9. Linus TorvaldsMay 6, 2010
  10. Greg TroxelMay 6, 2010
  11. Peter KjellerstedtMay 7, 2010
  12. KnittlMay 6, 2010
  13. Peter KjellerstedtMay 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.