Re: [PATCH v4 00/16] pathspec cleanup
From: Duy Nguyen <hidden>
Date: 2017-01-04 13:58:23
On Wed, Jan 4, 2017 at 1:42 AM, Brandon Williams [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/dir.c b/dir.c index 15f7c9993..e8ddd7f8a 100644 --- a/dir.c +++ b/dir.c@@ -1353,6 +1353,15 @@ static int simplify_away(const char *path, int pathlen, { int i; + if (pathspec) + guard_pathspec(pathspec, + pathspec_fromtop | + pathspec_maxdepth | + pathspec_literal | + pathspec_glob | + pathspec_icase | + pathspec_exclude);
You have done some magic (or your MTA/editor did) to lower case GUARD_PATHSPEC and all the flags. The real patch looks good though, so no problem.
+
if (!pathspec || !pathspec->nr)
return 0;Super tiny nit, if GUARD_PATHSPEC is placed after this line, then we don't have to check if pathspec is non-NULL. Probably not worth a re-roll unless somebody else finds something else.
if (m->mnemonic) - strbuf_addf(&sb, "'(%c)%s'", m->mnemonic, m->name); + strbuf_addf(&sb, "'%s' (mnemonic: '%c')", + m->name, m->mnemonic);
.. and that somebody might be me :) we need to mark "mnemonic" for translation. Putting _() around the string would do. Ideally I would give the translators the whole sentence so they can have good context (and good translation as a result). But since we potentially concatenate multiple unsupported magic in the string, there's no way to provide one (or a few) fixed string(s) at compile time. So let's just _() it and leave it at that. -- Duy