From: Junio C Hamano <gitster@pobox•com>
To: Usman Akinyemi <usmanakinyemi202@gmail•com>
Cc: git@vger•kernel.org, christian.couder@gmail•com, ps@pks•im,
shejialuo@gmail•com, johncai86@gmail•com,
Christian Couder <chriscool@tuxfamily•org>
Subject: Re: [Outreachy][PATCH] builtin/update-server-info: remove the_repository global variable
Date: Mon, 10 Feb 2025 09:12:28 -0800 [thread overview]
Message-ID: <xmqqikphbu6b.fsf@gitster.g> (raw)
In-Reply-To: <20250210142820.3588250-1-usmanakinyemi202@gmail.com> (Usman Akinyemi's message of "Mon, 10 Feb 2025 19:58:10 +0530")
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 ...
> 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.
next prev parent reply other threads:[~2025-02-10 17:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 14:28 [Outreachy][PATCH] builtin/update-server-info: remove the_repository global variable Usman Akinyemi
2025-02-10 17:12 ` Junio C Hamano [this message]
2025-02-10 18:03 ` Usman Akinyemi
2025-02-10 18:10 ` [Outreachy][PATCH v2] " Usman Akinyemi
2025-02-11 7:43 ` Patrick Steinhardt
2025-02-11 16:35 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqikphbu6b.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=chriscool@tuxfamily$(echo .)org \
--cc=christian.couder@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=johncai86@gmail$(echo .)com \
--cc=ps@pks$(echo .)im \
--cc=shejialuo@gmail$(echo .)com \
--cc=usmanakinyemi202@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox