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

Re: Commit-ish shortcut for immediate parent range

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 22, 2006, 15:11 UTC
Message-ID
<ehg1li$mn6$1@sea.gmane.org>
In-Reply-To
<200610221548.42048.andyparkins@gmail.com>
Andy Parkins wrote:
> Git's commit-ish is very powerful.  I was wondering however, if there was a 
> shortcut for (for example)?
> 
>  git-diff 3435fdb4c^..3435fdb4c

Thats "git-diff 3435fdb4c^ 3435fdb4c" - diff need pair of things (one or more might be implied/default), not DAG.

Show 5 quoted lines
> That is - the short range of a particular commit's parent to that commit; like
> 
>  git-diff 3435fdb4c!
> 
> Or similar.

Or similar. You have to use git-diff-tree, not git-diff as git-diff uses working tree as second tree if second argument is not given (and index as first tree if first argument is not given).

$ git diff-tree -p 3435fdb4c

(-p to show patch instead of "whatchanged" output) shows diff to parent of commit 3435fdb4c (if commit is merge commit, show nothing; use -m or -c or --cc then).

By the way 3435fdb4c.. means 3435fdb4c..HEAD, and ..3435fdb4c means HEAD..3435fdb4c (where HEAD means current branch).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Andy ParkinsNext: Linus Torvalds
Message 2 of 13 in “Commit-ish shortcut for immediate parent range”
  1. Andy ParkinsOct 22, 2006
  2. Jakub NarebskiOct 22, 2006
  3. Linus TorvaldsOct 22, 2006
  4. Linus TorvaldsOct 22, 2006
  5. Andy ParkinsOct 22, 2006
  6. Linus TorvaldsOct 22, 2006
  7. Jakub NarebskiOct 22, 2006
  8. Johannes SchindelinOct 22, 2006
  9. Jakub NarebskiOct 22, 2006
  10. Junio C HamanoOct 22, 2006
  11. Linus TorvaldsOct 23, 2006
  12. Johannes SchindelinOct 22, 2006
  13. Jeff KingOct 22, 2006

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.