Re: [RFC] Branch naming -- allowed characters?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sun, 26 Aug 2007, Jari Aalto wrote:
> 
> I just noticed this while trying to track quilt project and making a
> local branch with name '.pc':
> 
>     'fatal: '.pc' is not a valid branch name.'
> 
> Would it be possible to allow using arbitrary names with branches in
> future git, even UTF-8?

We already do. But '.pc' is not an acceptable branch name.

The issue is that a dot in the branch name makes it impossible to reliably 
parse simple ranges, ie simple syntax like

	git log master..next
	git log master...next

suddenly isn't unambiguous any more if there are branches that begin (or 
end) with a '.' character. Should the latter be parsed as

	(master)...(next)
	(master.)..(next)
	(master)..(.next)

or what?

(In fact, I think we don't correctly check the the "ends with a '.' 
character" case - althouygh we do check that a ".." is not legal in the 
middle)

So we *do* support UTF-8 branch ames, but there are a few special 
characters that simply aren't valid in a branch, because they are part of 
the "SHA1 arithmetic". In addition to '.', that includes the characters

	'~' '^' ':' '?' '[' '*'

which have various special meaning. For similar reasons, the '/' is 
magical and is not allowed to occur at the beginning or the end, or to 
occur as a double slash (becasue it would be ambiguous in the filesystem).

Anything else should be ok (not control characters, though).

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux