git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] setup: fix reinit of repos with incompatible GIT_DEFAULT_REF_FORMAT
Date: Mon, 3 Feb 2025 16:02:05 +0100	[thread overview]
Message-ID: <Z6DabWZqB5QJed3F@pks.im> (raw)
In-Reply-To: <xmqqikpryvnm.fsf@gitster.g>

On Mon, Feb 03, 2025 at 06:01:33AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > So from my point of view we should treat the environment variables the
> > same as we treat "init.defaultRefFormat" and "init.defaultObjectFormat".
> > Those indicate defaults, but do not cause us to change the format of
> > existing repostiories.
> 
> Hmph, as somebody who often does things like
> 
>     $ GIT_EDITOR=: git do-something
>     $ GIT_AUTHOR_NAME=foo GIT_AUTHOR_EMAIL=bar@baz git commit -a
> 
> I do not necessarily see the environment variables as replacement
> for configured defaults.  They are, at least to me, more like a
> single-shot override of the configured defaults, so if we were to
> complain and error out command line options (we do do so, don't we?),
> I would expect the environment variable that gives a single-shot
> setting to be treated the same way.

Especially the second one is a good example though that works mostly as
I propose: GIT_AUTHOR_NAME will impact _new_ commits, but not _existing_
ones when you for example `--amend` the commit. So this is somewhat
equivalent to how both GIT_DEFAULT_REF_FORMAT and GIT_DEFAULT_HASH work
with git-init(1), isn't it?

Patrick

  reply	other threads:[~2025-02-03 15:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 16:24 [PATCH 0/3] setup: fix reinit of repos with different formats Patrick Steinhardt
2025-01-30 16:24 ` [PATCH 1/3] t0001: remove duplicate test Patrick Steinhardt
2025-01-30 16:24 ` [PATCH 2/3] setup: fix reinit of repos with incompatible GIT_DEFAULT_REF_FORMAT Patrick Steinhardt
2025-01-30 22:40   ` Junio C Hamano
2025-01-31 22:38   ` Junio C Hamano
2025-02-03  5:29     ` Patrick Steinhardt
2025-02-03 14:01       ` Junio C Hamano
2025-02-03 15:02         ` Patrick Steinhardt [this message]
2025-01-30 16:24 ` [PATCH 3/3] setup: fix reinit of repos with incompatible GIT_DEFAULT_HASH Patrick Steinhardt
2025-01-31 22:40   ` Junio C Hamano
2025-01-30 23:58 ` [PATCH 0/3] setup: fix reinit of repos with different formats brian m. carlson

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=Z6DabWZqB5QJed3F@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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;
as well as URLs for NNTP newsgroup(s).