Skip to content

Commit

Permalink
git-branch: introduce missing long forms for the options
Browse files Browse the repository at this point in the history
Long forms are better to memorize and more reliably uniform across
commands.

Names follow precedents, e.g. "git log --remotes".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Aug 29, 2011
1 parent c97eff5 commit 171edcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Documentation/git-branch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ way to clean up all obsolete remote-tracking branches.
OPTIONS
-------
-d::
--delete::
Delete a branch. The branch must be fully merged in its
upstream branch, or in `HEAD` if no upstream was set with
`--track` or `--set-upstream`.
Expand All @@ -72,6 +73,7 @@ OPTIONS
Delete a branch irrespective of its merged status.

-l::
--create-reflog::
Create the branch's reflog. This activates recording of
all changes made to the branch ref, enabling use of date
based sha1 expressions such as "<branchname>@\{yesterday}".
Expand All @@ -84,6 +86,7 @@ OPTIONS
already. Without `-f` 'git branch' refuses to change an existing branch.

-m::
--move::
Move/rename a branch and the corresponding reflog.

-M::
Expand All @@ -100,9 +103,11 @@ OPTIONS
Same as `--color=never`.

-r::
--remotes::
List or delete (if used with -d) the remote-tracking branches.

-a::
--all::
List both remote-tracking branches and local branches.

-v::
Expand Down
10 changes: 5 additions & 5 deletions builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
OPT_SET_INT( 0, "set-upstream", &track, "change upstream info",
BRANCH_TRACK_OVERRIDE),
OPT__COLOR(&branch_use_color, "use colored output"),
OPT_SET_INT('r', NULL, &kinds, "act on remote-tracking branches",
OPT_SET_INT('r', "remotes", &kinds, "act on remote-tracking branches",
REF_REMOTE_BRANCH),
{
OPTION_CALLBACK, 0, "contains", &with_commit, "commit",
Expand All @@ -645,13 +645,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
OPT__ABBREV(&abbrev),

OPT_GROUP("Specific git-branch actions:"),
OPT_SET_INT('a', NULL, &kinds, "list both remote-tracking and local branches",
OPT_SET_INT('a', "all", &kinds, "list both remote-tracking and local branches",
REF_REMOTE_BRANCH | REF_LOCAL_BRANCH),
OPT_BIT('d', NULL, &delete, "delete fully merged branch", 1),
OPT_BIT('d', "delete", &delete, "delete fully merged branch", 1),
OPT_BIT('D', NULL, &delete, "delete branch (even if not merged)", 2),
OPT_BIT('m', NULL, &rename, "move/rename a branch and its reflog", 1),
OPT_BIT('m', "move", &rename, "move/rename a branch and its reflog", 1),
OPT_BIT('M', NULL, &rename, "move/rename a branch, even if target exists", 2),
OPT_BOOLEAN('l', NULL, &reflog, "create the branch's reflog"),
OPT_BOOLEAN('l', "create-reflog", &reflog, "create the branch's reflog"),
OPT__FORCE(&force_create, "force creation (when already exists)"),
{
OPTION_CALLBACK, 0, "no-merged", &merge_filter_ref,
Expand Down

0 comments on commit 171edcb

Please sign in to comment.