git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
To: <git@vger.kernel.org>
Subject: [PATCHv3 1/2] pull: fix cli and config option parsing order
Date: Wed, 6 Sep 2017 08:48:06 +0200	[thread overview]
Message-ID: <ff1869cf-cee3-bf28-7cb0-ac8821e25887@morey-chaisemartin.com> (raw)
In-Reply-To: <884cd3b0-7eeb-b711-2c7f-f93a57a009ee@morey-chaisemartin.com>

pull parses first the cli options and then the config option.
The expected behavior is the other way around, so that config
options can not override the cli ones.

This patch changes the parsing order so config options are
parsed first.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
---
 builtin/pull.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/pull.c b/builtin/pull.c
index 7fe281414..9ef1ab501 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -815,6 +815,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 	if (!getenv("GIT_REFLOG_ACTION"))
 		set_reflog_message(argc, argv);
 
+	git_config(git_pull_config, NULL);
+
 	argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);
 
 	parse_repo_refspecs(argc, argv, &repo, &refspecs);
@@ -825,8 +827,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 	if (opt_rebase < 0)
 		opt_rebase = config_get_rebase();
 
-	git_config(git_pull_config, NULL);
-
 	if (read_cache_unmerged())
 		die_resolve_conflict("pull");
 
-- 
2.14.1.461.g503560879



  reply	other threads:[~2017-09-06  6:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06  6:46 [PATCHv3 0/2] fix recurse.submodule config for git pull Nicolas Morey-Chaisemartin
2017-09-06  6:48 ` Nicolas Morey-Chaisemartin [this message]
2017-09-06  6:48 ` [PATCHv3 2/2] pull: honor submodule.recurse config option Nicolas Morey-Chaisemartin

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=ff1869cf-cee3-bf28-7cb0-ac8821e25887@morey-chaisemartin.com \
    --to=nicolas@morey-chaisemartin.com \
    --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.
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).