git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git fetch doesn't ignore funny refs
@ 2013-12-17 12:35 Lorenzo Keller
  2014-01-05  1:22 ` Heiko Voigt
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Keller @ 2013-12-17 12:35 UTC (permalink / raw)
  To: git

Hello,

I'm trying to maintain a mirror of a repo that is published with gerrit.
The repo contains
a "funny ref" with name 'refs/tags/xyz/...' .

When I clone the repo the ref is correctly ignored:

> git clone --mirror ssh://server:29418/repo

Cloning into bare repository 'repo.git'...
error: * Ignoring funny ref 'refs/tags/xyz/...' locally
remote: Counting objects: 58263, done
remote: Finding sources: 100% (58263/58263)
remote: Total 58263 (delta 40882), reused 58131 (delta 40882)
Receiving objects: 100% (58263/58263), 16.10 MiB | 163.00 KiB/s, done.
Resolving deltas: 100% (40882/40882), done.
Checking connectivity... done.

When I try to update the mirror, however, the command fails:

> git remote update

Fetching origin
error: * Ignoring funny ref refs/tags/xyz/...' locally
From ssh://server:29418/repo
 ! [new tag]         xyz/... -> xyz/...  (unable to update local ref)
error: Could not fetch origin

Doing a fetch also fails:

> git fetch --all

Fetching origin
error: * Ignoring funny ref 'refs/tags/xyz/...' locally
From ssh://server:29418/repo
 ! [new tag]         xyz/... -> xyz/...  (unable to update local ref)
error: Could not fetch origin

If I force not to update the tags, then the command is successful:

> git fetch --all -n

Fetching origin
error: * Ignoring funny ref 'refs/tags/xyz/...' locally

I believe the problem is due to the fact that in function
find_non_local_tags() in file builtins/fetch.c
the refs are directly obtained from the transport and not filtered for
funny entries.

A check as this one:

if (check_refname_format(ref->name, 0))
   continue;

fixes the problem for me.

I report here bug and fix in the hope it can be reviewed and integrated
in future git releases.

Best regards,
Lorenzo Keller

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git fetch doesn't ignore funny refs
  2013-12-17 12:35 git fetch doesn't ignore funny refs Lorenzo Keller
@ 2014-01-05  1:22 ` Heiko Voigt
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Voigt @ 2014-01-05  1:22 UTC (permalink / raw)
  To: Lorenzo Keller; +Cc: git

On Tue, Dec 17, 2013 at 01:35:33PM +0100, Lorenzo Keller wrote:
> A check as this one:
> 
> if (check_refname_format(ref->name, 0))
>    continue;
> 
> fixes the problem for me.
> 
> I report here bug and fix in the hope it can be reviewed and integrated
> in future git releases.

Since it seems you already have a fix: How about sending a proper patch
(possibly you want to extend this with a warning message) so people can
discuss and integrate your fix here? See Documentation/SubmittingPatches
for further information.

Cheers Heiko

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-05  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17 12:35 git fetch doesn't ignore funny refs Lorenzo Keller
2014-01-05  1:22 ` Heiko Voigt

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 NNTP newsgroup(s).