mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
Merge branch 'jc/optional-path'
Configuration variables that take a pathname as a value (e.g. blame.ignorerevsfile) can be marked as optional by prefixing ":(optoinal)" before its value. * jc/optional-path: parseopt: values of pathname type can be prefixed with :(optional) config: values of pathname type can be prefixed with :(optional) t7500: fix GIT_EDITOR shell snippet t7500: make each piece more independent
This commit is contained in:
@@ -357,7 +357,9 @@ compiled without runtime prefix support, the compiled-in prefix will be
|
||||
substituted instead. In the unlikely event that a literal path needs to
|
||||
be specified that should _not_ be expanded, it needs to be prefixed by
|
||||
`./`, like so: `./%(prefix)/bin`.
|
||||
|
||||
+
|
||||
If prefixed with `:(optional)`, the configuration variable is treated
|
||||
as if it does not exist, if the named path does not exist.
|
||||
|
||||
Variables
|
||||
~~~~~~~~~
|
||||
|
||||
@@ -216,6 +216,20 @@ $ git describe --abbrev=10 HEAD # correct
|
||||
$ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT
|
||||
----------------------------
|
||||
|
||||
|
||||
Magic filename options
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
Options that take a filename allow a prefix `:(optional)`. For example:
|
||||
|
||||
----------------------------
|
||||
git commit -F :(optional)COMMIT_EDITMSG
|
||||
# if COMMIT_EDITMSG does not exist, equivalent to
|
||||
git commit
|
||||
----------------------------
|
||||
|
||||
Like with configuration values, if the named file is missing Git behaves as if
|
||||
the option was not given at all. See "Values" in linkgit:git-config[1].
|
||||
|
||||
NOTES ON FREQUENTLY CONFUSED OPTIONS
|
||||
------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user