Re: Minor annoyance with git push

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: Johannes Schindelin <Johannes.Schindelin@...>, Steffen Prohaska <prohaska@...>, Martin Langhoff <martin.langhoff@...>, Git Mailing List <git@...>
Date: Wednesday, February 20, 2008 - 10:03 am

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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Minor annoyance with git push, Martin Langhoff, (Fri Feb 8, 12:44 am)
Re: Minor annoyance with git push, Jeff King, (Fri Feb 8, 11:00 pm)
Re: Minor annoyance with git push, Steffen Prohaska, (Sat Feb 9, 6:53 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sat Feb 9, 9:10 am)
Re: Minor annoyance with git push, Junio C Hamano, (Sat Feb 9, 10:07 pm)
Re: Minor annoyance with git push, Johannes Schindelin, (Sat Feb 9, 10:15 pm)
Re: Minor annoyance with git push, Wincent Colaiuta, (Sun Feb 10, 10:03 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sun Feb 10, 12:26 pm)
Re: Minor annoyance with git push, Wincent Colaiuta, (Sun Feb 10, 2:18 pm)
Re: Minor annoyance with git push, Jeff King, (Sun Feb 10, 6:34 pm)
Re: Minor annoyance with git push, Junio C Hamano, (Sun Feb 10, 6:59 pm)
Re: Minor annoyance with git push, Jeff King, (Sun Feb 10, 7:29 pm)
Re: Minor annoyance with git push, Steven Walter, (Sun Feb 10, 11:02 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sun Feb 10, 12:29 pm)
Re: Minor annoyance with git push, Jeff King, (Sun Feb 10, 6:17 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sun Feb 10, 8:20 am)
Re: Minor annoyance with git push, Jeff King, (Sun Feb 10, 8:23 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sun Feb 10, 9:04 am)
Re: Minor annoyance with git push, Junio C Hamano, (Wed Feb 20, 4:23 am)
Re: Minor annoyance with git push, Jeff King, (Wed Feb 20, 10:03 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Wed Feb 20, 9:06 am)
Re: Minor annoyance with git push, Jay Soffian, (Wed Feb 20, 11:20 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Wed Feb 20, 11:38 am)
Re: Minor annoyance with git push, Steven Walter, (Thu Feb 21, 6:35 pm)
Re: Minor annoyance with git push, Johannes Schindelin, (Thu Feb 21, 8:11 pm)
Re: Minor annoyance with git push, Jeff King, (Sun Feb 10, 9:07 am)
Re: Minor annoyance with git push, Junio C Hamano, (Fri Feb 8, 11:24 pm)
Re: Minor annoyance with git push, Martin Langhoff, (Sat Feb 9, 7:50 am)
Re: Minor annoyance with git push, Junio C Hamano, (Sat Feb 9, 10:24 pm)
[PATCH] checkout: updates to tracking report, Junio C Hamano, (Wed Feb 20, 11:42 pm)
Re: [PATCH] checkout: updates to tracking report, Daniel Barkalow, (Thu Feb 21, 1:02 pm)
Re: [PATCH] checkout: updates to tracking report, Jay Soffian, (Thu Feb 21, 1:27 am)
Re: Minor annoyance with git push, Jeff King, (Sun Feb 10, 6:13 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sun Feb 10, 8:22 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Sat Feb 9, 9:06 am)
Re: Minor annoyance with git push, Jeff King, (Fri Feb 8, 11:55 pm)
Re: Minor annoyance with git push, Sean, (Fri Feb 8, 1:38 am)
Re: Minor annoyance with git push, Steffen Prohaska, (Fri Feb 8, 2:29 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Fri Feb 8, 7:50 am)
Re: Minor annoyance with git push, Martin Langhoff, (Fri Feb 8, 6:27 pm)
Re: Minor annoyance with git push, Jeff King, (Fri Feb 8, 10:46 pm)
Re: Minor annoyance with git push, Steffen Prohaska, (Sat Feb 9, 7:22 am)
Re: Minor annoyance with git push, Jeff King, (Fri Feb 8, 10:54 pm)
Re: Minor annoyance with git push, Johannes Schindelin, (Sat Feb 9, 9:04 am)
Re: Minor annoyance with git push, Jeff King, (Sat Feb 9, 9:22 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Fri Feb 8, 6:57 pm)
Re: Minor annoyance with git push, Martin Langhoff, (Fri Feb 8, 12:50 am)
Re: Minor annoyance with git push, Johannes Schindelin, (Fri Feb 8, 7:52 am)
Re: Minor annoyance with git push, Martin Langhoff, (Fri Feb 8, 6:23 pm)
Re: Minor annoyance with git push, Mike Hommey, (Fri Feb 8, 6:27 pm)
Re: Minor annoyance with git push, Junio C Hamano, (Fri Feb 8, 3:48 am)
Re: Minor annoyance with git push, Steffen Prohaska, (Sat Feb 9, 7:22 am)
Re: Minor annoyance with git push, Junio C Hamano, (Sat Feb 9, 11:44 pm)
Re: Minor annoyance with git push, Johannes Schindelin, (Sun Feb 10, 8:21 am)