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

git diff

From
CLCarter Lamb <carter.lamb@livetext.com>
Date
Jan 13, 2011, 22:46 UTC
Message-ID
<AANLkTik7cfu_DS=GS5gz_Tu94NC=ZGi-eA8YXztyd9Ra@mail.gmail.com>
In-Reply-To
<AANLkTi=ASvicFGaaDfqxjOxJELWPLKsQwvk7rEeT36Fh@mail.gmail.com>

I use git diff --summary --numstat <commit> to report the files modified, created, and deleted between the current commit and some prior commit. The --stat and --numstat options count the lines added and deleted for each file. Is there a way to report the lines modified for each file. For example:

Given content below for commit 1: aaaaa ccccc

Given content below for commit 2: aaaaa bbbbb ccccc

Given content below for commit 3: Aaaaa Bbbbb ccccc ddddd

git diff --numstat between commits 1 and 2 will report one line added. git diff --numstat between commits 2 and 3 will report three lines added and two lines deleted. I'd like to see the diff between commits 2 and 3 report two lines modified and one line added. Can this be done?

Best, Carter

Next: Jeff King
Message 1 of 2 in “git diff”
  1. Carter LambJan 13, 2011
  2. Jeff KingJan 17, 2011

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.