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

[PATCH] doc: diff-options: clarify --relative option

From
Han Young <hanyang.tony@bytedance.com>
Date
Feb 6, 2024, 06:56 UTC
Message-ID
<20240206065605.44457-1-hanyang.tony@bytedance.com>
In c0cb4a0679 `--relative` is given the option of specifying the path to be included in the diff output. This works by assigning the path as diff prefix. The documentation of `--relative` only mentions subdirectories, but in reality `--relative=foo` will happily display changes within the `foobar/` subdirectory or even the `foo-bar` file. Clarify the option a bit.
Signed-off-by: Han Young <hanyang.tony@bytedance.com>
---
 Documentation/diff-options.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 53ec3c9a34..b651e442b1 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -762,8 +762,9 @@ endif::git-format-patch[]
 	told to exclude changes outside the directory and show
 	pathnames relative to it with this option.  When you are
 	not in a subdirectory (e.g. in a bare repository), you
-	can name which subdirectory to make the output relative
-	to by giving a <path> as an argument.
+	can name which path to make the output relative
+	to by giving a <path> as an argument (e.g. `--relative=foo/`
+	will only show changes inside `foo` subdirectory).
 	`--no-relative` can be used to countermand both `diff.relative` config
 	option and previous `--relative`.
 
-- 
2.43.0
Message 1 of 1 in “doc: diff-options: clarify --relative option”
  1. doc: diff-options: clarify --relative optionHan Young, Feb 6, 2024

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.