<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/check-ref-format.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-01-14T17:32:04Z</updated>
<entry>
<title>standardize usage info string format</title>
<updated>2015-01-14T17:32:04Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2015-01-13T07:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c9b4f2f8b7f27f3984e80d053106d5d41cbb03b'/>
<id>urn:sha1:9c9b4f2f8b7f27f3984e80d053106d5d41cbb03b</id>
<content type='text'>
This patch puts the usage info strings that were not already in docopt-
like format into docopt-like format, which will be a litle easier for
end users and a lot easier for translators. Changes include:

- Placing angle brackets around fill-in-the-blank parameters
- Putting dashes in multiword parameter names
- Adding spaces to [-f|--foobar] to make [-f | --foobar]
- Replacing &lt;foobar&gt;* with [&lt;foobar&gt;...]

Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Reviewed-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Change check_refname_format() to reject unnormalized refnames</title>
<updated>2011-10-05T20:45:30Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-09-15T21:10:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a40e6fb67a4aed2d5ffde5792bf7f1996d9666e1'/>
<id>urn:sha1:a40e6fb67a4aed2d5ffde5792bf7f1996d9666e1</id>
<content type='text'>
Since much of the infrastructure does not work correctly with
unnormalized refnames, change check_refname_format() to reject them.

Similarly, change "git check-ref-format" to reject unnormalized
refnames by default.  But add an option --normalize, which causes "git
check-ref-format" to normalize the refname before checking its format,
and print the normalized refname.  This is exactly the behavior of the
old --print option, which is retained but deprecated.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Inline function refname_format_print()</title>
<updated>2011-10-05T20:45:30Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-09-15T21:10:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5e4ec063afea050d09773f0aa5dcb95a82a31ec'/>
<id>urn:sha1:a5e4ec063afea050d09773f0aa5dcb95a82a31ec</id>
<content type='text'>
Soon we will make printing independent of collapsing.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Make collapse_slashes() allocate memory for its result</title>
<updated>2011-10-05T20:45:30Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-09-15T21:10:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7f748c7cb2317800dcdb311c3e75a086ae0d1600'/>
<id>urn:sha1:7f748c7cb2317800dcdb311c3e75a086ae0d1600</id>
<content type='text'>
This will make upcoming changes a tiny bit easier.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Change check_ref_format() to take a flags argument</title>
<updated>2011-10-05T20:45:29Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-09-15T21:10:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d9c50105f908b2adde4b7c77537cf95f19cd893'/>
<id>urn:sha1:8d9c50105f908b2adde4b7c77537cf95f19cd893</id>
<content type='text'>
Change check_ref_format() to take a flags argument that indicates what
is acceptable in the reference name (analogous to "git
check-ref-format"'s "--allow-onelevel" and "--refspec-pattern").  This
is more convenient for callers and also fixes a failure in the test
suite (and likely elsewhere in the code) by enabling "onelevel" and
"refspec-pattern" to be allowed independently of each other.

Also rename check_ref_format() to check_refname_format() to make it
obvious that it deals with refnames rather than references themselves.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git check-ref-format: add options --allow-onelevel and --refspec-pattern</title>
<updated>2011-10-05T20:45:29Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-09-15T21:10:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4ed6105ec4a8507d4bd9f6355647fa911e4731f'/>
<id>urn:sha1:e4ed6105ec4a8507d4bd9f6355647fa911e4731f</id>
<content type='text'>
Also add tests of the new options.  (Actually, one big reason to add
the new options is to make it easy to test check_ref_format(), though
the options should also be useful to other scripts.)

Interpret the result of check_ref_format() based on which types of
refnames are allowed.  However, because check_ref_format() can only
return a single value, one test case is still broken.  Specifically,
the case "git check-ref-format --onelevel '*'" incorrectly succeeds
because check_ref_format() returns CHECK_REF_FORMAT_ONELEVEL for this
refname even though the refname is also CHECK_REF_FORMAT_WILDCARD.
The type of check that leads to this failure is used elsewhere in
"real" code and could lead to bugs; it will be fixed over the next few
commits.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>check-ref-format --print: Normalize refnames that start with slashes</title>
<updated>2011-08-25T20:39:38Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-08-25T19:19:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f633f41d69527cdd9ff5b8e04a752f1774fc3df'/>
<id>urn:sha1:2f633f41d69527cdd9ff5b8e04a752f1774fc3df</id>
<content type='text'>
When asked if "refs///heads/master" is valid, check-ref-format says "Yes,
it is well formed", and when asked to print canonical form, it shows
"refs/heads/master". This is so that it can be tucked after "$GIT_DIR/"
to form a valid pathname for a loose ref, and we normalize a pathname like
"$GIT_DIR/refs///heads/master" to de-dup the slashes in it.

Similarly, when asked if "/refs/heads/master" is valid, check-ref-format
says "Yes, it is Ok", but the leading slash is not removed when printing,
leading to "$GIT_DIR//refs/heads/master".

Fix it to make sure such leading slashes are removed.  Add tests that such
refnames are accepted and normalized correctly.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Allow "check-ref-format --branch" from subdirectory</title>
<updated>2010-08-06T17:01:45Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-08-06T03:39:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=49cc460d88f5bae79b45ce2db16674f36b6cf38a'/>
<id>urn:sha1:49cc460d88f5bae79b45ce2db16674f36b6cf38a</id>
<content type='text'>
check-ref-format --branch requires access to the repository
to resolve refs like @{-1}.

Noticed by Nguyễn Thái Ngọc Duy.

Cc: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>check-ref-format: handle subcommands in separate functions</title>
<updated>2010-08-06T17:00:39Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-08-06T03:36:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cfbe22f03f9be1f3bbbd33240dcb127099d4346e'/>
<id>urn:sha1:cfbe22f03f9be1f3bbbd33240dcb127099d4346e</id>
<content type='text'>
The code for each subcommand should be easier to read and manipulate
this way.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Move 'builtin-*' into a 'builtin/' subdirectory</title>
<updated>2010-02-22T22:29:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-02-22T16:42:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=81b50f3ce40bfdd66e5d967bf82be001039a9a98'/>
<id>urn:sha1:81b50f3ce40bfdd66e5d967bf82be001039a9a98</id>
<content type='text'>
This shrinks the top-level directory a bit, and makes it much more
pleasant to use auto-completion on the thing. Instead of

	[torvalds@nehalem git]$ em buil&lt;tab&gt;
	Display all 180 possibilities? (y or n)
	[torvalds@nehalem git]$ em builtin-sh
	builtin-shortlog.c     builtin-show-branch.c  builtin-show-ref.c
	builtin-shortlog.o     builtin-show-branch.o  builtin-show-ref.o
	[torvalds@nehalem git]$ em builtin-shor&lt;tab&gt;
	builtin-shortlog.c  builtin-shortlog.o
	[torvalds@nehalem git]$ em builtin-shortlog.c

you get

	[torvalds@nehalem git]$ em buil&lt;tab&gt;		[type]
	builtin/   builtin.h
	[torvalds@nehalem git]$ em builtin		[auto-completes to]
	[torvalds@nehalem git]$ em builtin/sh&lt;tab&gt;	[type]
	shortlog.c     shortlog.o     show-branch.c  show-branch.o  show-ref.c     show-ref.o
	[torvalds@nehalem git]$ em builtin/sho		[auto-completes to]
	[torvalds@nehalem git]$ em builtin/shor&lt;tab&gt;	[type]
	shortlog.c  shortlog.o
	[torvalds@nehalem git]$ em builtin/shortlog.c

which doesn't seem all that different, but not having that annoying
break in "Display all 180 possibilities?" is quite a relief.

NOTE! If you do this in a clean tree (no object files etc), or using an
editor that has auto-completion rules that ignores '*.o' files, you
won't see that annoying 'Display all 180 possibilities?' message - it
will just show the choices instead.  I think bash has some cut-off
around 100 choices or something.

So the reason I see this is that I'm using an odd editory, and thus
don't have the rules to cut down on auto-completion.  But you can
simulate that by using 'ls' instead, or something similar.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
