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

Re: patches in context format ?

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Jan 12, 2009, 09:34 UTC
Message-ID
<871vv8rhpz.fsf@iki.fi>
In-Reply-To
<46d6db660901120100g7f62a0c2k68c96cbfc23dab5@mail.gmail.com>
Christian MICHON (2009-01-12 10:00 +0100) wrote:
> is there another way to translate from "context" to "unified" format ?

Well, this is not exactly the best solution for a Vim user but this is the only way I know. Emacs can convert diffs between the formats. You don't even need to launch Emacs, just run it in batch mode:

    $ emacs --batch -Q --file input.diff \
        --eval '(diff-context->unified (point-min) (point-max))' \
        --eval '(save-buffer)'
Previous: Christian MICHONNext: Christian MICHON
Message 4 of 7 in “patches in context format ?”
  1. Christian MICHONJan 12, 2009
  2. Junio C HamanoJan 12, 2009
  3. Christian MICHONJan 12, 2009
  4. Teemu LikonenJan 12, 2009
  5. Christian MICHONJan 12, 2009
  6. Jeff KingJan 12, 2009
  7. Christian MICHONJan 12, 2009

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.