On Thu, 20 Mar 2008, Junio C Hamano wrote:No, HEAD is syntactically valid as a ref, so it's accepted regardless of anything else. Unfortunately, there's not (so far as I know) a handy way to check the syntax of a sha1 name. We enforce additional, purpose-specific error-checking after parsing, when we're actually trying to use the refspecs. The problem is that we can't make the syntactic check sufficient lenient to cover all valid syntax, but tight enough to prohibit any syntax errors, without getting tangled in a bit of semantics. The syntax is identical. The semantics is not the parser's problem, and is more appropriate for the callers to handle. Not really. If you're fetching, and you have a push refspec configured for the same ref, and that refspec has a LHS which, for the current HEAD, doesn't refer to a valid commit at the moment, that's fine. It's only a problem if you try to use it while it doesn't point at a valid commit, or if it isn't valid syntax for a sha1 name (like HEAD*2). So we should call the same code to parse the string, have that code do no validation at all, and have the caller validate the return as appropriate. The parsing doesn't depend at all on whether it's for fetching or pushing. I think it was that we used to break "push = HEAD", but we support it now. -Daniel *This .sig left intentionally blank* -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg Kroah-Hartman | [PATCH 019/196] DMA: Convert from class_device to device for DMA engine |
| Tejun Heo | [PATCH 4/7] FUSE: implement direct lseek support |
| Parag Warudkar | BUG: soft lockup - CPU#1 stuck for 15s! [swapper:0] |
| Greg Smith | PostgreSQL pgbench performance regression in 2.6.23+ |
git: | |
| Len Brown | fatal: unable to create '.git/index': File exists |
| Dan Farina | backup or mirror a repository |
| André Goddard Rosa | Using kdiff3 to compare two different revisions of a folder |
| Petko Manolov | git and binary files |
| Richard Stallman | Real men don't attack straw men |
| Steve B | Intel Atom and D945GCLF2 |
| Jeff Ross | U320 Drive on U160 controller? |
| Sunnz | How do I configure sendmail? |
| Eric Dumazet | [PATCH] fs: pipe/sockets/anon dentries should not have a parent |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
| Wei Yongjun | [PATCH] xfrm: Fix kernel panic when flush and dump SPD entries |
| Steffen Klassert | [RFC PATCH 4/5] crypto: allow allocation of percpu crypto transforms |
