threads / discuss / 7620

One more shallow tree weirdness - tag not pulled?

Subject: One more shallow tree weirdness - tag not pulled?

## tl;dr

3 messages between Apr 12, 2007 and Apr 12, 2007.

replies: 2people: 2as markdown or json

Robin H. Johnson· Apr 12, 2007, 01:16 UTC · lore

One other bit of weirdness I ran into. On a shallow clone that is extended to full depth, there is a tag missing (that was in the non-shallow clone).

Testcase
> git clone git://git.kernel.org/pub/scm/git/git.git git-0
> git clone --depth 1 git://git.kernel.org/pub/scm/git/git.git git-1
> cd git-1 && git pull --depth 10000000

Now the content of git-0 and git-1 should be functionally identical, but it's not.

I created 'git-$N.list' with:
find git-$N ! -type d  | sort |egrep -v '\.git/(objects/pack/|index$|logs/)' \
 | tr '\n' '\0' | xargs -0 md5sum | sed 's,git-$N/,,g' >git-$N.list

--- git-0.list 2007-04-11 18:12:25.000000000 -0700 +++ git-1.list 2007-04-11 18:12:32.000000000 -0700

@@ -28,7 +28,6 @@
 bc94cbd02df32d07b7fd230d7aba42e8  .git/refs/tags/gitgui-0.6.3
 91521cca8d3f177e2f0cb4a586dac6be  .git/refs/tags/gitgui-0.6.4
 c56d1ac72d959f87ba0dd92721de36de  .git/refs/tags/gitgui-0.6.5
-b9c7a4533d41dfedd0a0d23bbfb3fed8  .git/refs/tags/junio-gpg-pub
 43ceb81bf4c131a8a882025a676aa22e  .git/refs/tags/v0.99
 072e3055bf33ff1ba5aa4697f2b539fb  .git/refs/tags/v0.99.1
 85916310d7d0a86818033ac95f32b234  .git/refs/tags/v0.99.2
-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
Junio C Hamano· Apr 12, 2007, 01:32 UTC · re: Robin H. Johnson · lore

Re: One more shallow tree weirdness - tag not pulled?

"Robin H. Johnson" <robbat2@gentoo.org> writes:
Show 7 quoted lines
> One other bit of weirdness I ran into.  On a shallow clone that is extended to
> full depth, there is a tag missing (that was in the non-shallow clone).
>
> Testcase
>> git clone git://git.kernel.org/pub/scm/git/git.git git-0
>> git clone --depth 1 git://git.kernel.org/pub/scm/git/git.git git-1
>> cd git-1 && git pull --depth 10000000

This is easily explained, and I do not think it has anything to do with shallow clones.

The initial clone gets all tags, regardless of reachability. Subsequent fetches however only _follows_ tags that point at something you have in the repository. The blob that holds my GPG public key is not part of any commit, so you would not have that object in your repository, and subsequent "tag following" will not see it.

	$ git fetch --tags
is always your friend.
> I created 'git-$N.list' with:
> find git-$N ! -type d  | sort |egrep -v '\.git/(objects/pack/|index$|logs/)' \
>  | tr '\n' '\0' | xargs -0 md5sum | sed 's,git-$N/,,g' >git-$N.list

I do not know what you wanted to do, but I suspect you reinvented a rather expensive

	git ls-remote git-$N
perhaps?
Show 17 quoted lines
>
> --- git-0.list	2007-04-11 18:12:25.000000000 -0700
> +++ git-1.list	2007-04-11 18:12:32.000000000 -0700
> @@ -28,7 +28,6 @@
>  bc94cbd02df32d07b7fd230d7aba42e8  .git/refs/tags/gitgui-0.6.3
>  91521cca8d3f177e2f0cb4a586dac6be  .git/refs/tags/gitgui-0.6.4
>  c56d1ac72d959f87ba0dd92721de36de  .git/refs/tags/gitgui-0.6.5
> -b9c7a4533d41dfedd0a0d23bbfb3fed8  .git/refs/tags/junio-gpg-pub
>  43ceb81bf4c131a8a882025a676aa22e  .git/refs/tags/v0.99
>  072e3055bf33ff1ba5aa4697f2b539fb  .git/refs/tags/v0.99.1
>  85916310d7d0a86818033ac95f32b234  .git/refs/tags/v0.99.2
>
> -- 
> Robin Hugh Johnson
> Gentoo Linux Developer & Council Member
> E-Mail     : robbat2@gentoo.org
> GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
Robin H. Johnson· Apr 12, 2007, 03:37 UTC · re: Junio C Hamano · lore

Re: One more shallow tree weirdness - tag not pulled?

On Wed, Apr 11, 2007 at 06:32:36PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> The initial clone gets all tags, regardless of reachability.
> Subsequent fetches however only _follows_ tags that point at
> something you have in the repository.  The blob that holds my
> GPG public key is not part of any commit, so you would not have
> that object in your repository, and subsequent "tag following"
> will not see it.

Ah, that explains it. I didn't dig into what the blob contain, just noticed that it wasn't on the side that I was checking for extending.

Show 7 quoted lines
> > I created 'git-$N.list' with:
> > find git-$N ! -type d  | sort |egrep -v '\.git/(objects/pack/|index$|logs/)' \
> >  | tr '\n' '\0' | xargs -0 md5sum | sed 's,git-$N/,,g' >git-$N.list
> 
> I do not know what you wanted to do, but I suspect you
> reinvented a rather expensive
> 	git ls-remote git-$N

No, the purpose of this command was to check that the checkouts were functionally equivalent.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

← back to recent threads