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

Re: [PATCH v2 2/3] builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.h

From
John Cai <johncai86@gmail.com>
Date
Sep 13, 2024, 18:00 UTC
Message-ID
<CAOCgCU+Fh_mpRsx_wT72j0_m2Pk4Zuri+zfu8W2qeQ1bUZjd8A@mail.gmail.com>
In-Reply-To
<xmqqikv26oq4.fsf@gitster.g>
On Wed, Sep 11, 2024 at 2:15 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
>
> "John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: John Cai <johncai86@gmail.com>
> >
> > Instead of including USE_THE_REPOSITORY_VARIABLE by default on every
> > builtin, remove it from builtin.h and add it to all the builtins that
> > reference the_repository.
> >
> > Also, remove the include statement for repository.h since it gets
> > brought in through builtin.h.
>
> Can we have _all_ builtin/*.c files that include "builtin.h" to gain
> "#define USE_THE_REPOSITORY_VARIABLE" in this step to make it more
> mechanical?  That way we do not have to go through this large patch
> manually to review it.
>
> Then another patch can immediately remove the "#define" (and doing
> nothing else) from some of the files in builtin/*.c with its commit
> message saying "These do not need implicit or explicit accesses to
> the_repository as-is", which would make it trivially reviewable,
> because such a claim in its commit message can trivially be verified
> by simply compiling these files.
>
> After that, manual work to remove implicit or explicit accesses to
> the_repository, which would remove the "#define" that becomes
> unnecessary, one-patch-per-file can build on top.  Each of them
> would be reviewable again.
Okay I see what you mean. Yeah I can do that.
Show 6 quoted lines
>
> > The next step will be to migrate each builtin
> > from having to use the_repository.
>
> I am not sure what this "to migrate" refers to.  Is it referring
> exactly the same thing as what I called "manual work" above?

Yes, by migrate I meant the process of removing #define and passing in the repository argument through to replace the_repository global.

> Thanks.
Previous: Junio C HamanoNext: John Cai via GitGitGadget
Message 17 of 32 in “Add repository parameter to builtins”
  1. 0/3 Add repository parameter to builtinsJohn Cai via GitGitGadget, Sep 5, 2024
  2. 2/3 builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.hJohn Cai via GitGitGadget, Sep 5, 2024
  3. Junio C HamanoSep 5, 2024
  4. Patrick SteinhardtSep 6, 2024
  5. Junio C HamanoSep 6, 2024
  6. 1/3 builtin: add a repository parameter for builtin functionsJohn Cai via GitGitGadget, Sep 5, 2024
  7. Patrick SteinhardtSep 6, 2024
  8. John CaiSep 9, 2024
  9. 3/3 add: pass in repo variable instead of global the_repositoryJohn Cai via GitGitGadget, Sep 5, 2024
  10. Patrick SteinhardtSep 6, 2024
  11. Junio C HamanoSep 5, 2024
  12. 0/3 Add repository parameter to builtinsJohn Cai via GitGitGadget, Sep 10, 2024
  13. 3/3 add: pass in repo variable instead of global the_repositoryJohn Cai via GitGitGadget, Sep 10, 2024
  14. Junio C HamanoSep 11, 2024
  15. 2/3 builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.hJohn Cai via GitGitGadget, Sep 10, 2024
  16. Junio C HamanoSep 11, 2024
  17. John CaiSep 13, 2024
  18. 1/3 builtin: add a repository parameter for builtin functionsJohn Cai via GitGitGadget, Sep 10, 2024
  19. Junio C HamanoSep 10, 2024
  20. Junio C HamanoSep 11, 2024
  21. Patrick SteinhardtSep 12, 2024
  22. Jeff KingSep 12, 2024
  23. Jeff KingSep 12, 2024
  24. Patrick SteinhardtSep 12, 2024
  25. John CaiSep 13, 2024
  26. 0/4 Add repository parameter to builtinsJohn Cai via GitGitGadget, Sep 13, 2024
  27. 1/4 builtin: add a repository parameter for builtin functionsJohn Cai via GitGitGadget, Sep 13, 2024
  28. 3/4 builtin: remove USE_THE_REPOSITORY for those without the_repositoryJohn Cai via GitGitGadget, Sep 13, 2024
  29. 2/4 builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.hJohn Cai via GitGitGadget, Sep 13, 2024
  30. Junio C HamanoSep 13, 2024
  31. 4/4 add: pass in repo variable instead of global the_repositoryJohn Cai via GitGitGadget, Sep 13, 2024
  32. Junio C HamanoSep 13, 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.