aboutsummaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-06 14:24:28 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-06 14:24:28 +0900
commit5a74ce22e61ce0c8d7325b891ef1a926cf4f6154 (patch)
tree7c4c6d967be2268e7163e861f44c493642af42a8 /Documentation
parentf113d4bc799d4d0b751761db7d3760fcb9ba2c1a (diff)
parent89dd32aedcb52a77240f3923a687edc8a61662e7 (diff)
downloadgit-5a74ce22e61ce0c8d7325b891ef1a926cf4f6154.tar.gz
git-5a74ce22e61ce0c8d7325b891ef1a926cf4f6154.tar.xz
Merge branch 'jc/check-ref-format-oor'
"git check-ref-format --branch @{-1}" bit a "BUG()" when run outside a repository for obvious reasons; clarify the documentation and make sure we do not even try to expand the at-mark magic in such a case, but still call the validation logic for branch names. * jc/check-ref-format-oor: check-ref-format doc: --branch validates and expands <branch> check-ref-format --branch: strip refs/heads/ using skip_prefix check-ref-format --branch: do not expand @{...} outside repository
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-check-ref-format.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt
index 92777cef2..cf0a0b7df 100644
--- a/Documentation/git-check-ref-format.txt
+++ b/Documentation/git-check-ref-format.txt
@@ -77,7 +77,14 @@ reference name expressions (see linkgit:gitrevisions[7]):
. at-open-brace `@{` is used as a notation to access a reflog entry.
-With the `--branch` option, it expands the ``previous branch syntax''
+With the `--branch` option, the command takes a name and checks if
+it can be used as a valid branch name (e.g. when creating a new
+branch). The rule `git check-ref-format --branch $name` implements
+may be stricter than what `git check-ref-format refs/heads/$name`
+says (e.g. a dash may appear at the beginning of a ref component,
+but it is explicitly forbidden at the beginning of a branch name).
+When run with `--branch` option in a repository, the input is first
+expanded for the ``previous branch syntax''
`@{-n}`. For example, `@{-1}` is a way to refer the last branch you
were on. This option should be used by porcelains to accept this
syntax anywhere a branch name is expected, so they can act as if you