All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org, kenneth johansson <ken@kenjo.org>
Subject: Re: tracking repository
Date: Sun, 16 Mar 2008 16:01:41 -0700	[thread overview]
Message-ID: <7vbq5eff3e.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vzlsyfgjg.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 16 Mar 2008 15:30:27 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Daniel Barkalow <barkalow@iabervon.org> writes:
>
>> Is "refs/*:refs/*" (mirror everything, including weird stuff) supposed to 
>> be prohibited?
>
> No.  In fact "remote add --mirror" actively creates such.  See my other
> message about design level issues.

I think something like this is needed.  It still has an independent issue
that this is now called by "git remote show" or "git remote prune", and it
will die with a nonsense "refusing to create" error message, though.

The error, as far as I can tell, is half about a misconfigured config
(e.g. "fetch = refs/heads/*:refs/remotes/[]?/*") and half about screwy
remote repository (e.g. a misnamed "[]?" branch on the remote end can try
to update a broken "refs/remotes/origin/[]?" even the configuration is a
perfectly valid "fetch = refs/heads/*:refs/remotes/origin/*").  It may
make sense to reword the error message to "ignoring" from "refusing" and
do just that without dying here.  I dunno.

 remote.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/remote.c b/remote.c
index f3f7375..fbcb03c 100644
--- a/remote.c
+++ b/remote.c
@@ -1007,9 +1007,12 @@ int get_fetch_map(const struct ref *remote_refs,
 	}
 
 	for (rm = ref_map; rm; rm = rm->next) {
-		if (rm->peer_ref && check_ref_format(rm->peer_ref->name + 5))
-			die("* refusing to create funny ref '%s' locally",
-			    rm->peer_ref->name);
+		if (rm->peer_ref) {
+			int st = check_ref_format(rm->peer_ref->name + 5);
+			if (st && st != CHECK_REF_FORMAT_ONELEVEL)
+				die("* refusing to create funny ref '%s'"
+				    " locally", rm->peer_ref->name);
+		}
 	}
 
 	if (ref_map)

  reply	other threads:[~2008-03-16 23:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-15 19:35 tracking repository kenneth johansson
2008-03-16  2:42 ` Junio C Hamano
2008-03-16 20:02   ` kenneth johansson
2008-03-16 20:38     ` Junio C Hamano
2008-03-16 21:28       ` Daniel Barkalow
2008-03-16 21:57         ` Junio C Hamano
2008-03-16 22:18           ` Daniel Barkalow
2008-03-16 22:30             ` Junio C Hamano
2008-03-16 23:01               ` Junio C Hamano [this message]
2008-03-16 23:11                 ` Daniel Barkalow
2008-03-17  0:17                   ` Junio C Hamano
2008-03-17  0:35         ` Junio C Hamano
2008-03-17  2:13           ` Daniel Barkalow
2008-03-17  2:37           ` Daniel Barkalow
2008-03-17  7:48             ` Junio C Hamano
2008-03-17 16:23               ` Daniel Barkalow

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=7vbq5eff3e.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=ken@kenjo.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.