git/Documentation
Taylor Blau eeaa24b990 builtin/config: introduce `--default`
For some use cases, callers of the `git-config(1)` builtin would like to
fallback to default values when the variable asked for does not exist.
In addition, users would like to use existing type specifiers to ensure
that values are parsed correctly when they do exist in the
configuration.

For example, to fetch a value without a type specifier and fallback to
`$fallback`, the following is required:

  $ git config core.foo || echo "$fallback"

This is fine for most values, but can be tricky for difficult-to-express
`$fallback`'s, like ANSI color codes.

This motivates `--get-color`, which is a one-off exception to the normal
type specifier rules wherein a user specifies both the configuration
variable and an optional fallback. Both are formatted according to their
type specifier, which eases the burden on the user to ensure that values
are correctly formatted.

This commit (and those following it in this series) aim to eventually
replace `--get-color` with a consistent alternative. By introducing
`--default`, we allow the `--get-color` action to be promoted to a
`--type=color` type specifier, retaining the "fallback" behavior via the
`--default` flag introduced in this commit.

For example, we aim to replace:

  $ git config --get-color variable [default] [...]

with:

  $ git config --default default --type=color variable [...]

Values filled by `--default` behave exactly as if they were present in
the affected configuration file; they will be parsed by type specifiers
without the knowledge that they are not themselves present in the
configuration.

Specifically, this means that the following will work:

  $ git config --int --default 1M does.not.exist
  1048576

