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

Re: [RFD] Strange patch formats (aka tricks with unified diffs)..

From
Paul Mackerras <paulus@samba.org>
Date
Apr 13, 2007, 05:43 UTC
Message-ID
<17951.6252.457936.428919@cargo.ozlabs.ibm.com>
In-Reply-To
<Pine.LNX.4.64.0704121436050.4061@woody.linux-foundation.org>
Linus Torvalds writes:
>  - bug Paul about alternate diff viewing capabilities in gitk. He's cc'd 
>    here. A way to make the "diff" pane show just the new one, the old one, 
>    or even both side-by-side with some mousy interface?

Showing just the old lines, or just the new lines, would be dead easy, since the Tk text widget has an "elide" option on tagged ranges of text that effectively removes them from the display. So I don't even have to change the contents of the text widget, merely the display options associated with the tags that I already have attached to the old and new lines (that's how they get their color).

Side-by-side would be more challenging.

Alternatively I could provide a field where you can put in a filter command to be put between the diff generator and the display parser.

Have you seen what dirdiff can do with displaying diffs? You can expose more context, move old and new lines up and down (but not in a manner which changes the meaning of the diff), and split context lines into old/new pairs, all with the mouse. This lets me rearrange a diff to make it more visually meaningful and understandable. I could import that stuff into gitk, since dirdiff is also written in Tcl/Tk.

Paul.
Previous: Marco CostalbaNext: Martin Langhoff
Message 5 of 16 in “[RFD] Strange patch formats (aka tricks with unified diffs)..”
  1. Linus TorvaldsApr 12, 2007
  2. Junio C HamanoApr 12, 2007
  3. Marco CostalbaApr 13, 2007
  4. Marco CostalbaApr 17, 2007
  5. Paul MackerrasApr 13, 2007
  6. Martin LanghoffApr 13, 2007
  7. Junio C HamanoApr 13, 2007
  8. Martin LanghoffApr 13, 2007
  9. Johannes SchindelinApr 14, 2007
  10. Junio C HamanoApr 14, 2007
  11. Jeff KingApr 14, 2007
  12. Linus TorvaldsApr 13, 2007
  13. Paul MackerrasApr 18, 2007
  14. Linus TorvaldsApr 18, 2007
  15. Matthias LederhoferApr 13, 2007
  16. Linus TorvaldsApr 13, 2007

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.