git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Emily Shaffer <emilyshaffer@google.com>
Cc: git@vger.kernel.org, Matthew Rogers <mattr94@gmail.com>,
	Philip Oakley <philipoakley@iee.email>
Subject: Re: [PATCH] config: add string mapping for enum config_scope
Date: Wed, 11 Dec 2019 14:19:57 -0800	[thread overview]
Message-ID: <xmqqsglqmrn6.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20191211220933.48678-1-emilyshaffer@google.com> (Emily Shaffer's message of "Wed, 11 Dec 2019 14:09:33 -0800")

Emily Shaffer <emilyshaffer@google.com> writes:

> If a user is interacting with their config files primarily by the 'git
> config' command, using the location flags (--global, --system, etc) then
> they may be more interested to see the scope of the config file they are
> editing, rather than the filepath.
>
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
> Note: This commit has been cherry-picked out of the "configuration-based
> hook management" topic, at
> lore.kernel.org/git/20191210023335.49987-1-emilyshaffer@google.com
>
> It turned out that I wanted to use it for git-bugreport as well - to
> explain the origin of the configs we are printing in the bugreport,
> without directly exposing the user's home directory path.
>
> This seems to have similar work to https://github.com/gitgitgadget/git/pull/478
> which I believe hasn't been mailed yet; but that change is targeted
> towards the builtin config command, rather than the config library.
> Since I wanted to use the library, I'm sending on my own now. Maybe
> this commit will be useful to that change's author.

One thing I wondered about this in the original version was if the
returned value should be localized.  In the context of the original,
the --porcelain mode refused to give this information in its output,
so it was OK to always localize the returned value to satisify the
other caller who wanted end-user-facing output.

But as a more general helper, I am not sure if this is the most
useful way to implement it.  Shouldn't the function rather return
the machine-readable tokens and allow callers to localize it as
needed with its own _() around the returned value?  I dunno.


  reply	other threads:[~2019-12-11 22:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 22:09 [PATCH] config: add string mapping for enum config_scope Emily Shaffer
2019-12-11 22:19 ` Junio C Hamano [this message]
2019-12-11 23:11   ` Emily Shaffer
2019-12-11 23:14     ` Matt Rogers
2019-12-11 23:27       ` Emily Shaffer
2019-12-11 23:25     ` Emily Shaffer

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsglqmrn6.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=mattr94@gmail.com \
    --cc=philipoakley@iee.email \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).