git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] Fix remote_is_configured()

From
Jeff King <peff@peff.net>
Date
Jan 17, 2017, 21:45 UTC
Message-ID
<20170117214504.y7fnpkgnugbtdxpz@sigill.intra.peff.net>
In-Reply-To
<cover.1484687919.git.johannes.schindelin@gmx.de>
On Tue, Jan 17, 2017 at 10:18:58PM +0100, Johannes Schindelin wrote:
Show 10 quoted lines
> A surprising behavior triggered the bug report in
> https://github.com/git-for-windows/git/issues/888: the mere existence of
> the config setting "remote.origin.prune" (in this instance, configured
> via ~/.gitconfig so that it applies to all repositories) fooled `git
> remote rename <source> <target>` into believing that the <target> remote
> is already there.
> 
> This patch pair demonstrates the problem, and then fixes it (along with
> potential similar problems, such as setting an HTTP proxy for remotes of
> a given name via ~/.gitconfig).

I thought it was intentional that any config "created" the remote, even without a url field. E.g., you can set:

  [remote "https://example.com/foo/git"]
  proxy = localhost:1234
and then a bare "git fetch https://example.com/foo/git" will respect it.

I admit that "prune" is probably useless without a fetch refspec, though.

Note that I don't disagree that the rule "it's not a remote unless it has a url" would be a lot saner. But I have a feeling you may be breaking some existing setups.

I grepped around in the list but I couldn't find any relevant discussion. So maybe I just dreamed it.

-Peff
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 14 of 21 in “Fix remote_is_configured()”
  1. 0/2 Fix remote_is_configured()Johannes Schindelin, Jan 17, 2017
  2. 1/2 remote rename: demonstrate a bogus "remote exists" bugJohannes Schindelin, Jan 17, 2017
  3. 2/2 Be more careful when determining whether a remote was configuredJohannes Schindelin, Jan 17, 2017
  4. Jeff KingJan 17, 2017
  5. Junio C HamanoJan 17, 2017
  6. Johannes SchindelinJan 18, 2017
  7. Johannes SchindelinJan 18, 2017
  8. Jeff KingJan 18, 2017
  9. Johannes SchindelinJan 18, 2017
  10. Jeff KingJan 19, 2017
  11. Junio C HamanoJan 19, 2017
  12. Jeff KingJan 19, 2017
  13. Johannes SchindelinJan 19, 2017
  14. Jeff KingJan 17, 2017
  15. 0/2 Fix remote_is_configured()Johannes Schindelin, Jan 19, 2017
  16. 1/2 remote rename: demonstrate a bogus "remote exists" bugJohannes Schindelin, Jan 19, 2017
  17. 2/2 Be more careful when determining whether a remote was configuredJohannes Schindelin, Jan 19, 2017
  18. Jeff KingJan 19, 2017
  19. Johannes SchindelinJan 19, 2017
  20. Junio C HamanoJan 19, 2017
  21. Jeff KingJan 19, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.