git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] refs: cleanup comments regarding check_refname_component

From
Jacob Keller <jacob.e.keller@intel.com>
Date
Jul 22, 2015, 21:05 UTC
Message-ID
<1437599133-13012-2-git-send-email-jacob.e.keller@intel.com>
In-Reply-To
<1437599133-13012-1-git-send-email-jacob.e.keller@intel.com>
From: Jacob Keller <jacob.keller@gmail.com>

Correctly specify all characters which are rejected under the '4' disposition, including '*' even though it does gain special treatment by callers of check_refname_component.

Cleanup comment style for rejected refs by inserting a ", or" at the end of each statement.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Cc: Daniel Barkalow <barkalow@iabervon.iabervon.org>
Cc: Junio C Hamano <gitster@pobox.com>
---
 refs.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index ce8cd8d45001..8c08fc0489eb 100644
--- a/refs.c
+++ b/refs.c
@@ -19,7 +19,8 @@ struct ref_lock {
  * 1: End-of-component
  * 2: ., look for a preceding . to reject .. in refs
  * 3: {, look for a preceding @ to reject @{ in refs
- * 4: A bad character: ASCII control characters, "~", "^", ":" or SP
+ * 4: A bad character: ASCII control characters, and
+ *    "*", ":", "?", "[", "\", "^", "~", SP, or TAB
  */
 static unsigned char refname_disposition[256] = {
 	1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
@@ -70,10 +71,11 @@ static unsigned char refname_disposition[256] = {
  *
  * - any path component of it begins with ".", or
  * - it has double dots "..", or
- * - it has ASCII control character, "~", "^", ":" or SP, anywhere, or
- * - it ends with a "/".
- * - it ends with ".lock"
- * - it contains a "\" (backslash)
+ * - it has ASCII control characters, or
+ * - it has "*", ":", "?", "[", "\", "^", "~", SP, or TAB anywhere, or
+ * - it ends with a "/", or
+ * - it ends with ".lock", or
+ * - it contains a "@{" portion
  */
 static int check_refname_component(const char *refname, int flags)
 {
-- 
2.4.3
Previous: Jacob KellerNext: Jacob Keller
Message 2 of 13 in “refs: cleanup and new behavior”
  1. 0/2 refs: cleanup and new behaviorJacob Keller, Jul 22, 2015
  2. 1/2 refs: cleanup comments regarding check_refname_componentJacob Keller, Jul 22, 2015
  3. 2/2 refs: loosen restriction on wildcard "*" refspecsJacob Keller, Jul 22, 2015
  4. Junio C HamanoJul 22, 2015
  5. Jacob KellerJul 22, 2015
  6. Junio C HamanoJul 23, 2015
  7. Jacob KellerJul 23, 2015
  8. Junio C HamanoJul 23, 2015
  9. Jacob KellerJul 23, 2015
  10. Eric SunshineJul 23, 2015
  11. Junio C HamanoJul 23, 2015
  12. Keller, Jacob EJul 24, 2015
  13. Junio C HamanoJul 24, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.