From: Junio C Hamano Date: Thu, 17 Feb 2011 05:49:30 GMT Subject: Re: [PATCH v3 3/4] commit.c: replace some literal strings with constants Message-ID: <7vlj1fdxcl.fsf@alter.siamese.dyndns.org> In-Reply-To: <1297916325-89688-4-git-send-email-jaysoffian@gmail.com> Jay Soffian writes: > A typo in any of these would be bad, so let's use > constants for them > > Signed-off-by: Jay Soffian > --- > I converted these per > http://article.gmane.org/gmane.comp.version-control.git/167015 > > Maybe this should be the last patch in the series; it's questionable to > me whether it's even worth doing. Yeah, it's horrible ;-) > +static const char commit_editmsg[] = "COMMIT_EDITMSG"; > +static const char cherry_pick_head[] = "CHERRY_PICK_HEAD"; > +static const char merge_head[] = "MERGE_HEAD"; > +static const char merge_msg[] = "MERGE_MSG"; > +static const char merge_mode[] = "MERGE_MODE"; > +static const char squash_msg[] = "SQUASH_MSG"; If they were like static const char COMMIT_EDITMSG[] = "..."; then that would give us typo-safety while keeping the similarity from original code. Uppercase variable names are a bit weird, though.