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

Re: [PATCH] push: Alias pushurl from push rewrites

From
Josh Triplett <josh@joshtriplett.org>
Date
Mar 28, 2013, 16:01 UTC
Message-ID
<20130328160104.GC16034@leaf>
In-Reply-To
<20130327231819.GL28148@google.com>
On Wed, Mar 27, 2013 at 04:18:19PM -0700, Jonathan Nieder wrote:
Show 13 quoted lines
> Josh Triplett wrote:
> 
> >                       I have a .gitconfig in my git-managed home
> > directory which sets pushInsteadOf so that I can clone via git:// and
> > immediately have working push.  I work with a number of systems that
> > don't have inbound access to each other but do have outbound access to
> > the network; on some of these "satellite" boxes, I can't push changes
> > directly to the server pushInsteadOf points to, so I can explicitly set
> > pushurl in .git/config for that repository, which overrides the
> > pushInsteadOf.  This change would break that configuration.
> 
> Would it?  As long as your pushurl does not start with git://, I think
> your configuration would still work fine.

I had to think about it for a while, but I think you're right; I inferred a behavior that the patch didn't actually add or have anything to do with, namely having the result of applying pushInsteadOf to the non-push URL override the pushUrl.

OK, I take it back. I *can* imagine configurations that this change would break, since it does change intentional and documented behavior, but I don't have any such configuration. The only such configuration I can imagine involves directly counting on the non-rewriting of pushUrl, by using pushInsteadOf to rewrite urls and then sometimes using pushUrl to override that and point back at the un-rewritten URL. And while supported, that does seem *odd*.

Objection withdrawn; if nobody can come up with a sensible configuration that relies on the documented behavior, I don't particularly care if it changes.

Show 15 quoted lines
> After this patch, neither pushInsteadOf nor pushUrl overrides the
> other one.  The rule is:
> 
> 	1. First, get the URL from the remote's configuration, based
> 	   on whether you are fetching or pushing.
> 
> 	   (At this step, in your setup git chooses the URL specified
> 	   with pushurl in your .git/config.)
> 	
> 	2. Next, apply the most appropriate url.*.insteadOf or
> 	   url.*.pushInsteadOf rule, based on whether you are fetching
> 	   or pushing.
> 
> 	   (At this step, no rewrite rules apply, so the URL is used
> 	   as is.)
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 24 in “push: Alias pushurl from push rewrites”
  1. push: Alias pushurl from push rewritesRob Hoelz, Mar 27, 2013
  2. Jonathan NiederMar 27, 2013
  3. Jonathan NiederMar 27, 2013
  4. Junio C HamanoMar 27, 2013
  5. Rob HoelzMar 27, 2013
  6. Josh TriplettMar 27, 2013
  7. Josh TriplettMar 27, 2013
  8. Jonathan NiederMar 27, 2013
  9. Junio C HamanoMar 28, 2013
  10. Josh TriplettMar 28, 2013
  11. Junio C HamanoMar 28, 2013
  12. Josh TriplettMar 28, 2013
  13. Junio C HamanoMar 28, 2013
  14. Josh TriplettMar 28, 2013
  15. Junio C HamanoMar 28, 2013
  16. Josh TriplettMar 28, 2013
  17. Jonathan NiederMar 28, 2013
  18. Rob HoelzMar 29, 2013
  19. Junio C HamanoMar 29, 2013
  20. Rob HoelzMar 27, 2013
  21. Jonathan NiederMar 27, 2013
  22. Rob HoelzMar 27, 2013
  23. Jonathan NiederMar 27, 2013
  24. Rob HoelzMar 27, 2013

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.