In subsequent commits, we will offer `--type=color`, which (in
conjunction with `--default`) will be sufficient to replace
`--get-color`.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-23 22:51:38 +09:00
..
RelNotes Sync with Git 2.16.3 2018-03-22 14:36:51 -07:00
howto doc: use https links to avoid http redirect 2017-04-20 22:05:37 -07:00
technical Merge branch 'jk/smart-http-protocol-doc-fix' 2018-03-14 12:01:06 -07:00
.gitattributes
…
.gitignore Documentation: convert SubmittingPatches to AsciiDoc 2017-11-13 13:25:19 +09:00
CodingGuidelines CodingGuidelines: mention "static" and "extern" 2018-02-08 14:20:43 -08:00
Makefile Docs: split out long-running subprocess handshake 2018-01-25 11:24:32 -08:00
SubmittingPatches Merge branch 'bc/submitting-patches-in-asciidoc' 2018-01-09 14:32:54 -08:00
asciidoc.conf
…
asciidoctor-extensions.rb
…
blame-options.txt Merge branch 'bc/blame-doc-fix' 2017-02-24 10:48:08 -08:00
build-docdep.perl
…
cat-texi.perl
…
cmd-list.perl
…
config.txt Merge branch 'bw/doc-submodule-recurse-config-with-clone' 2018-03-06 14:54:05 -08:00
date-formats.txt
…
diff-config.txt doc: add missing values "none" and "default" for diff.wsErrorHighlight 2017-07-25 14:30:49 -07:00
diff-format.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
diff-generate-patch.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
diff-options.txt Merge branch 'nd/diff-stat-with-summary' 2018-03-14 12:01:02 -07:00
docbook-xsl.css
…
docbook.xsl
…
everyday.txto
…
fetch-options.txt fetch: add a --prune-tags option and fetch.pruneTags config 2018-02-09 13:10:13 -08:00
fix-texi.perl
…
fmt-merge-msg-config.txt
…
git-add.txt add: introduce "--renormalize" 2017-11-17 10:31:05 +09:00
git-am.txt Merge branch 'nd/rebase-show-current-patch' 2018-03-06 14:54:02 -08:00
git-annotate.txt diff: --indent-heuristic is no longer experimental 2017-11-02 14:51:24 +09:00
git-apply.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
git-archimport.txt docs/archimport: quote sourcecontrol.net reference 2017-04-20 22:05:38 -07:00
git-archive.txt
…
git-bisect-lk2009.txt doc: replace more gmane links 2017-05-09 21:13:13 -07:00
git-bisect.txt bisect: mention "view" as an alternative to "visualize" 2017-11-13 10:51:14 +09:00
git-blame.txt diff: --indent-heuristic is no longer experimental 2017-11-02 14:51:24 +09:00
git-branch.txt Merge branch 'tz/branch-doc-remove-set-upstream' 2017-12-06 09:23:36 -08:00
git-bundle.txt
…
git-cat-file.txt cat-file doc: document that -e will return some output 2018-01-10 15:08:14 -08:00
git-check-attr.txt
…
git-check-ignore.txt
…
git-check-mailmap.txt
…
git-check-ref-format.txt Doc/check-ref-format: clarify information about @{-N} syntax 2017-12-19 10:00:45 -08:00
git-checkout-index.txt
…
git-checkout.txt Merge branch 'ks/doc-checkout-previous' 2017-12-13 13:28:57 -08:00
git-cherry-pick.txt
…
git-cherry.txt
…
git-citool.txt
…
git-clean.txt
…
git-clone.txt Documentation/git-clone: improve description for submodule recursing 2017-12-05 11:30:38 -08:00
git-column.txt
…
git-commit-tree.txt
…
git-commit.txt commit: add support for --fixup <commit> -m"<extra message>" 2017-12-22 13:10:24 -08:00
git-config.txt builtin/config: introduce `--default` 2018-04-23 22:51:38 +09:00
git-count-objects.txt
…
git-credential-cache--daemon.txt
…
git-credential-cache.txt credential-cache: use XDG_CACHE_HOME for socket 2017-03-17 11:19:40 -07:00
git-credential-store.txt
…
git-credential.txt
…
git-cvsexportcommit.txt
…
git-cvsimport.txt
…
git-cvsserver.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
git-daemon.txt daemon: add --log-destination=(stderr|syslog|none) 2018-02-05 10:30:44 -08:00
git-describe.txt builtin/describe.c: describe a blob 2017-12-19 11:17:16 -08:00
git-diff-files.txt
…
git-diff-index.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
git-diff-tree.txt
…
git-diff.txt diff-files: document --ours etc. 2017-04-13 16:15:25 -07:00
git-difftool.txt
…
git-fast-export.txt
…
git-fast-import.txt fast-import: increase the default pack depth to 50 2017-06-12 09:50:33 -07:00
git-fetch-pack.txt
…
git-fetch.txt fetch: make the --prune-tags work with <url> 2018-02-09 13:10:13 -08:00
git-filter-branch.txt Merge branch 'dg/filter-branch-filter-order-doc' 2017-10-19 14:45:45 +09:00
git-fmt-merge-msg.txt
…
git-for-each-ref.txt Merge branch 'js/for-each-ref-remote-name-and-ref' 2017-11-15 12:14:32 +09:00
git-format-patch.txt format-patch: have progress option while generating patches 2017-08-14 14:09:45 -07:00
git-fsck-objects.txt
…
git-fsck.txt
…
git-gc.txt docs/git-gc: fix default value for `--aggressiveDepth` 2017-02-24 09:59:12 -08:00
git-get-tar-commit-id.txt
…
git-grep.txt Merge branch 'mr/doc-negative-pathspec' into maint 2017-10-18 14:19:12 +09:00
git-gui.txt
…
git-hash-object.txt
…
git-help.txt
…
git-http-backend.txt
…
git-http-fetch.txt
…
git-http-push.txt
…
git-imap-send.txt
…
git-index-pack.txt index-pack: support checking objects but not links 2018-03-15 10:16:24 -07:00
git-init-db.txt
…
git-init.txt
…
git-instaweb.txt
…
git-interpret-trailers.txt Merge branch 'bc/doc-interpret-trailers-grammofix' into maint 2018-03-22 14:24:21 -07:00
git-log.txt log: add option to choose which refs to decorate 2017-11-22 13:18:59 +09:00
git-ls-files.txt fsmonitor: add documentation for the fsmonitor extension. 2017-10-01 17:23:05 +09:00
git-ls-remote.txt
…
git-ls-tree.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
git-mailinfo.txt
…
git-mailsplit.txt
…
git-merge-base.txt merge-base --fork-point doc: clarify the example and failure modes 2017-11-09 12:28:30 +09:00
git-merge-file.txt
…
git-merge-index.txt
…
git-merge-one-file.txt
…
git-merge-tree.txt
…
git-merge.txt Merge branch 'wk/pull-signoff' 2017-11-06 14:24:24 +09:00
git-mergetool--lib.txt
…
git-mergetool.txt
…
git-mktag.txt
…
git-mktree.txt
…
git-mv.txt
…
git-name-rev.txt
…
git-notes.txt Merge branch 'rd/doc-notes-prune-fix' 2017-12-06 09:23:40 -08:00
git-p4.txt git-p4: update multiple shelved change lists 2017-12-22 13:30:52 -08:00
git-pack-objects.txt gc: do not repack promisor packfiles 2017-12-08 09:52:42 -08:00
git-pack-redundant.txt
…
git-pack-refs.txt
…
git-parse-remote.txt
…
git-patch-id.txt doc: remove unsupported parameter from patch-id 2017-07-28 14:41:32 -07:00
git-prune-packed.txt
…
git-prune.txt prune: add "--progress" to man page and usage msg 2017-11-22 12:29:30 +09:00
git-pull.txt Merge branch 'sb/pull-rebase-submodule' 2017-07-13 16:14:54 -07:00
git-push.txt builtin/push.c: add push.pushOption config 2017-10-24 09:57:54 +09:00
git-quiltimport.txt
…
git-read-tree.txt Merge branch 'as/read-tree-prefix-doc-fix' into maint 2018-02-15 15:18:14 -08:00
git-rebase.txt Merge branch 'nd/rebase-show-current-patch' 2018-03-06 14:54:02 -08:00
git-receive-pack.txt refs: reject ref updates while GIT_QUARANTINE_PATH is set 2017-04-16 18:19:18 -07:00
git-reflog.txt doc: add missing "-n" (dry-run) option to reflog man page 2017-11-22 12:24:47 +09:00
git-remote-ext.txt
…
git-remote-fd.txt
…
git-remote-helpers.txto
…
git-remote-testgit.txt
…
git-remote.txt git remote doc: correct dangerous lies about what prune does 2018-02-09 13:10:12 -08:00
git-repack.txt repack: accept --threads=<n> and pass it down to pack-objects 2017-04-27 08:09:25 +09:00
git-replace.txt
…
git-request-pull.txt
…
git-rerere.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
git-reset.txt Spelling fixes 2017-06-27 10:35:49 -07:00
git-rev-list.txt rev-list: add list-objects filtering support 2017-11-22 14:11:57 +09:00
git-rev-parse.txt Merge branch 'sb/rev-parse-show-superproject-root' 2017-10-28 10:18:40 +09:00
git-revert.txt
…
git-rm.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
git-send-email.txt send-email: support separate Reply-To address 2018-03-06 00:18:00 -08:00
git-send-pack.txt Merge branch 'ma/parse-maybe-bool' 2017-08-22 10:29:03 -07:00
git-sh-i18n--envsubst.txt
…
git-sh-i18n.txt
…
git-sh-setup.txt
…
git-shell.txt shell: drop git-cvsserver support by default 2017-09-12 11:05:58 +09:00
git-shortlog.txt
…
git-show-branch.txt
…
git-show-index.txt
…
git-show-ref.txt
…
git-show.txt doc: mention 'git show' defaults to HEAD 2018-01-30 13:12:18 -08:00
git-stage.txt
…
git-stash.txt git-stash.txt: remove extra square bracket 2018-03-27 19:09:13 -07:00
git-status.txt Merge branch 'sb/status-doc-fix' into maint 2018-03-22 14:24:23 -07:00
git-stripspace.txt
…
git-submodule.txt Doc/git-submodule: improve readability and grammar of a sentence 2018-01-16 11:34:36 -08:00
git-svn.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
git-symbolic-ref.txt
…
git-tag.txt tag: add --edit option 2018-02-07 12:46:48 -08:00
git-tools.txt doc: replace or.cz gitwiki link with git.wiki.kernel.org 2017-04-20 22:05:37 -07:00
git-unpack-file.txt
…
git-unpack-objects.txt
…
git-update-index.txt Merge branch 'bp/fsmonitor' into maint 2018-03-22 14:24:21 -07:00
git-update-ref.txt
…
git-update-server-info.txt
…
git-upload-archive.txt
…
git-upload-pack.txt
…
git-var.txt
…
git-verify-commit.txt
…
git-verify-pack.txt
…
git-verify-tag.txt
…
git-web--browse.txt
…
git-whatchanged.txt
…
git-worktree.txt Merge branch 'nd/worktree-move' 2018-03-14 12:01:05 -07:00
git-write-tree.txt
…
git.txt Merge branch 'ab/man-sec-list' 2018-03-15 15:00:46 -07:00
gitattributes.txt Merge branch 'jk/attributes-path-doc' 2018-03-21 11:30:15 -07:00
gitcli.txt stash: update documentation to use 'stash entry' 2017-06-18 22:16:36 -07:00
gitcore-tutorial.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
gitcredentials.txt credential doc: make multiple-helper behavior more prominent 2017-05-02 10:58:06 +09:00
gitcvs-migration.txt
…
gitdiffcore.txt docs/diffcore: unquote "Complete Rewrites" in headers 2017-02-28 11:34:38 -08:00
giteveryday.txt
…
gitglossary.txt
…
githooks.txt Merge branch 'es/worktree-checkout-hook' 2017-12-27 11:16:21 -08:00
gitignore.txt gitignore.txt: elaborate shell glob syntax 2018-02-02 10:56:46 -08:00
gitk.txt
…
gitmodules.txt Merge branch 'ss/submodule-shallow-doc' 2017-04-26 15:39:07 +09:00
gitnamespaces.txt
…
gitremote-helpers.txt introduce fetch-object: fetch one promisor object 2017-12-05 09:46:05 -08:00
gitrepository-layout.txt Merge branch 'sp/doc-info-attributes' 2017-12-06 09:23:43 -08:00
gitrevisions.txt
…
gitsubmodules.txt Merge branch 'ms/non-ascii-ticks' into maint 2018-03-22 14:24:26 -07:00
gittutorial-2.txt
…
gittutorial.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
gitweb.conf.txt doc: use https links to avoid http redirect 2017-04-20 22:05:37 -07:00
gitweb.txt doc: use https links to Wikipedia to avoid http redirects 2017-05-15 13:04:54 +09:00
gitworkflows.txt Merge branch 'db/doc-workflows-neuter-the-maintainer' 2017-12-27 11:16:25 -08:00
glossary-content.txt Merge branch 'mr/doc-negative-pathspec' into maint 2017-10-18 14:19:12 +09:00
howto-index.sh
…
i18n.txt doc: camelCase the i18n config variables to improve readability 2017-07-17 15:11:26 -07:00
install-doc-quick.sh install-doc-quick: allow specifying what ref to install 2017-12-12 16:49:40 -08:00
install-webdoc.sh
…
line-range-format.txt
…
lint-gitlink.perl
…
mailmap.txt
…
manpage-1.72.xsl
…
manpage-base-url.xsl.in
…
manpage-base.xsl
…
manpage-bold-literal.xsl
…
manpage-normal.xsl
…
manpage-quote-apos.xsl
…
manpage-suppress-sp.xsl
…
merge-config.txt merge: add config option for verifySignatures 2017-12-12 10:51:38 -08:00
merge-options.txt merge: allow fast-forward when merging a tracked tag 2018-02-16 11:22:43 -08:00
merge-strategies.txt Merge branch 'dp/merge-strategy-doc-fix' 2018-03-21 11:30:13 -07:00
pretty-formats.txt Merge branch 'mk/doc-pretty-fill' 2018-03-08 12:36:29 -08:00
pretty-options.txt
…
pull-fetch-param.txt fetch doc: src side of refspec could be full SHA-1 2017-10-18 05:59:34 +09:00
rebase-config.txt rebase -i: learn to abbreviate command names 2017-12-05 10:20:51 -08:00
rev-list-options.txt Merge branch 'jh/fsck-promisors' 2018-02-13 13:39:03 -08:00
revisions.txt Documentation: revisions: fix typo: "three dot" ---> "three-dot" (in line with "two-dot"). 2017-12-04 08:25:06 -08:00
sequencer.txt
…
texi.xsl
…
transfer-data-leaks.txt
…
urls-remotes.txt
…
urls.txt
…
user-manual.conf
…
user-manual.txt checkout: describe_detached_head: remove ellipsis after committish 2017-12-06 07:32:40 -08:00