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

Re: [BUG] Highly inconsistent diff UI

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Apr 25, 2013, 07:51 UTC
Message-ID
<CALkWK0n9xqQr30QWEuhuM9c1xrAJ=SpYVBjkiRk+tP5E7DtBGw@mail.gmail.com>
In-Reply-To
<7vppxj6thv.fsf@alter.siamese.dyndns.org>
Okay, so the point I was trying to make is:

The range version of $(git merge-base A B) B is B ^$(git merge-base A B), and not B --not $(git merge-base --all A B) [which is equivalent to B ^A or A..B].

Junio C Hamano wrote:
> I dunno.  The description you gave was insufficient for me to answer
> that question.
Sorry about that.  I'll rewrite it as a set of commands:

$ cd /tmp $ git clone gh:artagnon/clayoven $ cd clayoven $ git checkout -b pu master~10 $ echo "foom" >>LICENSE $ git commit -a -m "Change in pu" $ git checkout -b rebase.autostash master~5 $ echo "loom" >> clayoven.gemspec $ git commit -a -m "Change in rebase.autostash" $ git checkout master $ git merge pu $ git checkout rebase.autostash $ git merge pu $ echo "quux" >>Gemfile $ git commit -a -m "Change 2 in rebase.autostash" $ git log rebase.autostash ^master $ git log rebase.autostash --not $(git merge-base --all rebase.autostash master) $ git log rebase.autostash ^$(git merge-base rebase.autostash master) $ git diff rebase.autostash ^$(git merge-base rebase.autostash master)

Note that git diff can only take two endpoints so git merge-base --all is meaningless in this case.

To summarize: B ^(git merge-base A B) [the current ... syntax of git diff] has no exact equivalent in the log world. Therefore, no matter which existing rev spec we overload, we can never get the current ... for diff in a consistent manner.

We certainly know that 'git diff A~B' is going to be useful, and have an exact equivalent 'git log A~B' (but I'm not sure how useful it will be, because I don't work with merges much). The point is that it can be overloaded in a consistent manner for other commands like 'rebase -i' too.

I recently caved to overloading .. [1] because there's so much resistance to inventing a new rev spec. I'm not exactly elated with that.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/222343
Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 33 of 45 in “[BUG] Highly inconsistent diff UI”
  1. Ramkumar RamachandraApr 24, 2013
  2. Jonathan NiederApr 24, 2013
  3. Junio C HamanoApr 24, 2013
  4. Ramkumar RamachandraApr 24, 2013
  5. Jonathan NiederApr 24, 2013
  6. Junio C HamanoApr 24, 2013
  7. Ramkumar RamachandraApr 24, 2013
  8. Junio C HamanoApr 24, 2013
  9. Ramkumar RamachandraApr 24, 2013
  10. Junio C HamanoApr 24, 2013
  11. Ramkumar RamachandraApr 24, 2013
  12. Ramkumar RamachandraApr 24, 2013
  13. Junio C HamanoApr 24, 2013
  14. Ramkumar RamachandraApr 24, 2013
  15. Junio C HamanoApr 24, 2013
  16. Ramkumar RamachandraApr 24, 2013
  17. Thomas RastApr 24, 2013
  18. Ramkumar RamachandraApr 24, 2013
  19. Jonathan NiederApr 24, 2013
  20. Ramkumar RamachandraApr 24, 2013
  21. Thomas RastApr 25, 2013
  22. Ramkumar RamachandraApr 25, 2013
  23. Junio C HamanoApr 25, 2013
  24. Ramkumar RamachandraApr 25, 2013
  25. Jonathan NiederApr 25, 2013
  26. Junio C HamanoApr 25, 2013
  27. Duy NguyenApr 26, 2013
  28. Phil HordApr 24, 2013
  29. Junio C HamanoApr 24, 2013
  30. Ramkumar RamachandraApr 24, 2013
  31. Ramkumar RamachandraApr 24, 2013
  32. Junio C HamanoApr 25, 2013
  33. Ramkumar RamachandraApr 25, 2013
  34. Ramkumar RamachandraApr 25, 2013
  35. Ramkumar RamachandraApr 26, 2013
  36. Ramkumar RamachandraApr 26, 2013
  37. Junio C HamanoApr 29, 2013
  38. Ramkumar RamachandraApr 29, 2013
  39. Junio C HamanoApr 29, 2013
  40. Ramkumar RamachandraApr 29, 2013
  41. Ramkumar RamachandraApr 29, 2013
  42. Junio C HamanoApr 29, 2013
  43. Ramkumar RamachandraApr 29, 2013
  44. John KeepingApr 29, 2013
  45. Ramkumar RamachandraApr 25, 2013

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.