From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Junio C Hamano <gitster@pobox.com>,
Christian Couder <chriscool@tuxfamily.org>,
git@vger.kernel.org
Subject: Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.
Date: Thu, 15 Nov 2007 03:49:34 -0500 [thread overview]
Message-ID: <20071115084934.GN14735@spearce.org> (raw)
In-Reply-To: <473C02F9.4020402@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> wrote:
> Junio C Hamano schrieb:
> >+ git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\*
> >refs/heads/bisect |
> >+ while read ref hash
>
> If you also swap %(refname) and %(objectname), then this is also not prone
> to whitespace in refnames. (Yes, I know, there shouldn't be such, but...)
What's this obsession with whitespace in refnames? Twice in like
two days people are talking about whitespace in refnames.
WHITESPACE IS NOT PERMITTED IN REFNAMES.
Do we need to apply the following patch, to keep people from creating
refs by hand with whitespace in them? Is this really that common?
git rev-parse HEAD >'.git/refs/heads/..i have spaces hah!'
diff --git a/refs.c b/refs.c
index aff02cd..b95bf83 100644
--- a/refs.c
+++ b/refs.c
@@ -246,6 +246,7 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list)
struct stat st;
int flag;
int namelen;
+ int check;
if (de->d_name[0] == '.')
continue;
@@ -261,6 +262,9 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list)
list = get_ref_dir(ref, list);
continue;
}
+ check = check_ref_format(ref);
+ if (check != 0 && check != -2)
+ continue;
if (!resolve_ref(ref, sha1, 1, &flag)) {
error("%s points nowhere!", ref);
continue;
--
Shawn.
next prev parent reply other threads:[~2007-11-15 8:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 7:18 [PATCH v2] Bisect reset: remove bisect refs that may have been packed Christian Couder
2007-11-15 8:18 ` Junio C Hamano
2007-11-15 8:27 ` Johannes Sixt
2007-11-15 8:49 ` Shawn O. Pearce [this message]
2007-11-15 8:52 ` Jeff King
2007-11-15 12:10 ` Johannes Schindelin
2007-11-15 8:34 ` Junio C Hamano
2007-11-15 9:00 ` [PATCH 1/3] git-bisect: war on "sed" Junio C Hamano
2007-11-15 9:29 ` Miles Bader
2007-11-15 9:36 ` Wincent Colaiuta
2007-11-15 9:53 ` Miles Bader
2007-11-15 10:06 ` Andreas Ericsson
2007-11-15 10:14 ` David Kastrup
[not found] ` <86tznn4y7v.fsf@lola.quinscape.zz>
2007-11-15 11:00 ` Miles Bader
2007-11-15 11:18 ` David Kastrup
2007-11-15 12:59 ` Miles Bader
2007-11-15 9:01 ` [PATCH 2/3] git-bisect: use update-ref to mark good/bad commits Junio C Hamano
2007-11-15 9:01 ` [PATCH 3/3] git-bisect: modernize branch shuffling hack Junio C Hamano
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=20071115084934.GN14735@spearce.org \
--to=spearce@spearce.org \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
/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).