git-push: Accept -n as a synonym for --dry-run.
git-push is not currently using -n for anything else, and it seems unlikely we will want to use it to mean anything else in the future, so add it as an alias for convenience. Signed-off-by: Nelson Elhage <nelhage@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nelson Elhage committed
Sep 13, 2009 at 12:56 UTC
9f67fee2f0190e0b10e73862cbb88a3f7216f619
2 files changed
+4
-3
Documentation/git-push.txt
+2
-1
@@ -9,7 +9,7 @@ git-push - Update remote refs along with associated objects
9
SYNOPSIS
10
--------
11
[verse]
12
-'git push' [--all | --mirror | --tags] [--dry-run] [--receive-pack=<git-receive-pack>]
12
+'git push' [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
13
[--repo=<repository>] [-f | --force] [-v | --verbose]
14
[<repository> <refspec>...]
15
@@ -82,6 +82,7 @@ nor in any Push line of the corresponding remotes file---see below).
82
if the configuration option `remote.<remote>.mirror` is
83
set.
84
85
+-n::
86
--dry-run::
87
Do everything except actually send the updates.
88
builtin-push.c
+2
-2
@@ -10,7 +10,7 @@
10
#include "parse-options.h"
11
12
static const char * const push_usage[] = {
13
- "git push [--all | --mirror] [--dry-run] [--porcelain] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
13
+ "git push [--all | --mirror] [-n | --dry-run] [--porcelain] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
14
NULL,
15
};
16
@@ -182,7 +182,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
182
OPT_BIT( 0 , "mirror", &flags, "mirror all refs",
183
(TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
184
OPT_BOOLEAN( 0 , "tags", &tags, "push tags"),
185
- OPT_BIT( 0 , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN),
185
+ OPT_BIT('n' , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN),
186
OPT_BIT( 0, "porcelain", &flags, "machine-readable output", TRANSPORT_PUSH_PORCELAIN),
187
OPT_BIT('f', "force", &flags, "force updates", TRANSPORT_PUSH_FORCE),
188
OPT_BOOLEAN( 0 , "thin", &thin, "use thin pack"),