From: Jacob Keller <jacob.e.keller@intel.com>
To: git@vger.kernel.org
Cc: Jacob Keller <jacob.keller@gmail.com>,
Daniel Barkalow <barkalow@iabervon.iabervon.org>,
Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 1/2] refs: cleanup comments regarding check_refname_component
Date: Wed, 22 Jul 2015 14:05:32 -0700 [thread overview]
Message-ID: <1437599133-13012-2-git-send-email-jacob.e.keller@intel.com> (raw)
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
next prev parent reply other threads:[~2015-07-22 21:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 21:05 [PATCH v5 0/2] refs: cleanup and new behavior Jacob Keller
2015-07-22 21:05 ` Jacob Keller [this message]
2015-07-22 21:05 ` [PATCH 2/2] refs: loosen restriction on wildcard "*" refspecs Jacob Keller
2015-07-22 22:04 ` Junio C Hamano
2015-07-22 23:24 ` Jacob Keller
2015-07-23 16:44 ` Junio C Hamano
2015-07-23 16:51 ` Jacob Keller
2015-07-23 17:13 ` Junio C Hamano
2015-07-23 17:18 ` Jacob Keller
2015-07-23 22:00 ` Eric Sunshine
2015-07-23 22:12 ` Junio C Hamano
2015-07-24 0:45 ` Keller, Jacob E
2015-07-24 0:51 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437599133-13012-2-git-send-email-jacob.e.keller@intel.com \
--to=jacob.e.keller@intel.com \
--cc=barkalow@iabervon.iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).