From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nelson Elhage Subject: [PATCH v2] git-push: Accept -n as a synonym for --dry-run. Date: Sun, 13 Sep 2009 12:56:45 -0400 Message-ID: <1252861005-20220-1-git-send-email-nelhage@mit.edu> Cc: Nelson Elhage To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Sep 13 19:04:58 2009 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmsVV-0004FW-ON for gcvg-git-2@lo.gmane.org; Sun, 13 Sep 2009 19:04:58 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754886AbZIMREt (ORCPT ); Sun, 13 Sep 2009 13:04:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751847AbZIMREs (ORCPT ); Sun, 13 Sep 2009 13:04:48 -0400 Received: from BISCAYNE-ONE-STATION.MIT.EDU ([18.7.7.80]:62824 "EHLO biscayne-one-station.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250AbZIMREs (ORCPT ); Sun, 13 Sep 2009 13:04:48 -0400 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id n8DH4nRv012499; Sun, 13 Sep 2009 13:04:49 -0400 (EDT) Received: from PHANATIQUE.MIT.EDU (c-71-192-160-118.hsd1.nh.comcast.net [71.192.160.118]) (authenticated bits=0) (User authenticated as nelhage@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id n8DH4mIH016526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 13 Sep 2009 13:04:49 -0400 (EDT) X-Mailer: git-send-email 1.6.3.1.499.ge7b8da X-Scanned-By: MIMEDefang 2.42 X-Spam-Flag: NO X-Spam-Score: 0.00 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 --- Documentation/git-push.txt | 3 ++- builtin-push.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 58d2bd5..ba6a8a2 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -9,7 +9,7 @@ git-push - Update remote refs along with associated objects SYNOPSIS -------- [verse] -'git push' [--all | --mirror | --tags] [--dry-run] [--receive-pack=] +'git push' [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=] [--repo=] [-f | --force] [-v | --verbose] [ ...] @@ -82,6 +82,7 @@ nor in any Push line of the corresponding remotes file---see below). if the configuration option `remote..mirror` is set. +-n:: --dry-run:: Do everything except actually send the updates. diff --git a/builtin-push.c b/builtin-push.c index 787011f..5e5f3ad 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -10,7 +10,7 @@ #include "parse-options.h" static const char * const push_usage[] = { - "git push [--all | --mirror] [--dry-run] [--porcelain] [--tags] [--receive-pack=] [--repo=] [-f | --force] [-v] [ ...]", + "git push [--all | --mirror] [-n | --dry-run] [--porcelain] [--tags] [--receive-pack=] [--repo=] [-f | --force] [-v] [ ...]", NULL, }; @@ -182,7 +182,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT( 0 , "mirror", &flags, "mirror all refs", (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)), OPT_BOOLEAN( 0 , "tags", &tags, "push tags"), - OPT_BIT( 0 , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN), + OPT_BIT('n' , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN), OPT_BIT( 0, "porcelain", &flags, "machine-readable output", TRANSPORT_PUSH_PORCELAIN), OPT_BIT('f', "force", &flags, "force updates", TRANSPORT_PUSH_FORCE), OPT_BOOLEAN( 0 , "thin", &thin, "use thin pack"), -- 1.6.3.1.499.ge7b8da