threads / discuss / 3974

cg-clone not fetching all tags?

Subject: cg-clone not fetching all tags?

## tl;dr

9 messages between Apr 27, 2006 and Apr 30, 2006.

replies: 8people: 4as markdown or json

Wolfgang Denk· Apr 27, 2006, 10:52 UTC · lore
Hi,

it seems that "cg-clone" does not fetch all tags any more - only the most recent ones (modiufied in the last N days?) seem to be fetched? [Eventually the "N days" might correspond to "changing tools to version X", but I have no way to find out.]

This happens only when using HTTP; using ssh or rsync works fine. Also, if we follow the "cg-clone" by a "git-fetch -t" command, this will load the missing tags.

Is this intentional, or am I doing anything wrong?
[For testing, try "cg-clone http://www.denx.de/git/u-boot.git"]
Best regards,
Wolfgang Denk
-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
In theory, there is no difference between  theory  and  practice.  In
practice, however, there is.
Wolfgang Denk· Apr 29, 2006, 14:00 UTC · re: Wolfgang Denk · lore

Re: cg-clone not fetching all tags?

[Repost because there was zero response, not even somebody telling me to RTFM or so.]

Hi,

it seems that "cg-clone" does not fetch all tags any more - only the most recent ones (modiufied in the last N days?) seem to be fetched? [Eventually the "N days" might correspond to "changing tools to version X", but I have no way to find out.]

This happens only when using HTTP; using ssh or rsync works fine. Also, if we follow the "cg-clone" by a "git-fetch -t" command, this will load the missing tags.

Is this intentional, or am I doing anything wrong?
[For testing, try "cg-clone http://www.denx.de/git/u-boot.git"]
Best regards,
Wolfgang Denk
-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
In theory, there is no difference between  theory  and  practice.  In
practice, however, there is.
Petr Baudis· Apr 29, 2006, 17:05 UTC · re: Wolfgang Denk · lore

Re: cg-clone not fetching all tags?

  Hi,

Dear diary, on Sat, Apr 29, 2006 at 04:00:42PM CEST, I got a letter where Wolfgang Denk <wd@denx.de> said that...

