diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-04-06 00:43:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-06 00:43:44 -0700 |
commit | fbdc05661d9b732d06c47ccb3d5836d0d1b563e5 (patch) | |
tree | b5e7e00ca449758d6244a382a27e9b967286787a /Documentation | |
parent | 03a39a91842cf745e5fc27dbd6485aad44d839a4 (diff) | |
parent | 3e262b95c50991de12cc5e180b72256561606a19 (diff) | |
download | git-fbdc05661d9b732d06c47ccb3d5836d0d1b563e5.tar.gz git-fbdc05661d9b732d06c47ccb3d5836d0d1b563e5.tar.xz |
Merge branch 'jc/name-branch'
* jc/name-branch:
Don't permit ref/branch names to end with ".lock"
check_ref_format(): tighten refname rules
strbuf_check_branch_ref(): a helper to check a refname for a branch
Fix branch -m @{-1} newname
check-ref-format --branch: give Porcelain a way to grok branch shorthand
strbuf_branchname(): a wrapper for branch name shorthands
Rename interpret/substitute nth_last_branch functions
Conflicts:
Documentation/git-check-ref-format.txt
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-check-ref-format.txt | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt index 171b68377..c1ce26884 100644 --- a/Documentation/git-check-ref-format.txt +++ b/Documentation/git-check-ref-format.txt @@ -7,7 +7,9 @@ git-check-ref-format - Ensures that a reference name is well formed SYNOPSIS -------- +[verse] 'git check-ref-format' <refname> +'git check-ref-format' [--branch] <branchname-shorthand> DESCRIPTION ----------- @@ -30,7 +32,11 @@ imposes the following rules on how references are named: caret `{caret}`, colon `:`, question-mark `?`, asterisk `*`, or open bracket `[` anywhere. -. They cannot end with a slash `/`. +. They cannot end with a slash `/` nor a dot `.`. + +. They cannot end with the sequence `.lock`. + +. They cannot contain a sequence `@{`. These rules make it easy for shell script based tools to parse reference names, pathname expansion by the shell when a reference name is used @@ -49,6 +55,18 @@ reference name expressions (see linkgit:git-rev-parse[1]): It may also be used to select a specific object such as with 'git-cat-file': "git cat-file blob v1.3.3:refs.c". +. at-open-brace `@{` is used as a notation to access a reflog entry. + +With the `--branch` option, it expands a branch name shorthand and +prints the name of the branch the shorthand refers to. + +EXAMPLE +------- + +git check-ref-format --branch @{-1}:: + +Print the name of the previous branch. + GIT --- |