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

[RFC PATCH v3 0/2] small fixes for git.c and setup.c

From
Lidong Yan <yldhome2d2@gmail.com>
Date
Jun 15, 2025, 14:46 UTC
Message-ID
<20250615144604.1447302-1-502024330056@smail.nju.edu.cn>
In-Reply-To
<20250614050331.304405-1-502024330056@smail.nju.edu.cn>

I've been reading through the git code from the beginning. This patch series fixes some NEEDSWORKs and cleans up some unnecessary uses of the_repository that I came across.

The first commit replace the use of the_repository to run_builtin()'s argument repo. Since each caller pass the_repository to run_builtin(), this replacement is safe. This commit also rewrite a comment before trace_repo_setup(), I am not sure my version of rewrite match the code semantics. So I am reaching out for help and hoping to get some feedback and discussion.

The second commit takes care of a NEEDSWORK in setup_git_directory_gently() we now properly error out if we hit a .git that is not a file or directory when looking for the .git.

Lidong Yan (2):
  git.c: remove the_repository dependence in run_builtin()
  setup: fix NEEDSWORK in setup_git_directory_gently()
 git.c      |  6 +++---
 setup.c    | 11 +++++++----
 setup.h    | 18 +++++++++++-------
 worktree.c |  4 ++--
 4 files changed, 23 insertions(+), 16 deletions(-)
-- 
2.50.0-rc1
Previous: Junio C HamanoNext: Lidong Yan
Message 11 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.