1
0
mirror of https://github.com/git/git.git synced 2024-10-22 12:28:32 +02:00
git/Documentation
Nguyễn Thái Ngọc Duy 3efd0bedc6 config: add conditional include
Sometimes a set of repositories want to share configuration settings
among themselves that are distinct from other such sets of repositories.
A user may work on two projects, each of which have multiple
repositories, and use one user.email for one project while using another
for the other.

Setting $GIT_DIR/.config works, but if the penalty of forgetting to
update $GIT_DIR/.config is high (especially when you end up cloning
often), it may not be the best way to go. Having the settings in
~/.gitconfig, which would work for just one set of repositories, would
not well in such a situation. Having separate ${HOME}s may add more
problems than it solves.

Extend the include.path mechanism that lets a config file include
another config file, so that the inclusion can be done only when some
conditions hold. Then ~/.gitconfig can say "include config-project-A
only when working on project-A" for each project A the user works on.

In this patch, the only supported grouping is based on $GIT_DIR (in
absolute path), so you would need to group repositories by directory, or
something like that to take advantage of it.

We already have include.path for unconditional includes. This patch goes
with includeIf.<condition>.path to make it clearer that a condition is
required. The new config has the same backward compatibility approach as
include.path: older git versions that don't understand includeIf will
simply ignore them.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-11 19:56:16 -08:00
..
howto Merge branch 'po/fix-doc-merge-base-illustration' into maint 2016-10-28 09:01:21 -07:00
RelNotes Git 2.12 2017-02-24 10:49:58 -08:00
technical Merge branch 'sb/in-core-index-doc' 2017-01-31 13:14:59 -08:00
.gitattributes
.gitignore
asciidoc.conf
asciidoctor-extensions.rb Documentation: implement linkgit macro for Asciidoctor 2017-01-31 12:18:18 -08:00
blame-options.txt Merge branch 'bc/blame-doc-fix' 2017-02-24 10:48:08 -08:00
build-docdep.perl
cat-texi.perl Documentation: remove unneeded argument in cat-texi.perl 2017-01-23 10:56:47 -08:00
cmd-list.perl
CodingGuidelines CodingGuidelines: clarify multi-line brace style 2017-01-17 14:32:47 -08:00
config.txt config: add conditional include 2017-03-11 19:56:16 -08:00
date-formats.txt Merge branch 'lr/doc-fix-cet' into maint 2017-01-17 15:19:08 -08:00
diff-config.txt Merge branch 'rh/diff-orderfile-doc' 2017-01-23 15:59:23 -08:00
diff-format.txt
diff-generate-patch.txt
diff-heuristic-options.txt diff: retire "compaction" heuristics 2016-12-23 12:32:22 -08:00
diff-options.txt Merge branch 'rh/diff-orderfile-doc' 2017-01-23 15:59:23 -08:00
docbook-xsl.css
docbook.xsl
everyday.txto
fetch-options.txt
fix-texi.perl
fmt-merge-msg-config.txt
git-add.txt
git-am.txt
git-annotate.txt
git-apply.txt
git-archimport.txt
git-archive.txt
git-bisect-lk2009.txt
git-bisect.txt Merge branch 'ad/bisect-terms' into maint 2017-01-31 13:32:10 -08:00
git-blame.txt
git-branch.txt doc: add note about ignoring '--no-create-reflog' 2017-02-01 15:53:40 -08:00
git-bundle.txt
git-cat-file.txt
git-check-attr.txt
git-check-ignore.txt
git-check-mailmap.txt
git-check-ref-format.txt git-check-ref-format: clarify documentation for --normalize 2017-02-21 13:02:42 -08:00
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt
git-column.txt
git-commit-tree.txt
git-commit.txt Merge branch 'ak/commit-only-allow-empty' into maint 2017-01-17 15:11:03 -08:00
git-config.txt
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-credential.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt Document the --no-gui option in difftool 2017-02-08 13:30:28 -08:00
git-fast-export.txt
git-fast-import.txt
git-fetch-pack.txt upload-pack: optionally allow fetching any sha1 2016-11-18 13:06:14 -08:00
git-fetch.txt Merge branch 'mm/push-social-engineering-attack-doc' into maint 2017-01-17 15:19:10 -08:00
git-filter-branch.txt
git-fmt-merge-msg.txt
git-for-each-ref.txt Merge branch 'jk/trailers-placeholder-in-pretty' 2016-12-19 14:45:34 -08:00
git-format-patch.txt
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 grep: enable recurse-submodules to work on <tree> objects 2016-12-22 11:47:33 -08:00
git-gui.txt doc: git-gui browser does not default to HEAD 2017-01-13 12:23:28 -08:00
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
git-init-db.txt
git-init.txt init: document dotfiles exclusion on template copy 2017-02-17 15:57:21 -08:00
git-instaweb.txt
git-interpret-trailers.txt doc: mention user-configured trailers 2016-11-21 12:49:57 -08:00
git-log.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt merge: add '--continue' option as a synonym for 'git commit' 2016-12-14 10:02:04 -08:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt
git-p4.txt Merge branch 'ls/p4-retry-thrice' 2017-01-18 15:12:12 -08:00
git-pack-objects.txt
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt Merge branch 'mm/push-social-engineering-attack-doc' into maint 2017-01-17 15:19:10 -08:00
git-push.txt Merge branch 'bw/push-submodule-only' 2017-02-10 12:52:23 -08:00
git-quiltimport.txt
git-read-tree.txt
git-rebase.txt Merge branch 'nd/rebase-forget' 2016-12-19 14:45:35 -08:00
git-receive-pack.txt
git-reflog.txt
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txto
git-remote-testgit.txt
git-remote.txt
git-repack.txt
git-replace.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt reset: add an example of how to split a commit into two 2017-02-16 13:38:02 -08:00
git-rev-list.txt
git-rev-parse.txt rev-parse doc: pass "--" to rev-parse in the --prefix example 2017-01-10 13:22:19 -08:00
git-revert.txt
git-rm.txt
git-send-email.txt
git-send-pack.txt
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt shortlog: test and document --committer option 2016-12-16 09:39:10 -08:00
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-stage.txt
git-stash.txt Documentation/stash: remove mention of git reset --hard 2017-02-13 14:20:38 -08:00
git-status.txt
git-stripspace.txt
git-submodule.txt Merge branch 'jk/doc-submodule-markup-fix' 2017-02-15 14:56:40 -08:00
git-svn.txt git-svn: document useLogAuthor and addAuthorFrom config keys 2016-12-12 10:49:50 -08:00
git-symbolic-ref.txt
git-tag.txt Merge branch 'cw/log-updates-for-all-refs-really' 2017-02-03 11:25:19 -08:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
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 builtin/verify-tag: add --format to verify-tag 2017-01-17 16:10:22 -08:00
git-web--browse.txt
git-whatchanged.txt
git-worktree.txt Merge branch 'bc/worktree-doc-fix-detached' 2017-02-24 10:48:10 -08:00
git-write-tree.txt
git.txt Git 2.12 2017-02-24 10:49:58 -08:00
gitattributes.txt docs: warn about possible '=' in clean/smudge filter process values 2016-12-06 11:29:52 -08:00
gitcli.txt
gitcore-tutorial.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
gitcredentials.txt
gitcvs-migration.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
gitdiffcore.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
giteveryday.txt giteveryday: unbreak rendering with AsciiDoctor 2017-01-07 14:03:40 -08:00
gitglossary.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
githooks.txt
gitignore.txt
gitk.txt Merge branch 'sb/remove-gitview' 2017-01-18 15:12:18 -08:00
gitmodules.txt
gitnamespaces.txt doc: mention transfer data leaks in more places 2016-11-14 11:23:07 -08:00
gitremote-helpers.txt Merge branch 'jk/doc-remote-helpers-markup-fix' 2017-02-15 14:56:40 -08:00
gitrepository-layout.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
gitrevisions.txt
gittutorial-2.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
gittutorial.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
gitweb.conf.txt
gitweb.txt
gitworkflows.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
glossary-content.txt
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
line-range-format.txt
lint-gitlink.perl
mailmap.txt
Makefile Merge branch 'bc/use-asciidoctor-opt' 2017-02-02 13:36:57 -08:00
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-options.txt
merge-strategies.txt
pretty-formats.txt pretty: add %(trailers) format for displaying trailers of a commit message 2016-12-11 13:58:41 -08:00
pretty-options.txt
pull-fetch-param.txt
rev-list-options.txt rev-list-options.txt: update --all about HEAD 2017-02-08 13:37:32 -08:00
revisions.txt
sequencer.txt
SubmittingPatches doc: clarify distinction between sign-off and pgp-signing 2017-01-27 13:41:30 -08:00
texi.xsl Documentation: add XSLT to fix DocBook for Texinfo 2017-01-23 10:56:53 -08:00
transfer-data-leaks.txt doc: mention transfer data leaks in more places 2016-11-14 11:23:07 -08:00
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt asciidoctor: fix user-manual to be built by asciidoctor 2017-01-13 10:30:16 -08:00