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

[q] git-diff --reverse 7def2be1..7def2be1^

From
IMIngo Molnar <mingo@elte.hu>
Date
Jun 20, 2008, 08:20 UTC
Message-ID
<20080620082034.GA24913@elte.hu>
A couple of stupid Git questions (using git-1.5.4.3-2.fc8).
Sometimes i want to see the reverse diff of a particular commit.
If i want to see the normal diff i do:
   git-log -1 -p 7def2be1
But generating the reverse diff does not work:
   git-log --reverse -1 -p 7def2be1

Because the '--reverse' here is the ordering of the revlist, not the direction of the patch itself. And that's OK, albeit slightly unintuitive.

So instead i do:
   git-diff --reverse 7def2be1..7def2be1^
I've got two observations / potential suggestions:
1) the SHA1 is duplicated above, is there a way to avoid it? Initially i 
   tried the obvious extension:
      git-diff --reverse 7def2be1..^
   But Git didnt recognize that as a valid commit range.
2) is there a way to pass something like --reversediff to git-log?
   [ time passes as i read the manpage - the final thing i do when
     every other measure fails ;-) ]
   Ah, there's "git-log -R" that would achieve this. 
   The situation still feels a tiny bit inconsistent to me, and that's 
   why my attempt to figure it out intuitively based on my existing 
   practices failed:
    a) -R is not recognized by git-diff (so i cannot just standardize 
       myself on -R and have to waste neurons on remembering the 
       distinction ;-)
    b) --reverse has different meaning in git-log and git-diff.

Perhaps one solution would be if -R was recognized by git-diff as the meaning of --reverse is an ABI. The extension to the sha1 range specifier would be nice as well, it feels intuitive to me.

Hm?
	Ingo
Next: Junio C Hamano
Message 1 of 25 in “[q] git-diff --reverse 7def2be1..7def2be1^”
  1. Ingo MolnarJun 20, 2008
  2. Junio C HamanoJun 20, 2008
  3. Junio C HamanoJun 20, 2008
  4. Ingo MolnarJun 20, 2008
  5. Ingo MolnarJun 20, 2008
  6. Jakub NarebskiJun 20, 2008
  7. Mikael MagnussonJun 20, 2008
  8. Jakub NarebskiJun 20, 2008
  9. Ingo MolnarJun 20, 2008
  10. Andreas EricssonJun 22, 2008
  11. Dmitry PotapovJul 6, 2008
  12. Junio C HamanoJul 6, 2008
  13. Dmitry PotapovJul 6, 2008
  14. Junio C HamanoJul 6, 2008
  15. Dmitry PotapovJul 7, 2008
  16. Matthieu MoyJun 20, 2008
  17. Ingo MolnarJun 20, 2008
  18. Jakub NarebskiJun 20, 2008
  19. Ingo MolnarJun 26, 2008
  20. Jakub NarebskiJun 26, 2008
  21. Ingo MolnarJun 26, 2008
  22. Nicolas PitreJun 26, 2008
  23. Junio C HamanoJun 28, 2008
  24. Mikael MagnussonJun 20, 2008
  25. Ingo MolnarJun 20, 2008

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.