public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Kristoffer Haugsbakk <code@khaugsbakk.name>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/1] config: add back code comment
Date: Mon, 29 Jan 2024 12:32:19 +0100	[thread overview]
Message-ID: <ZbeMw5tgY9S6k6y6@tanuki> (raw)
In-Reply-To: <48d66e94ece3b763acbe933561d82157c02a5f58.1706466321.git.code@khaugsbakk.name>

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

On Sun, Jan 28, 2024 at 07:31:40PM +0100, Kristoffer Haugsbakk wrote:
> c15129b699 (config: factor out global config file retrieval, 2024-01-18)
> was a refactor that moved some of the code in this function to
> `config.c`. However, in the process I managed to drop this code comment
> which explains `$HOME not set`.
> 
> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
> ---
>  builtin/config.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/builtin/config.c b/builtin/config.c
> index 08fe36d499..b55bfae7d6 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -710,6 +710,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
>  	if (use_global_config) {
>  		given_config_source.file = git_global_config();
>  		if (!given_config_source.file)
> +			/*
> +			 * It is unknown if HOME/.gitconfig exists, so
> +			 * we do not know if we should write to XDG
> +			 * location; error out even if XDG_CONFIG_HOME
> +			 * is set and points at a sane location.
> +			 */
>  			die(_("$HOME not set"));
>  		given_config_source.scope = CONFIG_SCOPE_GLOBAL;
>  	} else if (use_system_config) {

Thanks for adding the comment back in! The patch looks good to me.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-29 11:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28 18:31 [PATCH 0/1] config: add back code comment Kristoffer Haugsbakk
2024-01-28 18:31 ` [PATCH 1/1] " Kristoffer Haugsbakk
2024-01-29 11:32   ` Patrick Steinhardt [this message]
2024-01-29 18:28     ` Junio C Hamano
2024-01-29 17:57   ` [PATCH v2 0/1] " Kristoffer Haugsbakk
2024-01-29 17:57     ` [PATCH v2 1/1] " Kristoffer Haugsbakk

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=ZbeMw5tgY9S6k6y6@tanuki \
    --to=ps@pks.im \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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