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

Re: [PATCH 1/5] grep: perform some minor code and comment cleanups

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 19, 2024, 00:32 UTC
Message-ID
<xmqqjzlzt61d.fsf@gitster.g>
In-Reply-To
<CAPig+cQ6Y2oOaPkKFsD41beXLHjhD++nmf59xrcswpb6_Q-sdA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
> It's entirely subjective, of course, so no right-or-wrong answer, but
> I personally do not find that this change improves code quality or
> readability.

I agree that this is entirely subjective. To those who wrote these variable decls and inits, what they wrote was the most readable, wasn't it? It probably falls into the "to some readers the existing code may not be perfect, but once it is written, it is not worth a patch noise to fix it" category.

> With my reviewer hat on, I spent an inordinate amount of time staring
> at this change trying to locate each variable's new location to verify
> that no initializers were dropped and that the declared type hadn't
> changed.

It is true that "cleaning up, no behaviour changes intended" patches are unpleasant to review. They are boring to read, and the risk of breakage due to mistake is unnecessary and severe.

But if the result is objectively better, such a one-time cost may be worth it. We are investing into the better future. For example, we may have an unsorted mess of an enum definition, and we do appreciate in the longer run, such a definition were "more or less" sorted within the constraint of some other criteria (like, "errors get negative value"). If the enum is a huge one, it may need some careful reviewing to verify such a change that turns the unsorted mess into a sorted nice list, but the cost of doing so may be justified.

Does the change in this patch qualify as "objectively better"? I dunno.

Thanks.
Previous: Dragan SimicNext: Dragan Simic
Message 16 of 22 in “New config option for git-grep to include untracked files”
  1. 0/5 New config option for git-grep to include untracked filesDragan Simic, Mar 18, 2024
  2. 3/5 grep docs: describe --no-index furtherDragan Simic, Mar 18, 2024
  3. Junio C HamanoMar 19, 2024
  4. Dragan SimicMar 19, 2024
  5. 4/5 grep: introduce new config option to include untracked filesDragan Simic, Mar 18, 2024
  6. Junio C HamanoMar 19, 2024
  7. Dragan SimicMar 19, 2024
  8. Junio C HamanoMar 19, 2024
  9. Dragan SimicMar 19, 2024
  10. 2/5 grep docs: describe --recurse-submodules further and improve formatting a bitDragan Simic, Mar 18, 2024
  11. Eric SunshineMar 18, 2024
  12. Dragan SimicMar 18, 2024
  13. 1/5 grep: perform some minor code and comment cleanupsDragan Simic, Mar 18, 2024
  14. Eric SunshineMar 18, 2024
  15. Dragan SimicMar 18, 2024
  16. Junio C HamanoMar 19, 2024
  17. Dragan SimicMar 19, 2024
  18. 5/5 grep docs: describe new config option to include untracked filesDragan Simic, Mar 18, 2024
  19. Junio C HamanoMar 19, 2024
  20. Dragan SimicMar 19, 2024
  21. Junio C HamanoMar 19, 2024
  22. Dragan SimicMar 19, 2024

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.