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

Re: [PATCH 4/7] test-tool.h: ASCII-sort list of functions

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 17, 2021, 17:54 UTC
Message-ID
<xmqqczvxy8bi.fsf@gitster.g>
In-Reply-To
<b817541c2754ec8fc4edc1ae774e460912e7c0a8.1615856156.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 8 quoted lines
> The list of test-tool functions have, over time, gotten slightly out of
> ASCII order. Sort this list to bring them back into order.
>
> ASCII sorting was chosen over strict alphabetical order for the same
> reason as 805d9eaf5e (Makefile: ASCII-sort += lists, 2020-03-21): the
> purpose of maintaining the sorted list is to ensure line insertions are
> deterministic. By using ASCII ordering, it is more easily mechanically
> reproducible in the future, such as by using :sort in Vim.

Likewise. The rationale 805d9eaf (Makefile: ASCII-sort += lists, 2020-03-21) applies better for Makefile's "X += <name>" as the prefix before the <name> are all common, while in the header files, you have to depend on their return type being the same and '(' sorting before '_'.

Now I am inclined to say that it may be worth mentioning in the log, both for this step and the previous one.

Show 46 quoted lines
> This patch is best viewed with `--color-moved`.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  t/helper/test-tool.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
> index 28072c0ad5..9856e84149 100644
> --- a/t/helper/test-tool.h
> +++ b/t/helper/test-tool.h
> @@ -22,14 +22,15 @@ int cmd__example_decorate(int argc, const char **argv);
>  int cmd__fast_rebase(int argc, const char **argv);
>  int cmd__genrandom(int argc, const char **argv);
>  int cmd__genzeros(int argc, const char **argv);
> -int cmd__hashmap(int argc, const char **argv);
>  int cmd__hash_speed(int argc, const char **argv);
> +int cmd__hashmap(int argc, const char **argv);
>  int cmd__index_version(int argc, const char **argv);
>  int cmd__json_writer(int argc, const char **argv);
>  int cmd__lazy_init_name_hash(int argc, const char **argv);
>  int cmd__match_trees(int argc, const char **argv);
>  int cmd__mergesort(int argc, const char **argv);
>  int cmd__mktemp(int argc, const char **argv);
> +int cmd__oid_array(int argc, const char **argv);
>  int cmd__oidmap(int argc, const char **argv);
>  int cmd__online_cpus(int argc, const char **argv);
>  int cmd__parse_options(int argc, const char **argv);
> @@ -52,7 +53,6 @@ int cmd__run_command(int argc, const char **argv);
>  int cmd__scrap_cache_tree(int argc, const char **argv);
>  int cmd__serve_v2(int argc, const char **argv);
>  int cmd__sha1(int argc, const char **argv);
> -int cmd__oid_array(int argc, const char **argv);
>  int cmd__sha256(int argc, const char **argv);
>  int cmd__sigchain(int argc, const char **argv);
>  int cmd__strcmp_offset(int argc, const char **argv);
> @@ -62,8 +62,8 @@ int cmd__submodule_nested_repo_config(int argc, const char **argv);
>  int cmd__subprocess(int argc, const char **argv);
>  int cmd__trace2(int argc, const char **argv);
>  int cmd__urlmatch_normalization(int argc, const char **argv);
> -int cmd__xml_encode(int argc, const char **argv);
>  int cmd__wildmatch(int argc, const char **argv);
> +int cmd__xml_encode(int argc, const char **argv);
>  #ifdef GIT_WINDOWS_NATIVE
>  int cmd__windows_named_pipe(int argc, const char **argv);
>  #endif
Previous: Denton LiuNext: Denton Liu
Message 21 of 24 in “Sort lists and add static-analysis”
  1. 0/7 Sort lists and add static-analysisDenton Liu, Mar 16, 2021
  2. 3/7 builtin.h: ASCII-sort list of functionsDenton Liu, Mar 16, 2021
  3. Junio C HamanoMar 17, 2021
  4. 2/7 Makefile: ASCII-sort LIB_OBJSDenton Liu, Mar 16, 2021
  5. 1/7 Makefile: mark 'check-builtins' as a .PHONY targetDenton Liu, Mar 16, 2021
  6. Eric SunshineMar 16, 2021
  7. Junio C HamanoMar 17, 2021
  8. 5/7 Makefile: add 'check-sort' targetDenton Liu, Mar 16, 2021
  9. Eric SunshineMar 16, 2021
  10. Denton LiuMar 17, 2021
  11. Ævar Arnfjörð BjarmasonMar 17, 2021
  12. Jeff KingMar 17, 2021
  13. Ævar Arnfjörð BjarmasonMar 17, 2021
  14. Eric SunshineMar 17, 2021
  15. Jeff KingMar 17, 2021
  16. Junio C HamanoMar 17, 2021
  17. Ævar Arnfjörð BjarmasonMar 17, 2021
  18. Junio C HamanoMar 17, 2021
  19. 6/7 ci/run-static-analysis.sh: make check-builtinsDenton Liu, Mar 16, 2021
  20. 4/7 test-tool.h: ASCII-sort list of functionsDenton Liu, Mar 16, 2021
  21. Junio C HamanoMar 17, 2021
  22. 7/7 ci/run-static-analysis.sh: make check-sortDenton Liu, Mar 16, 2021
  23. Bagas SanjayaMar 17, 2021
  24. Junio C HamanoMar 17, 2021

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.