All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Keller <lkeller@marvell.com>
To: <git@vger.kernel.org>
Subject: git fetch doesn't ignore funny refs
Date: Tue, 17 Dec 2013 13:35:33 +0100	[thread overview]
Message-ID: <52B04515.8020609@marvell.com> (raw)

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

             reply	other threads:[~2013-12-17 12:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 12:35 Lorenzo Keller [this message]
2014-01-05  1:22 ` git fetch doesn't ignore funny refs Heiko Voigt

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

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

  git send-email \
    --in-reply-to=52B04515.8020609@marvell.com \
    --to=lkeller@marvell.com \
    --cc=git@vger.kernel.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.