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

Re: [PATCH 2/3] setup: fix reinit of repos with incompatible GIT_DEFAULT_REF_FORMAT

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 3, 2025, 15:02 UTC
Message-ID
<Z6DabWZqB5QJed3F@pks.im>
In-Reply-To
<xmqqikpryvnm.fsf@gitster.g>
On Mon, Feb 03, 2025 at 06:01:33AM -0800, Junio C Hamano wrote:
Show 18 quoted lines
> 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
Previous: Junio C HamanoNext: brian m. carlson
Message 10 of 11 in “setup: fix reinit of repos with different formats”
  1. 0/3 setup: fix reinit of repos with different formatsPatrick Steinhardt, Jan 30, 2025
  2. 1/3 t0001: remove duplicate testPatrick Steinhardt, Jan 30, 2025
  3. 3/3 setup: fix reinit of repos with incompatible GIT_DEFAULT_HASHPatrick Steinhardt, Jan 30, 2025
  4. Junio C HamanoJan 31, 2025
  5. 2/3 setup: fix reinit of repos with incompatible GIT_DEFAULT_REF_FORMATPatrick Steinhardt, Jan 30, 2025
  6. Junio C HamanoJan 30, 2025
  7. Junio C HamanoJan 31, 2025
  8. Patrick SteinhardtFeb 3, 2025
  9. Junio C HamanoFeb 3, 2025
  10. Patrick SteinhardtFeb 3, 2025
  11. brian m. carlsonJan 30, 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.