aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git.txt
diff options
context:
space:
mode:
authorJohn Cai <johncai86@gmail.com>2023-05-06 04:15:29 +0000
committerJunio C Hamano <gitster@pobox.com>2023-05-06 14:34:09 -0700
commit44451a2e5eec5360378be23e2cdbd9ecee49e14e (patch)
treee5ff5d8d9337a5c5b76440583ea4f7d9e2c63880 /Documentation/git.txt
parent48d89b51b3bb8a60580c36731b96a7206ce1e5b9 (diff)
downloadgit-44451a2e5eec5360378be23e2cdbd9ecee49e14e.tar.gz
attr: teach "--attr-source=<tree>" global option to "git"
Earlier, 47cfc9bd (attr: add flag `--source` to work with tree-ish, 2023-01-14) taught "git check-attr" the "--source=<tree>" option to allow it to read attribute files from a tree-ish, but did so only for the command. Just like "check-attr" users wanted a way to use attributes from a tree-ish and not from the working tree files, users of other commands (like "git diff") would benefit from the same. Undo most of the UI change the commit made, while keeping the internal logic to read attributes from a given tree-ish. Expose the internal logic via a new "--attr-source=<tree>" command line option given to "git", so that it can be used with any git command that runs as part of the main git process. Additionally, add an environment variable GIT_ATTR_SOURCE that is set when --attr-source is passed in, so that subprocesses use the same value for the attributes source tree. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git.txt')
-rw-r--r--Documentation/git.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 74973d3cc4..02707cb01d 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -212,6 +212,11 @@ If you just want to run git as if it was started in `<path>` then use
nohelpers (exclude helper commands), alias and config
(retrieve command list from config variable completion.commands)
+--attr-source=<tree-ish>::
+ Read gitattributes from <tree-ish> instead of the worktree. See
+ linkgit:gitattributes[5]. This is equivalent to setting the
+ `GIT_ATTR_SOURCE` environment variable.
+
GIT COMMANDS
------------
@@ -686,6 +691,9 @@ for further details.
tells Git not to verify the SSL certificate when fetching or
pushing over HTTPS.
+`GIT_ATTR_SOURCE`::
+ Sets the treeish that gitattributes will be read from.
+
`GIT_ASKPASS`::
If this environment variable is set, then Git commands which need to
acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)