Re: [PATCH] push: Alias pushurl from push rewrites
From: Josh Triplett <josh@joshtriplett.org>
Date: 2016-06-15 22:56:33
On Wed, Mar 27, 2013 at 04:18:19PM -0700, Jonathan Nieder wrote:
Josh Triplett wrote:quoted
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.
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.)