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

Re: [PATCH 4/5] cocci: apply rules to rewrite callers of "refs" interfaces

From
Patrick Steinhardt <ps@pks.im>
Date
May 6, 2024, 06:35 UTC
Message-ID
<Zjh6K2mxcwTPIJgY@tanuki>
In-Reply-To
<xmqqy18q66sp.fsf@gitster.g>
On Fri, May 03, 2024 at 12:20:54PM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Taylor Blau <me@ttaylorr.com> writes:
> 
> > I don't think it's wrong per-se to use the_repository here, but it does
> > create something to clean up in the future.
> 
> Very true.  This change can be mechanically reproduced on top of an
> updated codebase.  Such a semantic fix should come on top and it is
> better to leave them clearly separated.

Agreed. As I mentioned in my patch series that gets rid of `the_index`, I'm taking a bottom-up approach to these kinds of refactorings. At every step, I want to move `the_repository` one layer further up the call chain. This of course means that we're now in a state where many of the callers already have a proper repository at hand, but don't use it. Those would then get addressed in the next step.

I think leaving that cleanup to a future series needs to be fine. While it punts some work to the future, that is a necessity in any large-scope refactorings like getting rid of `the_repository` anyway. Otherwise, the scope of any such patch series would likely explode.

But to me, the main benefit is that we do not have to worry about whether the refactoring is correct or not. We know that it behaves exactly the same as before, which may not be the case when we started to use caller-provided repositories. So I'd rather want to keep mechanical patch series like this one separated from patch series that actually start to change semantics.

Patrick
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 10 of 32 in “refs: remove functions without ref store”
  1. 0/5 refs: remove functions without ref storePatrick Steinhardt, May 3, 2024
  2. 1/5 refs: introduce missing functions that accept a `struct ref_store`Patrick Steinhardt, May 3, 2024
  3. Junio C HamanoMay 3, 2024
  4. 2/5 refs: add `exclude_patterns` parameter to `for_each_fullref_in()`Patrick Steinhardt, May 3, 2024
  5. Taylor BlauMay 3, 2024
  6. 3/5 cocci: introduce rules to transform "refs" to pass ref storePatrick Steinhardt, May 3, 2024
  7. 4/5 cocci: apply rules to rewrite callers of "refs" interfacesPatrick Steinhardt, May 3, 2024
  8. Taylor BlauMay 3, 2024
  9. Junio C HamanoMay 3, 2024
  10. Patrick SteinhardtMay 6, 2024
  11. 5/5 refs: remove functions without ref storePatrick Steinhardt, May 3, 2024
  12. James LiuMay 6, 2024
  13. Junio C HamanoMay 3, 2024
  14. Jeff KingMay 3, 2024
  15. Junio C HamanoMay 3, 2024
  16. Patrick SteinhardtMay 6, 2024
  17. Junio C HamanoMay 6, 2024
  18. Patrick SteinhardtMay 7, 2024
  19. Junio C HamanoMay 7, 2024
  20. Patrick SteinhardtMay 7, 2024
  21. Junio C HamanoMay 7, 2024
  22. Jeff KingMay 9, 2024
  23. Patrick SteinhardtMay 10, 2024
  24. Taylor BlauMay 3, 2024
  25. Junio C HamanoMay 3, 2024
  26. 0/5 refs: remove functions without ref storePatrick Steinhardt, May 7, 2024
  27. 1/5 refs: introduce missing functions that accept a `struct ref_store`Patrick Steinhardt, May 7, 2024
  28. 2/5 refs: add `exclude_patterns` parameter to `for_each_fullref_in()`Patrick Steinhardt, May 7, 2024
  29. 3/5 cocci: introduce rules to transform "refs" to pass ref storePatrick Steinhardt, May 7, 2024
  30. 4/5 cocci: apply rules to rewrite callers of "refs" interfacesPatrick Steinhardt, May 7, 2024
  31. 5/5 refs: remove functions without ref storePatrick Steinhardt, May 7, 2024
  32. Taylor BlauMay 7, 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.