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

Re: [Outreachy][PATCH] builtin/update-server-info: remove the_repository global variable

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2025, 17:12 UTC
Message-ID
<xmqqikphbu6b.fsf@gitster.g>
In-Reply-To
<20250210142820.3588250-1-usmanakinyemi202@gmail.com>
Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
> Remove the_repository global variable in favor of the repository
> argument that gets passed in "builtin/upload-server-info.c".
update? upload?

I somehow thought that dumb HTTP walker support was on the chopping list for Git 3.0 but apparently it isn't, so updating this remote corner of the system I thought nobody cared about is a good thing.

I personally feel that from here ...
Show 10 quoted lines
> The RUN_SETUP macro is used in "git.c" when the 'update-server-info'
> command is wired to the 'cmd_update_server_info()' function."
> This means we can be sure that the `run_builtin()` function inside
> "git.c" will always pass a valid `repo` variable to `cmd_update_server_info()`
> when the `update-server-info` command is run inside a Git repository.
>
> When the command is run outside a Git repository without the `-h`
> option, the command will fail (`die`) inside the `run_builtin()` function
> when the `setup_git_directory()` is called. So, the `cmd_update_server_info()`
> would not be called at all.
... to here are way too verbose and unnecessary.
> When `-h` is passed to the command outside a
> Git repository, the `run_builtin()` will call the `cmd_update_server_info()`
> function with `repo` set as NULL.
"set as NULL" -> "set to NULL"?
   ... and then early in the function, "parse_options()" call will give
   the options help and exit, without having to consult much of the
   configuration file.  So it is safe to omit reading the config
   when `repo` argument the caller gave us is NULL.

and that would be sufficient. All the rest of the proposed commit log message can also be removed, I think.

Thanks.
Previous: Usman AkinyemiNext: Usman Akinyemi
Message 2 of 6 in “builtin/update-server-info: remove the_repository global variable”
  1. Usman AkinyemiFeb 10, 2025
  2. Junio C HamanoFeb 10, 2025
  3. Usman AkinyemiFeb 10, 2025
  4. [Outreachy][PATCH v2] builtin/update-server-info: remove the_repository global variableUsman Akinyemi, Feb 10, 2025
  5. Patrick SteinhardtFeb 11, 2025
  6. Junio C HamanoFeb 11, 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.