Show 12 quoted lines
> it seems that "cg-clone" does not fetch all tags any more - only  the
> most  recent ones (modiufied in the last N days?) seem to be fetched?
> [Eventually the "N days"  might  correspond  to  "changing  tools  to
> version X", but I have no way to find out.]
> 
> This happens only when using HTTP; using ssh  or  rsync  works  fine.
> Also,  if  we follow the "cg-clone" by a "git-fetch -t" command, this
> will load the missing tags.
> 
> Is this intentional, or am I doing anything wrong?
> 
> [For testing, try "cg-clone http://www.denx.de/git/u-boot.git"]
  you need to run git-update-server-info every time you add or update a
tag (or best every time you push). See the NOTES section of
cg-admin-setuprepo documentation for details on how to set it up to be
called automagically at every push.
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.
Johannes Sixt· Apr 29, 2006, 21:42 UTC · re: Petr Baudis · lore

Re: cg-clone not fetching all tags?

On Saturday 29 April 2006 19:05, Petr Baudis wrote:
Show 22 quoted lines
>   Hi,
>
> Dear diary, on Sat, Apr 29, 2006 at 04:00:42PM CEST, I got a letter
> where Wolfgang Denk <wd@denx.de> said that...
>
> > it seems that "cg-clone" does not fetch all tags any more - only  the
> > most  recent ones (modiufied in the last N days?) seem to be fetched?
> > [Eventually the "N days"  might  correspond  to  "changing  tools  to
> > version X", but I have no way to find out.]
> >
> > This happens only when using HTTP; using ssh  or  rsync  works  fine.
> > Also,  if  we follow the "cg-clone" by a "git-fetch -t" command, this
> > will load the missing tags.
> >
> > Is this intentional, or am I doing anything wrong?
> >
> > [For testing, try "cg-clone http://www.denx.de/git/u-boot.git"]
>
>   you need to run git-update-server-info every time you add or update a
> tag (or best every time you push). See the NOTES section of
> cg-admin-setuprepo documentation for details on how to set it up to be
> called automagically at every push.
There are two types of tags: They can point to
1. a commit object
2. a proper tag object (which in turn references the commit)

git-update-server-info seems to generate info only for case 2, and so are the only ones that http can fetch.

-- Hannes
Wolfgang Denk· Apr 29, 2006, 22:11 UTC · re: Johannes Sixt · lore

Re: cg-clone not fetching all tags?

In message <200604292342.16306.johannes.sixt@telecom.at> you wrote:
Show 7 quoted lines
>
> There are two types of tags: They can point to
> 1. a commit object
> 2. a proper tag object (which in turn references the commit)
> 
> git-update-server-info seems to generate info only for case 2, and so are the 
> only ones that http can fetch.

And git-cvsimport (at least older versions of it) imports CVS tags only as type 1 ?

That would perfectly explain the situation. How can this be fixed?

Best regards, Viele Grüße,

Wolfgang Denk
-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
There is a multi-legged creature crawling on your shoulder.
	-- Spock, "A Taste of Armageddon", stardate 3193.9
Johannes Sixt· Apr 29, 2006, 22:54 UTC · re: Wolfgang Denk · lore

Re: cg-clone not fetching all tags?

On Sunday 30 April 2006 00:11, Wolfgang Denk wrote:
Show 12 quoted lines
> In message <200604292342.16306.johannes.sixt@telecom.at> you wrote:
> > There are two types of tags: They can point to
> > 1. a commit object
> > 2. a proper tag object (which in turn references the commit)
> >
> > git-update-server-info seems to generate info only for case 2, and so are
> > the only ones that http can fetch.
>
> And git-cvsimport (at least older versions of it)  imports  CVS  tags
> only as type 1 ?
>
> That would perfectly explain the situation. How can this be fixed?
Something like this tells you which one points to a commit or a tag:
for i in `find .git/refs/tags -type f`; do
  echo -n "$i "; git-cat-file -t $(cat $i);
done
Then for each commit-type $tag you do

git-tag -m ' ' $tag-new $tag mv .git/refs/tags/$tag-new .git/refs/tags/$tag

(git-tag does not accept an empty tag message - if you dislike the single-blank-message, you have to manufacture your tags with git-mktag manually.)

-- Hannes
Junio C Hamano· Apr 30, 2006, 04:11 UTC · re: Wolfgang Denk · lore

Re: cg-clone not fetching all tags?

Wolfgang Denk <wd@denx.de> writes:
Show 13 quoted lines
> In message <200604292342.16306.johannes.sixt@telecom.at> you wrote:
>>
>> There are two types of tags: They can point to
>> 1. a commit object
>> 2. a proper tag object (which in turn references the commit)
>> 
>> git-update-server-info seems to generate info only for case 2, and so are the 
>> only ones that http can fetch.
>
> And git-cvsimport (at least older versions of it)  imports  CVS  tags
> only as type 1 ?
>
> That would perfectly explain the situation. How can this be fixed?

I suspect there is no need to manufacture the tag. Something like this should do.

*WARNING* Since I do not do Porcelain, and I am not a Cogito user, this is obviously untested. In addition, I am seriously drunk right now...

-- >8 -- [PATCH] (cogito) Auto-follow lightweight tags as well.

---
diff --git a/cg-fetch b/cg-fetch
index 687e6b9..39764c7 100755
--- a/cg-fetch
+++ b/cg-fetch
@@ -218,7 +218,8 @@ fetch_tags()
 	git-ls-remote --tags "$uri" |
 		# SHA1 refs/tags/v0.99.8^{} --> SHA1 tags/v0.99.8
 		# where SHA1 is the object v0.99.8 tag points at.
-		sed -ne 's:\([^	]\)	refs/\(tags/.*\)^{}$:\1 \2:p' |
+		sed -n -e 's:\([^	]\)	refs/\(tags/.*\)^{}$:\1 \2:p' \
+		    -e 's:\([^	]\)	refs/\(tags/.*\)$:\1 \2:p|' \
 		while read sha1 tagname; do
 			# Do we have the tag itself?
 			[ -s "$_git/refs/$tagname" ] && continue
Wolfgang Denk· Apr 30, 2006, 13:48 UTC · re: Junio C Hamano · lore

Re: cg-clone not fetching all tags?

Dear Junio,
in message <7vaca31z50.fsf@assigned-by-dhcp.cox.net> you wrote:
> 
> I suspect there is no need to manufacture the tag.  Something
> like this should do.
Great! Thanks a lot.
> *WARNING* Since I do not do Porcelain, and I am not a Cogito
> user, this is obviously untested.  In addition, I am seriously
> drunk right now... 
Good enough. This one actually works:
> -- >8 --
> [PATCH] (cogito) Auto-follow lightweight tags as well.
--- a/cg-fetchG	2006-04-10 19:14:14.000000000 +0200
+++ b/cg-fetch	2006-04-30 14:35:03.000000000 +0200
@@ -211,7 +211,8 @@
 	git-ls-remote --tags "$uri" |
 		# SHA1 refs/tags/v0.99.8^{} --> SHA1 tags/v0.99.8
 		# where SHA1 is the object v0.99.8 tag points at.
-		sed -ne 's:\([^	]\)	refs/\(tags/.*\)^{}$:\1 \2:p' |
+		sed -n -e 's:\([^	]\)	refs/\(tags/.*\)^{}$:\1 \2:p' \
+		       -e 's:\([^	]\)	refs/\(tags/.*\)$:\1 \2:p' | \
 		while read sha1 tagname; do
 			# Do we have the tag itself?
 			[ -s "$_git/refs/$tagname" ] && continue


Best regards,

Wolfgang Denk
-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
It's hard to think of you as the end result of millions of  years  of
evolution.
Wolfgang Denk· Apr 29, 2006, 22:11 UTC · re: Petr Baudis · lore

Re: cg-clone not fetching all tags?

Dear Petr,
in message <20060429170542.GJ27689@pasky.or.cz> you wrote:
> 
>   you need to run git-update-server-info every time you add or update a
> tag (or best every time you push). See the NOTES section of

I do this. Also, this does not seem to explain why I can only see recent tags, but not old ones?

> cg-admin-setuprepo documentation for details on how to set it up to be
> called automagically at every push.

Actually I don't use push, but "cg-update" on the receiving end. Is this a problem?

Best regards,
Wolfgang Denk
-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
There's an old proverb that says just about whatever you want it to.

← back to recent threads