From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: ps@pks.im
Subject: [PATCH 2/2] push: add '-d' as shorthand for '--delete'
Date: Mon, 14 Dec 2015 16:23:04 +0100 [thread overview]
Message-ID: <1450106584-22313-2-git-send-email-ps@pks.im> (raw)
In-Reply-To: <1450106584-22313-1-git-send-email-ps@pks.im>
It is only possible to delete branches on remotes by specifying
the long '--delete' flag. The `git-branch` command, which can be
used to delete local branches with the same '--delete' flag, also
accepts the shorthand '-d'. This may cause confusion for users
which are frequently using the shorthand form of deleting local
branches and subsequently try to use the same shorthand for
`git-push`, which will fail.
Fix this usability issue by adding the '-d' shorthand to
`git-push` and document it.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
Documentation/git-push.txt | 2 +-
builtin/push.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index e830c08..6f5d98c 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git push' [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
- [--repo=<repository>] [-f | --force] [--delete] [--prune] [-v | --verbose]
+ [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
[-u | --set-upstream]
[--[no-]signed|--sign=(true|false|if-asked)]
[--force-with-lease[=<refname>[:<expect>]]]
diff --git a/builtin/push.c b/builtin/push.c
index 3bda430..093011d 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -540,7 +540,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL),
OPT_BIT( 0 , "mirror", &flags, N_("mirror all refs"),
(TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
- OPT_BOOL( 0, "delete", &deleterefs, N_("delete refs")),
+ OPT_BOOL('d', "delete", &deleterefs, N_("delete refs")),
OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")),
OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
--
2.6.4
next prev parent reply other threads:[~2015-12-14 15:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 15:23 [PATCH 1/2] push: add '--delete' flag to synopsis Patrick Steinhardt
2015-12-14 15:23 ` Patrick Steinhardt [this message]
2015-12-14 19:18 ` [PATCH 2/2] push: add '-d' as shorthand for '--delete' Junio C Hamano
2015-12-15 9:22 ` Patrick Steinhardt
2015-12-14 21:18 ` Jeff King
2015-12-16 20:29 ` Junio C Hamano
2015-12-16 21:52 ` Jeff King
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=1450106584-22313-2-git-send-email-ps@pks.im \
--to=ps@pks.im \
--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).