git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Petr Baudis <pasky@suse.cz>, Tom Prince <tom.prince@ualberta.net>,
	git@vger.kernel.org
Subject: Re: Cogito: cg-clone doesn't like packed tag objects
Date: Tue, 27 Sep 2005 10:56:24 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0509271020530.3308@g5.osdl.org> (raw)
In-Reply-To: <7v64sm30dh.fsf@assigned-by-dhcp.cox.net>



On Tue, 27 Sep 2005, Junio C Hamano wrote:
> 
> This is a bit hard and needs some thinking to do cleanly,
> because what is in info/refs is what is sent from the publisher
> side over git-native protocol at the beginning of the handshake,
> and it is not easy to add that to git-native protocol cleanly
> and backward-compatibly (I think I know how without breaking
> existing clients, but it is not clean).

Argh.

"git-upload-pack" very much on purpose never sends partial object stores: 
it really doesn't want to send a tag-object for you to even _look_ at 
unless it also sends all the objects that you are missing that the tag 
refers to.

I'd really be much happier with the tag fetching being separate.

For example, making

	git fetch --tags <dest>

fetch all tags _and_ the objects that they depend on would seem a _lot_ 
more appropriate.

The thing is, tags really may be totally private. For example, it makes 
sense to fetch tags when you pull an official tree (ie my kernel tree, or 
your git tree), but it does NOT make sense for me to fetch tags 
(automatically or not) when I pull from a developers tree.

That's why git fetch doesn't get the tags by default. It's WRONG. 

But we could certainly make it _easier_ to get tags when you want them. 
"git-ls-remote" already helps you, and

	git-ls-remote ... | cut -f2 | grep '^refs/tags/'

completes the picture. No protocol changes necessary, just some added 
magic to git-fetch.sh.

Actually, here's a simple and stupid patch.

Untested as usual, but hey, how hard can it be?

		Linus

----
diff --git a/git-fetch.sh b/git-fetch.sh
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -5,6 +5,7 @@
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 
+tags=
 append=
 force=
 update_head_ok=
@@ -17,6 +18,9 @@ do
 	-f|--f|--fo|--for|--forc|--force)
 		force=t
 		;;
+	--tags)
+		tags=t
+		;;
 	-u|--u|--up|--upd|--upda|--updat|--update|--update-|--update-h|\
 	--update-he|--update-hea|--update-head|--update-head-|\
 	--update-head-o|--update-head-ok)
@@ -151,7 +155,12 @@ case "$update_head_ok" in
 	;;
 esac
 
-for ref in $(get_remote_refs_for_fetch "$@")
+taglist=
+if [ "$tags" ]; then
+	taglist=$(git-ls-remote "$remote" | awk '/refs\/tags/ { print $2":"$2 }')
+fi
+
+for ref in $(get_remote_refs_for_fetch "$@" $taglist)
 do
     refs="$refs $ref"
 

  reply	other threads:[~2005-09-27 17:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-23 22:24 Cogito: cg-clone doesn't like packed tag objects H. Peter Anvin
2005-09-24  1:18 ` Petr Baudis
2005-09-24  1:52   ` H. Peter Anvin
2005-09-24  2:00   ` Junio C Hamano
2005-09-24 12:50     ` Petr Baudis
2005-09-24 17:13       ` Daniel Barkalow
2005-09-24 18:10       ` Junio C Hamano
2005-11-09 22:33         ` Petr Baudis
2005-11-09 23:14           ` Junio C Hamano
2005-11-09 23:36             ` Nick Hengeveld
2005-11-09 23:44               ` Petr Baudis
2005-11-10  1:01                 ` Nick Hengeveld
2005-11-09 23:47               ` Junio C Hamano
2005-09-26 21:25   ` Petr Baudis
2005-09-26 21:55     ` Brian Gerst
2005-09-26 21:56       ` Petr Baudis
2005-09-26 22:23     ` Junio C Hamano
2005-09-26 22:29       ` Petr Baudis
2005-09-27  4:46         ` Junio C Hamano
2005-09-27  5:02           ` Tom Prince
2005-09-27  5:28             ` Junio C Hamano
2005-09-27  9:40               ` Petr Baudis
2005-09-27 10:14                 ` Josef Weidendorfer
2005-09-27 12:34                   ` Petr Baudis
2005-09-27 13:27                     ` Josef Weidendorfer
2005-09-27 17:07                 ` Junio C Hamano
2005-09-27 17:56                   ` Linus Torvalds [this message]
2005-09-27 18:36                     ` Junio C Hamano
2005-09-27 21:16                       ` Linus Torvalds
2005-09-27 21:44                         ` Linus Torvalds
2005-09-27 22:11                         ` Junio C Hamano
2005-09-28 17:22                         ` Junio C Hamano
2005-10-14  6:03                           ` Peeling the onion Junio C Hamano
     [not found]                             ` <46a038f90510140048r30c7ec36n35f77a1ac52c4691@mail.gmail.com>
2005-10-14  8:40                               ` Junio C Hamano
2005-09-26 22:37       ` Cogito: cg-clone doesn't like packed tag objects Junio C Hamano
2005-09-27  6:54     ` Sven Verdoolaege
2005-09-27  7:25     ` Ryan Anderson
2005-09-27 15:34       ` Linus Torvalds
2005-09-27 17:34         ` Ryan Anderson
2005-09-27 18:04           ` Linus Torvalds
2005-09-27  7:46     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0509271020530.3308@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=pasky@suse.cz \
    --cc=tom.prince@ualberta.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).