Re: [PATCH] Use git-update-ref in scripts.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Use git-update-ref in scripts.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:07

Linus Torvalds [off-list ref] writes:
Heh. My kernel has none of that. Well, it obviously has refs, but even 
there it literally has just one head: "master". The rest are the standard 
tags you see in public.
I was wondering the URL shorthand you mentioned is being used in
practice.  In theory, you do not "have to write out in full"
anymore ;-).

Message-ID: [off-list ref]
From: Linus Torvalds <torvalds@osdl.org>
Date: Fri, 15 Jul 2005 15:42:42 -0700 (PDT)

And it's not necessarily just the branch handling, but more of a generic
shorthand: I'd love to be able to mix something like

	git pull jgarzik/misc-2.6 upstream

and "jgarzik" would be expanded (through something like .git/branches) to 
"master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/"), resulting in the 
_full_ path being expanded to

	master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 upstream

which I have to write out in full (or, more commonly, cut-and-paste) right
now.

Re: [PATCH] Use git-update-ref in scripts.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:07


On Wed, 28 Sep 2005, Junio C Hamano wrote:
I was wondering the URL shorthand you mentioned is being used in
practice.  In theory, you do not "have to write out in full"
anymore ;-).
Almost always, I end up cut-and-pasting the thing from an email.

In many ways, the most irritating part for me about that is that an email 
that wants to give a publically accessible part has to be something like

   "Please pull from

      rsync://rsync.kernel.org/path

    to get the xyz updates"

and then I cut-and-paste it but have to delete the "rsync://", and replace 
the "rsync.kernel.org/" with "master.kernel.org:/". 

Sad.

So I've actually considered a totally Linus-only hack that does that 
automatically, ie something like this untested patch.. (same goes for http 
too, for that matter)

		Linus
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -32,7 +32,7 @@ get_remote_url () {
 	data_source=$(get_data_source "$1")
 	case "$data_source" in
 	'')
-		echo "$1" ;;
+		echo "$1" | sed 's/rsync:[^/]*kernel.org/master.kernel.org:/ ;;
 	remotes)
 		sed -ne '/^URL: */{
 			s///p
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help