Skip to content

Clean up interpret_nth_last_branch feature

Junio C Hamano git 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 3 repliesIn review
  2. v17 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Rename interpret/substitute nth_last_branch functionsbranch.c builtin-branch.c builtin-checkout.c +3 more+11 -110 replies
2/7strbuf_branchname(): a wrapper for branch name shorthandsbranch.c builtin-branch.c builtin-checkout.c +3 more+18 -220 replies
3/7check-ref-format --branch: give Porcelain a way to grok branch shorthandDocumentation/git-check-ref-format.txt builtin-check-ref-format.c+22 -00 replies
4/7Fix branch -m @{-1} newnamebuiltin-branch.c+7 -70 replies
5/7strbuf_check_branch_ref(): a helper to check a refname for a branchbranch.c builtin-branch.c builtin-check-ref-format.c +3 more+17 -170 replies
6/7check_ref_format(): tighten refname rulesDocumentation/git-check-ref-format.txt builtin-branch.c refs.c+28 -72 replies
7/7checkout -: make "-" to mean "previous branch" everywherebuiltin-checkout.c refs.c sha1_name.c+21 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/7] Clean up interpret_nth_last_branch feature

The changes since the previous round are:

- Tightening of the refname rule comes very late in the series, so that we can optionally drop it;

- In addition to allowing "git branch -d bad@{name}ref.", we also allow "git branch -d bad@{name}ref. good-one" as another escape hatch;

- Update documentation to git-check-ref-format to describe the tightened rules.

Junio C Hamano (7):
Rename interpret/substitute nth_last_branch functions strbuf_branchname(): a wrapper for branch name shorthands check-ref-format --branch: give Porcelain a way to grok branch
shorthand
Fix branch -m @{-1} newname
strbuf_check_branch_ref(): a helper to check a refname for a branch check_ref_format(): tighten refname rules
checkout -: make "-" to mean "previous branch" everywhere

 Documentation/git-check-ref-format.txt |   18 ++++++++++++++++-
 branch.c                               |   10 +--------
 builtin-branch.c                       |   32 +++++++++++++++++-------------
 builtin-check-ref-format.c             |    9 ++++++++
 builtin-checkout.c                     |   26 ++++++++++--------------
 builtin-merge.c                        |    5 +--
 cache.h                                |    2 +-
 refs.c                                 |   16 +++++++++++---
 sha1_name.c                            |   33 ++++++++++++++++++-------------
 strbuf.c                               |   17 ++++++++++++++++
 strbuf.h                               |    3 ++
 11 files changed, 110 insertions(+), 61 deletions(-)