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

Re: [PATCH 13/13] parse_opt_ref_sorting: always use with NONEG flag

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Mar 20, 2019, 12:22 UTC
Message-ID
<CAN0heSrubOaXRbg=NBi0rCuzthUcOEU3HmUKGg+=t+N0CCJcbA@mail.gmail.com>
In-Reply-To
<20190320081650.GM10403@sigill.intra.peff.net>
On Wed, 20 Mar 2019 at 09:17, Jeff King <peff@peff.net> wrote:
>   - since this was cut-and-pasted to four different spots, let's define
>     a single OPT_REF_SORT() macro that we can use everywhere

Indeed, all four are identical. And FWIW I failed to find a fifth caller anywhere (I looked for "OPT_CALLBACK.*sort").

> -               OPT_CALLBACK(0 , "sort", sorting_tail, N_("key"),
> -                            N_("field name to sort on"), &parse_opt_ref_sorting),
> +               OPT_REF_SORT(sorting_tail),
> +#define OPT_REF_SORT(var) \
> +       OPT_CALLBACK_F(0, "sort", (var), \
> +                      N_("key"), N_("field name to sort"), \
> +                      PARSE_OPT_NONEG, parse_opt_ref_sorting)

This one is not identical though. ;-) You drop the "on". I trust you to know which of these is (more) correct, but I was a bit surprised to see "on" disappear without any mention. Mistake, or intended?

Other than that surprise ending, the whole series was a nice read.
Martin
Previous: Jeff KingNext: Jeff King
Message 15 of 19 in “more unused parameter cleanups”
  1. 0/13 more unused parameter cleanupsJeff King, Mar 20, 2019
  2. 01/13 revision: drop some unused "revs" parametersJeff King, Mar 20, 2019
  3. 02/13 log: drop unused rev_info from early outputJeff King, Mar 20, 2019
  4. 03/13 log: drop unused "len" from show_tagger()Jeff King, Mar 20, 2019
  5. 04/13 update-index: drop unused prefix_length parameter from do_reupdate()Jeff King, Mar 20, 2019
  6. 05/13 test-date: drop unused "now" parameter from parse_dates()Jeff King, Mar 20, 2019
  7. 06/13 unpack-trees: drop name_entry from traverse_by_cache_tree()Jeff King, Mar 20, 2019
  8. 07/13 unpack-trees: drop unused error_type parametersJeff King, Mar 20, 2019
  9. 08/13 report_path_error(): drop unused prefix parameterJeff King, Mar 20, 2019
  10. 09/13 fetch_pack(): drop unused parametersJeff King, Mar 20, 2019
  11. 10/13 parse-options: drop unused ctx parameter from show_gitcomp()Jeff King, Mar 20, 2019
  12. 11/13 pretty: drop unused "type" parameter in needs_rfc2047_encoding()Jeff King, Mar 20, 2019
  13. 12/13 pretty: drop unused strbuf from parse_padding_placeholder()Jeff King, Mar 20, 2019
  14. 13/13 parse_opt_ref_sorting: always use with NONEG flagJeff King, Mar 20, 2019
  15. Martin ÅgrenMar 20, 2019
  16. Jeff KingMar 20, 2019
  17. Junio C HamanoMar 20, 2019
  18. Ævar Arnfjörð BjarmasonMar 21, 2019
  19. Jeff KingMar 21, 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.