# cg-clone not fetching all tags?

9 messages from 2006-04-27 to 2006-04-30. Participants: Wolfgang Denk, Petr Baudis, Johannes Sixt, Junio C Hamano.
Thread: https://gitlist.dev/t/3974

## Wolfgang Denk, 2006-04-27 10:52

Subject: cg-clone not fetching all tags?
Message-ID: <20060427105251.AA4B2353DAC@atlas.denx.de>
URL: https://gitlist.dev/e/20060427105251.AA4B2353DAC%40atlas.denx.de

```
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, 2006-04-29 14:00

Subject: Re: cg-clone not fetching all tags?
Message-ID: <20060429140042.1FB37353DAC@atlas.denx.de>
URL: https://gitlist.dev/e/20060429140042.1FB37353DAC%40atlas.denx.de
In-Reply-To: <20060427105251.AA4B2353DAC@atlas.denx.de>

```
[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, 2006-04-29 17:05

Subject: Re: cg-clone not fetching all tags?
Message-ID: <20060429170542.GJ27689@pasky.or.cz>
URL: https://gitlist.dev/e/20060429170542.GJ27689%40pasky.or.cz
In-Reply-To: <20060429140042.1FB37353DAC@atlas.denx.de>

```
  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.

-- 
				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, 2006-04-29 21:42

Subject: Re: cg-clone not fetching all tags?
Message-ID: <200604292342.16306.johannes.sixt@telecom.at>
URL: https://gitlist.dev/e/200604292342.16306.johannes.sixt%40telecom.at
In-Reply-To: <20060429170542.GJ27689@pasky.or.cz>

```
On Saturday 29 April 2006 19:05, Petr Baudis wrote:
>   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, 2006-04-29 22:11

Subject: Re: cg-clone not fetching all tags?
Message-ID: <20060429221112.4380F35288F@atlas.denx.de>
URL: https://gitlist.dev/e/20060429221112.4380F35288F%40atlas.denx.de
In-Reply-To: <20060429170542.GJ27689@pasky.or.cz>

```
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.

```

## Wolfgang Denk, 2006-04-29 22:11

Subject: Re: cg-clone not fetching all tags?
Message-ID: <20060429221114.557FC35288F@atlas.denx.de>
URL: https://gitlist.dev/e/20060429221114.557FC35288F%40atlas.denx.de
In-Reply-To: <200604292342.16306.johannes.sixt@telecom.at>

```
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?

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, 2006-04-29 22:54

Subject: Re: cg-clone not fetching all tags?
Message-ID: <200604300054.31526.johannes.sixt@telecom.at>
URL: https://gitlist.dev/e/200604300054.31526.johannes.sixt%40telecom.at
In-Reply-To: <20060429221114.557FC35288F@atlas.denx.de>

```
On Sunday 30 April 2006 00:11, Wolfgang Denk wrote:
> 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, 2006-04-30 04:11

Subject: Re: cg-clone not fetching all tags?
Message-ID: <7vaca31z50.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vaca31z50.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060429221114.557FC35288F@atlas.denx.de>

```
Wolfgang Denk <wd@denx.de> writes:

> 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, 2006-04-30 13:48

Subject: Re: cg-clone not fetching all tags?
Message-ID: <20060430134840.0027C353B12@atlas.denx.de>
URL: https://gitlist.dev/e/20060430134840.0027C353B12%40atlas.denx.de
In-Reply-To: <7vaca31z50.fsf@assigned-by-dhcp.cox.net>

```
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.

```
