From: Junio C Hamano Date: Fri, 09 Sep 2011 23:30:50 GMT Subject: Re: [PATCH 6/6] Add a REFNAME_ALLOW_UNNORMALIZED flag to check_ref_format() Message-ID: <7vpqj9s385.fsf@alter.siamese.dyndns.org> In-Reply-To: <1315568778-3592-7-git-send-email-mhagger@alum.mit.edu> Michael Haggerty writes: > Let the callers of check_ref_format() (and normalize_refname()) decide > whether to accept unnormalized refnames via a new > REFNAME_ALLOW_UNNORMALIZED flag. Change callers to set this flag, > which preserves their current behavior. (There are likely places > where this flag can be removed.) Hmm, is it just me who finds --no-allow-unnormalized backwards? More importantly, shouldn't every caller be required to normalize refnames by default, unless it can justify why it does not have to with a compelling reason? In other words, I would be Ok if "--no-require-normalized" was the default for "git check-ref-format" for scripts' use, and I also would be perfectly fine if callers feed un-normalized strings that came from the command line argument and other end user input to normalize_refname(), but once such a string is normalized, shouldn't the rest of the callchain be passing the normalized refname all the way? To put it another way, my knee jerk reaction is that we shouldn't need such a "flag". Shouldn't it be sufficient for normalize_refname() and nothing else to allow unnormalized input, and everybody else should barf when they see an un-normalized input?