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

git diff: print hunk numbers?

From
AMAleksey Midenkov <midenok@gmail.com>
Date
Sep 8, 2021, 20:40 UTC
Message-ID
<CAF8BazDKG03bpBEQyC9EsM8WxV_7WnQ386T=VT49EHNzsZ3PPw@mail.gmail.com>
Is that possible/how to print hunk numbers with git diff?
F.ex. instead of:
@@ -106,7 +110,6 @@ while ($r < $statement_count)
...

To print something like:

@@ -106,7 +110,6 @@ 4 @@ while ($r < $statement_count)
...

filterdiff uses hunk numbers intensively. Work with line-number ranges
is not so effective.
Next: Jeff King
Message 1 of 5 in “git diff: print hunk numbers?”
  1. Aleksey MidenkovSep 8, 2021
  2. Jeff KingSep 8, 2021
  3. Junio C HamanoSep 8, 2021
  4. Aleksey MidenkovSep 9, 2021
  5. Aleksey MidenkovSep 9, 2021

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.