summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-10 02:04:52 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-10 02:04:52 +0100
commitbd31944ddad5ed22b16ac8aa97edab7381bddb8e (patch)
tree012c52eb0e7688d2e19bb898d0e904f89dfcd858
parentMerge branch 'bc/ancient-ci' (diff)
parentdoc: option value may be separate for valid reasons (diff)
downloadgit-bd31944ddad5ed22b16ac8aa97edab7381bddb8e.tar.xz
git-bd31944ddad5ed22b16ac8aa97edab7381bddb8e.zip
Merge branch 'jc/doc-opt-tilde-expand'
Describe a case where an option value needs to be spelled as a separate argument, i.e. "--opt val", not "--opt=val". * jc/doc-opt-tilde-expand: doc: option value may be separate for valid reasons
-rw-r--r--Documentation/gitcli.txt9
-rw-r--r--Documentation/gitcredentials.txt6
2 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
index 7c709324ba..bd62cbd043 100644
--- a/Documentation/gitcli.txt
+++ b/Documentation/gitcli.txt
@@ -90,6 +90,15 @@ scripting Git:
for long options. An option that takes optional option-argument must be
written in the 'stuck' form.
+ * Despite the above suggestion, when Arg is a path relative to the
+ home directory of a user, e.g. ~/directory/file or ~u/d/f, you
+ may want to use the separate form, e.g. `git foo --file ~/mine`,
+ not `git foo --file=~/mine`. The shell will expand `~/` in the
+ former to your home directory, but most shells keep the tilde in
+ the latter. Some of our commands know how to tilde-expand the
+ option value even when given in the stuck form, but not all of
+ them do.
+
* When you give a revision parameter to a command, make sure the parameter is
not ambiguous with a name of a file in the work tree. E.g. do not write
`git log -1 HEAD` but write `git log -1 HEAD --`; the former will not work
diff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt
index 71dd19731a..35a7452c8f 100644
--- a/Documentation/gitcredentials.txt
+++ b/Documentation/gitcredentials.txt
@@ -242,6 +242,12 @@ Here are some example specifications:
[credential]
helper = "foo --bar='whitespace arg'"
+# store helper (discouraged) with custom location for the db file;
+# use `--file ~/.git-secret.txt`, rather than `--file=~/.git-secret.txt`,
+# to allow the shell to expand tilde to the home directory.
+[credential]
+ helper = "store --file ~/.git-secret.txt"
+
# you can also use an absolute path, which will not use the git wrapper
[credential]
helper = "/path/to/my/helper --with-arguments"