From: Junio C Hamano <junkio@cox.net>
To: Simon Richter <Simon.Richter@kleinhenz.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Ignore tags that contain colons in their names
Date: Fri, 06 Jan 2006 14:37:57 -0800 [thread overview]
Message-ID: <7v1wzlrni2.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 43BBCA0A.6020906@kleinhenz.de
Simon Richter <Simon.Richter@kleinhenz.de> writes:
> a repo I was trying to clone contained a tag that somehow had a colon
> in its name, which is illegal. The attached patch makes git-fetch
> ignore these tags rather than barf.
Good intentions, but colon is not the only character.
I suspect we need to do something like this instead.
---
diff --git a/git-fetch.sh b/git-fetch.sh
index 125bcea..b46b3e5 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -188,11 +188,20 @@ esac
reflist=$(get_remote_refs_for_fetch "$@")
if test "$tags"
then
- taglist=$(git-ls-remote --tags "$remote" |
- sed -e '
- /\^/d
- s/^[^ ]* //
- s/.*/.&:&/')
+ taglist=$(IFS=" " &&
+ git-ls-remote --tags "$remote" |
+ while read sha1 name
+ do
+ case "$name" in
+ (*^*) continue ;;
+ esac
+ if git-check-ref-format "$name"
+ then
+ echo ".${name}:${name}"
+ else
+ echo >&2 "warning: tag ${name} ignored"
+ fi
+ done)
if test "$#" -gt 1
then
# remote URL plus explicit refspecs; we need to merge them.
prev parent reply other threads:[~2006-01-06 22:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-04 13:13 [PATCH] Ignore tags that contain colons in their names Simon Richter
2006-01-06 22:37 ` Junio C Hamano [this message]
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=7v1wzlrni2.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Simon.Richter@kleinhenz.de \
--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 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).