diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-10 01:25:41 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-10 01:25:41 +0300 |
commit | 3707986b7b9921751aee0e8339914a8c24d81ed0 (patch) | |
tree | 583d4271fe07e80a1a690152ffa3d901243f205f /Documentation | |
parent | 88f95e49afe2684da7e8074d7782eba396604bdb (diff) | |
parent | 07b2c0eacac91c8db1a371667ed621cff443cf0d (diff) |
Merge branch 'dl/includeif-onbranch'
The conditional inclusion mechanism learned to base the choice on
the branch the HEAD currently is on.
* dl/includeif-onbranch:
config: learn the "onbranch:" includeIf condition
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 7e2a6f61f5..e3f5bc3396 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -144,6 +144,20 @@ refer to linkgit:gitignore[5] for details. For convenience: This is the same as `gitdir` except that matching is done case-insensitively (e.g. on case-insensitive file sytems) +`onbranch`:: + The data that follows the keyword `onbranch:` is taken to be a + pattern with standard globbing wildcards and two additional + ones, `**/` and `/**`, that can match multiple path components. + If we are in a worktree where the name of the branch that is + currently checked out matches the pattern, the include condition + is met. ++ +If the pattern ends with `/`, `**` will be automatically added. For +example, the pattern `foo/` becomes `foo/**`. In other words, it matches +all branches that begin with `foo/`. This is useful if your branches are +organized hierarchically and you would like to apply a configuration to +all the branches in that hierarchy. + A few more notes on matching via `gitdir` and `gitdir/i`: * Symlinks in `$GIT_DIR` are not resolved before matching. @@ -206,6 +220,11 @@ Example [includeIf "gitdir:/path/to/group/"] path = foo.inc + ; include only if we are in a worktree where foo-branch is + ; currently checked out + [includeIf "onbranch:foo-branch"] + path = foo.inc + Values ~~~~~~ |