git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Brandon RichardsonNext: Brandon Richardson
Message 2 of 3 in “commit-tree: utilize parse-options api”
  1. commit-tree: utilize parse-options apiBrandon Richardson, Mar 3, 2019
  2. Duy NguyenMar 4, 2019
  3. Brandon RichardsonMar 4, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.