From: Jeff King <peff@peff.net>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Thomas Gummerer <t.gummerer@gmail.com>,
Andrew Arnott <Andrew.Arnott@microsoft.com>
Subject: Re: [PATCH 2/2] Be more careful when determining whether a remote was configured
Date: Tue, 17 Jan 2017 16:47:23 -0500 [thread overview]
Message-ID: <20170117214723.p5rni6wwggei366j@sigill.intra.peff.net> (raw)
In-Reply-To: <41c347f22c80e96c54db34baa739b6e37e268b61.1484687919.git.johannes.schindelin@gmx.de>
On Tue, Jan 17, 2017 at 10:19:24PM +0100, Johannes Schindelin wrote:
> One of the really nice features of the ~/.gitconfig file is that users
> can override defaults by their own preferred settings for all of their
> repositories.
>
> One such default that some users like to override is whether the
> "origin" remote gets auto-pruned or not. The user would simply call
>
> git config --global remote.origin.prune true
>
> and from now on all "origin" remotes would be pruned automatically when
> fetching into the local repository.
>
> There is just one catch: now Git thinks that the "origin" remote is
> configured, as it does not discern between having a remote whose
> fetch (and/or push) URL and refspec is set, and merely having
> preemptively-configured, global flags for specific remotes.
>
> Let's fix this by telling Git that a remote is not configured unless any
> fetch/push URL or refspect is configured explicitly.
Hmm. Old versions of GitHub for Windows used to set fetch refspecs in
the system gitconfig, for a similar purpose to what you want to do with
remote.origin.prune.
I notice here that setting a refspec _does_ define a remote. Is there a
reason you drew the line there, and not at, say, whether it has a URL?
-Peff
next prev parent reply other threads:[~2017-01-17 21:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 21:18 [PATCH 0/2] Fix remote_is_configured() Johannes Schindelin
2017-01-17 21:19 ` [PATCH 1/2] remote rename: demonstrate a bogus "remote exists" bug Johannes Schindelin
2017-01-17 21:19 ` [PATCH 2/2] Be more careful when determining whether a remote was configured Johannes Schindelin
2017-01-17 21:47 ` Jeff King [this message]
2017-01-17 22:19 ` Junio C Hamano
2017-01-18 12:38 ` Johannes Schindelin
2017-01-18 12:34 ` Johannes Schindelin
2017-01-18 12:54 ` Jeff King
2017-01-18 16:22 ` Johannes Schindelin
2017-01-19 18:27 ` Jeff King
2017-01-19 20:12 ` Junio C Hamano
2017-01-19 20:22 ` Jeff King
2017-01-19 21:19 ` Johannes Schindelin
2017-01-17 21:45 ` [PATCH 0/2] Fix remote_is_configured() Jeff King
2017-01-19 21:19 ` [PATCH v2 " Johannes Schindelin
2017-01-19 21:19 ` [PATCH v2 1/2] remote rename: demonstrate a bogus "remote exists" bug Johannes Schindelin
2017-01-19 21:20 ` [PATCH v2 2/2] Be more careful when determining whether a remote was configured Johannes Schindelin
2017-01-19 21:31 ` Jeff King
2017-01-19 21:44 ` Johannes Schindelin
2017-01-19 21:45 ` Junio C Hamano
2017-01-19 21:50 ` Jeff King
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=20170117214723.p5rni6wwggei366j@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Andrew.Arnott@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=t.gummerer@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).