On Wed, Feb 20, 2008 at 12:23:06AM -0800, Junio C Hamano wrote:I think everything you said here makes perfect sense; changing the push refspec to say "push the current" for a particular remote is much more sensible than an overall default. In fact, I half-expected this to just work without a patch, since "git push origin HEAD" already works. However, we don't treat command line refspecs and config refspecs the same way, which IMHO is a needless inconsistency. How about this: diff --git a/builtin-push.c b/builtin-push.c index 9f727c0..ca90150 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -68,8 +68,7 @@ static int do_push(const char *repo, int flags) if (!refspec && !(flags & TRANSPORT_PUSH_ALL) && remote->push_refspec_nr) { - refspec = remote->push_refspec; - refspec_nr = remote->push_refspec_nr; + set_refspecs(remote->push_refspec, remote->push_refspec_nr); } errs = 0; for (i = 0; i < remote->url_nr; i++) { At which point this now works as you described: git config remote.origin.push HEAD How are you detecting that the remote is a shared repository? By the core.sharedrepository config option? I use several shared repositories, and I never set that variable; instead I use filesystem ACLs (which we could at least detect). It is my understanding that some people even have repositories where multiple users share the same filesystem uid but connect with different ssh keys. I don't think that is even detectable. -Peff - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Jeremy Fitzhardinge | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Michael Grollman | Re: 8169 Intermittent ifup Failure Issue With RTL8102E Chipset in Intel's New D945... |
