git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Alex Riesen <raa.lkml@gmail.com>
Subject: Why doesn't git-fetch obey -c "remote.origin.url" on the command-line?
Date: Fri, 13 Jun 2014 09:37:07 +0200	[thread overview]
Message-ID: <CACBZZX4MyaOKkCvTSKhZtyRMFvpBMiMGz2ix3OxMz_s=P-=p=w@mail.gmail.com> (raw)

On a git built from the master branch just now:

 $ ./git config remote.origin.url
https://code.google.com/p/git-core/
$ ./git -c remote.origin.url=git://git.sourceforge.jp/gitroot/git-core/git.git
config remote.origin.url
git://git.sourceforge.jp/gitroot/git-core/git.git
$ GIT_TRACE=1 ./git -c
remote.origin.url=git://git.sourceforge.jp/gitroot/git-core/git.git
fetch 2>&1 | head -n 2
trace: built-in: git 'fetch'
trace: run_command: 'git-remote-https' 'origin'
'https://code.google.com/p/git-core/'

I'd expect this to try to fetch from the remote.origin.url I specified
on the command-line, but for some reason fetch doesn't pick that up.
Isn't this a bug?

The use case for this is to have a script in cron that does a pull of
repositories via http while the developers expecting to occasionally
use those repositories as work directories should transparently be
able to pull/push from them.

I know about remote.origin.pushurl, but I'd prefer pulls to also be
over ssh in those cases, because then you don't have to worry about
proxy settings (different for the devs & that automated script).

I could fix this, but I thought I'd first send a question about
whether this shouldn't be considered a bug, and I haven't dug into
this yet but I think that configuration passed via the -c option
should *always* override any other config Git may get from elsewhere.

             reply	other threads:[~2014-06-13  7:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13  7:37 Ævar Arnfjörð Bjarmason [this message]
2014-06-13  7:51 ` Why doesn't git-fetch obey -c "remote.origin.url" on the command-line? Jeff King
2014-06-16 12:48   ` Philip Oakley

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='CACBZZX4MyaOKkCvTSKhZtyRMFvpBMiMGz2ix3OxMz_s=P-=p=w@mail.gmail.com' \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.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).