mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
Merge branch 'jk/branch-l-1-repurpose'
Updated plan to repurpose the "-l" option to "git branch". * jk/branch-l-1-repurpose: doc/git-branch: remove obsolete "-l" references branch: make "-l" a synonym for "--list"
This commit is contained in:
commit
7dc341cedb
|
@ -14,7 +14,7 @@ SYNOPSIS
|
||||||
[(--merged | --no-merged) [<commit>]]
|
[(--merged | --no-merged) [<commit>]]
|
||||||
[--contains [<commit]] [--no-contains [<commit>]]
|
[--contains [<commit]] [--no-contains [<commit>]]
|
||||||
[--points-at <object>] [--format=<format>] [<pattern>...]
|
[--points-at <object>] [--format=<format>] [<pattern>...]
|
||||||
'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>]
|
'git branch' [--track | --no-track] [-f] <branchname> [<start-point>]
|
||||||
'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
|
'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
|
||||||
'git branch' --unset-upstream [<branchname>]
|
'git branch' --unset-upstream [<branchname>]
|
||||||
'git branch' (-m | -M) [<oldbranch>] <newbranch>
|
'git branch' (-m | -M) [<oldbranch>] <newbranch>
|
||||||
|
@ -100,8 +100,6 @@ OPTIONS
|
||||||
The negated form `--no-create-reflog` only overrides an earlier
|
The negated form `--no-create-reflog` only overrides an earlier
|
||||||
`--create-reflog`, but currently does not negate the setting of
|
`--create-reflog`, but currently does not negate the setting of
|
||||||
`core.logAllRefUpdates`.
|
`core.logAllRefUpdates`.
|
||||||
+
|
|
||||||
The `-l` option is a deprecated synonym for `--create-reflog`.
|
|
||||||
|
|
||||||
-f::
|
-f::
|
||||||
--force::
|
--force::
|
||||||
|
@ -156,14 +154,11 @@ This option is only applicable in non-verbose mode.
|
||||||
--all::
|
--all::
|
||||||
List both remote-tracking branches and local branches.
|
List both remote-tracking branches and local branches.
|
||||||
|
|
||||||
|
-l::
|
||||||
--list::
|
--list::
|
||||||
List branches. With optional `<pattern>...`, e.g. `git
|
List branches. With optional `<pattern>...`, e.g. `git
|
||||||
branch --list 'maint-*'`, list only the branches that match
|
branch --list 'maint-*'`, list only the branches that match
|
||||||
the pattern(s).
|
the pattern(s).
|
||||||
+
|
|
||||||
This should not be confused with `git branch -l <branchname>`,
|
|
||||||
which creates a branch named `<branchname>` with a reflog.
|
|
||||||
See `--create-reflog` above for details.
|
|
||||||
|
|
||||||
-v::
|
-v::
|
||||||
-vv::
|
-vv::
|
||||||
|
|
|
@ -37,7 +37,6 @@ static const char * const builtin_branch_usage[] = {
|
||||||
|
|
||||||
static const char *head;
|
static const char *head;
|
||||||
static struct object_id head_oid;
|
static struct object_id head_oid;
|
||||||
static int used_deprecated_reflog_option;
|
|
||||||
|
|
||||||
static int branch_use_color = -1;
|
static int branch_use_color = -1;
|
||||||
static char branch_colors[][COLOR_MAXLEN] = {
|
static char branch_colors[][COLOR_MAXLEN] = {
|
||||||
|
@ -578,14 +577,6 @@ static int edit_branch_description(const char *branch_name)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int deprecated_reflog_option_cb(const struct option *opt,
|
|
||||||
const char *arg, int unset)
|
|
||||||
{
|
|
||||||
used_deprecated_reflog_option = 1;
|
|
||||||
*(int *)opt->value = !unset;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cmd_branch(int argc, const char **argv, const char *prefix)
|
int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
int delete = 0, rename = 0, copy = 0, force = 0, list = 0;
|
int delete = 0, rename = 0, copy = 0, force = 0, list = 0;
|
||||||
|
@ -627,14 +618,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||||
OPT_BIT('M', NULL, &rename, N_("move/rename a branch, even if target exists"), 2),
|
OPT_BIT('M', NULL, &rename, N_("move/rename a branch, even if target exists"), 2),
|
||||||
OPT_BIT('c', "copy", ©, N_("copy a branch and its reflog"), 1),
|
OPT_BIT('c', "copy", ©, N_("copy a branch and its reflog"), 1),
|
||||||
OPT_BIT('C', NULL, ©, N_("copy a branch, even if target exists"), 2),
|
OPT_BIT('C', NULL, ©, N_("copy a branch, even if target exists"), 2),
|
||||||
OPT_BOOL(0, "list", &list, N_("list branch names")),
|
OPT_BOOL('l', "list", &list, N_("list branch names")),
|
||||||
OPT_BOOL(0, "create-reflog", &reflog, N_("create the branch's reflog")),
|
OPT_BOOL(0, "create-reflog", &reflog, N_("create the branch's reflog")),
|
||||||
{
|
|
||||||
OPTION_CALLBACK, 'l', NULL, &reflog, NULL,
|
|
||||||
N_("deprecated synonym for --create-reflog"),
|
|
||||||
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN,
|
|
||||||
deprecated_reflog_option_cb
|
|
||||||
},
|
|
||||||
OPT_BOOL(0, "edit-description", &edit_description,
|
OPT_BOOL(0, "edit-description", &edit_description,
|
||||||
N_("edit the description for the branch")),
|
N_("edit the description for the branch")),
|
||||||
OPT__FORCE(&force, N_("force creation, move/rename, deletion"), PARSE_OPT_NOCOMPLETE),
|
OPT__FORCE(&force, N_("force creation, move/rename, deletion"), PARSE_OPT_NOCOMPLETE),
|
||||||
|
@ -707,11 +692,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||||
if (list)
|
if (list)
|
||||||
setup_auto_pager("branch", 1);
|
setup_auto_pager("branch", 1);
|
||||||
|
|
||||||
if (used_deprecated_reflog_option && !list) {
|
|
||||||
warning("the '-l' alias for '--create-reflog' is deprecated;");
|
|
||||||
warning("it will be removed in a future version of Git");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (delete) {
|
if (delete) {
|
||||||
if (!argc)
|
if (!argc)
|
||||||
die(_("branch name required"));
|
die(_("branch name required"));
|
||||||
|
|
Loading…
Reference in a new issue