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

How is git diff --relative supposed to work?

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 6, 2026, 08:15 UTC
Message-ID
<f1cd3ca7-9b31-45b0-b990-05f4d1f6b4f2@kdbg.org>
Try this in your favorite repository:

$ echo foo >> Makefile $ git -P diff --name-only --relative=Ma kefile

This doesn't look right. Shouldn't the path specified with --relative be interpreted as a directory instead of an arbitrary textual prefix?

-- Hannes
Next: Junio C Hamano
Message 1 of 2 in “How is git diff --relative supposed to work?”
  1. Johannes SixtJan 6, 2026
  2. Junio C HamanoJan 6, 2026

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.