All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han Young <hanyang.tony@bytedance.com>
To: git@vger.kernel.org
Cc: Han Young <hanyang.tony@bytedance.com>
Subject: [PATCH] doc: diff-options: clarify --relative option
Date: Tue,  6 Feb 2024 14:56:05 +0800	[thread overview]
Message-ID: <20240206065605.44457-1-hanyang.tony@bytedance.com> (raw)

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


                 reply	other threads:[~2024-02-06  6:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206065605.44457-1-hanyang.tony@bytedance.com \
    --to=hanyang.tony@bytedance.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.