git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: git@jeffhostetler, Junio C Hamano <gitster@pobox.com>,
	Derrick Stolee <dstolee@microsoft.com>
Subject: [PATCH 3/3] pull: add --[no-]show-forced-updates passthrough
Date: Tue, 18 Jun 2019 13:25:28 -0700 (PDT)	[thread overview]
Message-ID: <c9479caf4c6aa099bd49ddb4153051f449feab4c.1560889525.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.273.git.gitgitgadget@gmail.com>

From: Derrick Stolee <dstolee@microsoft.com>

The 'git fetch' command can avoid calculating forced updates, so
allow users of 'git pull' to provide that option. This is particularly
necessary when the advice to use '--no-show-forced-updates' is given
at the end of the command.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 builtin/pull.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/builtin/pull.c b/builtin/pull.c
index 9dd32a115b..f1eaf6e6ed 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -128,6 +128,7 @@ static char *opt_update_shallow;
 static char *opt_refmap;
 static char *opt_ipv4;
 static char *opt_ipv6;
+static int opt_show_forced_updates = -1;
 
 static struct option pull_options[] = {
 	/* Shared options */
@@ -240,6 +241,8 @@ static struct option pull_options[] = {
 	OPT_PASSTHRU('6',  "ipv6", &opt_ipv6, NULL,
 		N_("use IPv6 addresses only"),
 		PARSE_OPT_NOARG),
+	OPT_BOOL(0, "show-forced-updates", &opt_show_forced_updates,
+		 N_("check for forced-updates on all updated branches")),
 
 	OPT_END()
 };
@@ -549,6 +552,10 @@ static int run_fetch(const char *repo, const char **refspecs)
 		argv_array_push(&args, opt_ipv4);
 	if (opt_ipv6)
 		argv_array_push(&args, opt_ipv6);
+	if (opt_show_forced_updates > 0)
+		argv_array_push(&args, "--show-forced-updates");
+	else if (opt_show_forced_updates == 0)
+		argv_array_push(&args, "--no-show-forced-updates");
 
 	if (repo) {
 		argv_array_push(&args, repo);
-- 
gitgitgadget

      parent reply	other threads:[~2019-06-18 20:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 20:25 [PATCH 0/3] fetch: add --[no-]show-forced-updates Derrick Stolee via GitGitGadget
2019-06-18 20:25 ` [PATCH 1/3] fetch: add --[no-]show-forced-updates argument Derrick Stolee via GitGitGadget
2019-07-30 21:29   ` [PATCH] t5510-fetch: fix negated 'test_i18ngrep' invocation SZEDER Gábor
2019-07-30 21:40     ` SZEDER Gábor
2019-07-31 10:35       ` Derrick Stolee
2019-08-01 15:53       ` [PATCH 0/3] tests: run non-httpd-specific tests before sourcing 'lib-httpd.sh' SZEDER Gábor
2019-08-01 15:53         ` [PATCH 1/3] t5510-fetch: run non-httpd-specific test " SZEDER Gábor
2019-08-01 17:51           ` Derrick Stolee
2019-08-01 15:53         ` [PATCH 2/3] t5703: run all non-httpd-specific tests " SZEDER Gábor
2019-08-01 15:53         ` [PATCH 3/3] tests: warn against appending non-httpd-specific tests at the end SZEDER Gábor
2019-08-01 17:41           ` SZEDER Gábor
2019-08-01 18:18             ` Junio C Hamano
2019-08-02 10:09               ` SZEDER Gábor
2019-08-02 16:37                 ` Junio C Hamano
2019-06-18 20:25 ` [PATCH 2/3] fetch: warn about forced updates in branch listing Derrick Stolee via GitGitGadget
2019-06-18 20:25 ` Derrick Stolee via GitGitGadget [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9479caf4c6aa099bd49ddb4153051f449feab4c.1560889525.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@jeffhostetler \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).