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

Getting clean diff data from git-mailinfo

From
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Date
Feb 21, 2020, 17:14 UTC
Message-ID
<20200221171312.xyzsrvebuwiw6pgj@chatter.i7.local>
Hello:

Git-mailinfo is a handy utility to quickly parse the contents of a message containing a patch. However, I'm curious why there isn't a way to get just the diff data, without all the surrounding junk. E.g.:

curl https://lore.kernel.org/driverdev-devel/20200221123817.16643-1-ajay.kathat@microchip.com/raw  \
  | git mailinfo msg patch > info

The contents of "msg" are already munged to reduce it to exactly what would be in the commit message (properly processing the extra From: header), but the contents of "patch" contain all the junk from around the diff, like the diffstat, git version info, and the list trailer.

Is there a git-native command to further clean up the "patch" file to get just diff contents (i.e. as returned by "git diff" after this patch is applied)?

-K
Next: Junio C Hamano
Message 1 of 4 in “Getting clean diff data from git-mailinfo”
  1. Konstantin RyabitsevFeb 21, 2020
  2. Junio C HamanoFeb 22, 2020
  3. Junio C HamanoFeb 22, 2020
  4. Andreas SchwabFeb 22, 2020

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.