Re: [PATCH v3] commit-tree: utilize parse-options api

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 4, 2019 at 3:02 AM Brandon Richardson
<brandon1024.br@xxxxxxxxx> wrote:
>
> 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.

> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux