Re: [PATCH v3] commit-tree: utilize parse-options api
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 4, 2019, 12:17 UTC
- Message-ID
- <CACsJy8D60NXksKpYJeDJbYKP6JUmrHEJW8ubMeV12dij+jXKLg@mail.gmail.com>
- In-Reply-To
- <20190303200220.30009-1-brandon1024.br@gmail.com>
On Mon, Mar 4, 2019 at 3:02 AM Brandon Richardson <brandon1024.br@gmail.com> wrote:
Show 13 quoted lines
> > Rather than parse options manually, which is both difficult to > read and error prone, parse options supplied to commit-tree > using the parse-options api. > > It was discovered that the --no-gpg-sign option was documented > but not implemented in commit 70ddbd7767 (commit-tree: add missing > --gpg-sign flag, 2019-01-19), and the existing implementation > would attempt to translate the option as a tree oid. It was also > suggested earlier in commit 55ca3f99ae (commit-tree: add and document > --no-gpg-sign, 2013-12-13) that commit-tree should be migrated to > utilize the parse-options api, which could help prevent mistakes > like this in the future. Hence this change.
You probably should mention about the extra _() too (e.g. "while at there, mark more strings for translation") just to be clear it's intentional.
Show 10 quoted lines
> diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c > index 12cc403bd7..d4a911acf5 100644 > --- a/builtin/commit-tree.c > +++ b/builtin/commit-tree.c > @@ -12,8 +12,14 @@ > #include "builtin.h" > #include "utf8.h" > #include "gpg-interface.h" > +#include "parse-options.h" > +#include "string-list.h"
Everything looks good, except that I can't find where this string-list.h is needed. Maybe just try to remove it and build to be sure.
-- Duy