* [PATCH] git-push: allow -f as an alias for --force
2006-08-02 8:33 git-push and -f option Aneesh Kumar
@ 2006-08-02 15:28 ` Jeff King
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2006-08-02 15:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, Aneesh Kumar
This was already documented in the options section of the manpage. This
patch implements it, adds it to the usage message, and mentions it at the
top of the manpage.
Signed-off-by: Jeff King <peff@peff.net>
---
On Wed, Aug 02, 2006 at 02:03:12PM +0530, Aneesh Kumar wrote:
> The man page says -f is same as --force. But the script doesn't seems
> to handle this.
Documentation/git-push.txt | 2 +-
builtin-push.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 56afd64..d4ae99f 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -8,7 +8,7 @@ git-push - Update remote refs along with
SYNOPSIS
--------
-'git-push' [--all] [--tags] [--force] <repository> <refspec>...
+'git-push' [--all] [--tags] [-f | --force] <repository> <refspec>...
DESCRIPTION
-----------
diff --git a/builtin-push.c b/builtin-push.c
index a824171..c39dd1e 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -8,7 +8,7 @@ #include "builtin.h"
#define MAX_URI (16)
-static const char push_usage[] = "git push [--all] [--tags] [--force] <repository> [<refspec>...]";
+static const char push_usage[] = "git push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
static int all = 0, tags = 0, force = 0, thin = 1;
static const char *execute = NULL;
@@ -291,7 +291,7 @@ int cmd_push(int argc, const char **argv
tags = 1;
continue;
}
- if (!strcmp(arg, "--force")) {
+ if (!strcmp(arg, "--force") || !strcmp(arg, "-f")) {
force = 1;
continue;
}
--
1.4.2.rc2.g822a-dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread