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

Re: [PATCH 02/15] apply.c: stop using index compat macros

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2018, 17:27 UTC
Message-ID
<xmqqbmbypyis.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180616054157.32433-3-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  apply.c | 34 +++++++++++++++++++---------------
>  1 file changed, 19 insertions(+), 15 deletions(-)

Until all the codepaths that reach these callsites to index_* functions from cmd_main() are converted to pass "struct index_state *" throughout, a step like this patch does fundamentally changes nothing. The only two issues worth addressing in this area still remain. All the lines we see here still depend on the existence of "the_index" instance, and they can only operate on that single "the_index" instance and nothing else.

It is true that the dependency has been made more explicit, but it already is explicit (to see them you just say "no-the-index-macros" and see what fails to compile).

I see others are enthused with this series, but seeing the changes like these I am not all that impressed.

Would it become hard to review if we combine this step *and* the next logical step (i.e. pass the "struct index_state" throughout the callflow) into a single patch? The functions in apply.c are fairly well isolated and there won't be all that heavy interaction with the outside world if we convert this file (and it alone) without touchning the other files. If a division in that direction is possible, it may make a better orgainzation (i.e. instead of doing whole-tree superficial conversion that needs to be fixed up again later, do a deep full conversion on selected files before going on to next set of files).

Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 21 of 32 in “Kill the_index part 1, expose it”
  1. 00/15 Kill the_index part 1, expose itNguyễn Thái Ngọc Duy, Jun 16, 2018
  2. 01/15 contrib: add cocci script to replace index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  3. Derrick StoleeJun 19, 2018
  4. Derrick StoleeJun 19, 2018
  5. Duy NguyenJun 19, 2018
  6. Derrick StoleeJun 19, 2018
  7. SZEDER GáborJul 23, 2018
  8. 05/15 diff-lib.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  9. 11/15 revision.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  10. 04/15 check-racy.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  11. 14/15 wt-status.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  12. 10/15 rerere.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  13. 12/15 sequencer.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  14. 13/15 sha1-name.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  15. 03/15 blame.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  16. 08/15 merge-recursive.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  17. 09/15 merge.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  18. 15/15 cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switchNguyễn Thái Ngọc Duy, Jun 16, 2018
  19. Brandon WilliamsJun 18, 2018
  20. 02/15 apply.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  21. Junio C HamanoJun 25, 2018
  22. Duy NguyenJun 30, 2018
  23. Junio C HamanoJul 3, 2018
  24. Duy NguyenJul 9, 2018
  25. 07/15 entry.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  26. 06/15 diff.c: stop using index compat macrosNguyễn Thái Ngọc Duy, Jun 16, 2018
  27. Elijah NewrenJun 17, 2018
  28. Duy NguyenJun 17, 2018
  29. Brandon WilliamsJun 18, 2018
  30. Ben PeartJun 19, 2018
  31. Derrick StoleeJun 19, 2018
  32. Duy NguyenJun 19, 2018

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.