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

Re: [PATCH] git.c: remove the_repository dependence in run_builtin()

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 13, 2025, 04:49 UTC
Message-ID
<xmqq5xh0b60c.fsf@gitster.g>
In-Reply-To
<11AE19A1-7B19-45CE-AFCE-98D89A4570F7@smail.nju.edu.cn>
lidongyan <502024330056@smail.nju.edu.cn> writes:
Show 11 quoted lines
>>> The comment before trace_repo_setup() advises not to use get_git_dir(),
>>> but this note is unrelated to trace_repo_setup() itself. Additionally,
>>> get_git_dir() has now been renamed to repo_get_git_dir(). Remove this
>>> comment line.
>> ... 
> However, I believe this concern is no longer relevant:
> repo_get_git_dir() no longer sets up the Git repository environment as the
> original comment implied. Instead, all the necessary setup is now handled
> by setup_git_env(), which is invoked by setup_git_directory_gently() after
> the prefix has been determined. As a result, I believe it is no longer necessary
> to retain this comment message.

If so, please update the explanation. It reads as if the only reason for removing the comment is because of the rename of the function. If the reason is because the behaviour has changed and it is not relevant anymore, the readers should be told about it.

Thanks.
Previous: lidongyanNext: Lidong Yan
Message 4 of 16 in “git.c: remove the_repository dependence in run_builtin()”
  1. git.c: remove the_repository dependence in run_builtin()Lidong Yan, Jun 12, 2025
  2. Junio C HamanoJun 12, 2025
  3. lidongyanJun 13, 2025
  4. Junio C HamanoJun 13, 2025
  5. git.c: remove the_repository dependence in run_builtin()Lidong Yan, Jun 14, 2025
  6. Junio C HamanoJun 14, 2025
  7. Lidong YanJun 15, 2025
  8. Junio C HamanoJun 16, 2025
  9. Lidong YanJun 16, 2025
  10. Junio C HamanoJun 16, 2025
  11. 0/2 small fixes for git.c and setup.cLidong Yan, Jun 15, 2025
  12. 1/2 git.c: remove the_repository dependence in run_builtin()Lidong Yan, Jun 15, 2025
  13. 2/2 setup: fix NEEDSWORK in setup_git_directory_gently()Lidong Yan, Jun 15, 2025
  14. Junio C HamanoJun 16, 2025
  15. Lidong YanJun 16, 2025
  16. git.c: remove the_repository dependence in run_builtin()Lidong Yan, Jun 16, 2025

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.