From: "Carlos Martín Nieto" <cmn@elego.de>
To: git@vger.kernel.org
Subject: [PATCH] branch: add -u as a shortcut for --set-upstream
Date: Thu, 5 Jul 2012 09:57:15 +0200 [thread overview]
Message-ID: <1341475035-14310-1-git-send-email-cmn@elego.de> (raw)
Add this shortcut just like git-push has it.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
I've seen threads commenting how it's odd that this doesn't exist[0],
but nobody seems to have done anything about it yet.
This may need some updates to the shell completions, but I've no idea
how those work and I'd rather not change things randomly.
[0] see e.g. http://thread.gmane.org/gmane.comp.version-control.git/165794/focus=165856
Documentation/git-branch.txt | 1 +
builtin/branch.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 47235be..447325f 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -167,6 +167,7 @@ start-point is either a local or remote-tracking branch.
Do not set up "upstream" configuration, even if the
branch.autosetupmerge configuration variable is true.
+-u::
--set-upstream::
If specified branch does not exist yet or if `--force` has been
given, acts exactly like `--track`. Otherwise sets up configuration
diff --git a/builtin/branch.c b/builtin/branch.c
index 0e060f2..9f2bb6f 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -724,7 +724,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
OPT__QUIET(&quiet, "suppress informational messages"),
OPT_SET_INT('t', "track", &track, "set up tracking mode (see git-pull(1))",
BRANCH_TRACK_EXPLICIT),
- OPT_SET_INT( 0, "set-upstream", &track, "change upstream info",
+ OPT_SET_INT('u', "set-upstream", &track, "change upstream info",
BRANCH_TRACK_OVERRIDE),
OPT__COLOR(&branch_use_color, "use colored output"),
OPT_SET_INT('r', "remotes", &kinds, "act on remote-tracking branches",
--
1.7.11.1.104.ge7b44f1
next reply other threads:[~2012-07-05 7:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 7:57 Carlos Martín Nieto [this message]
2012-07-06 15:32 ` [PATCH] branch: add -u as a shortcut for --set-upstream Jonathan Nieder
2012-07-08 5:48 ` Carlos Martín Nieto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341475035-14310-1-git-send-email-cmn@elego.de \
--to=cmn@elego.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).