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

Re: GIT_COMMITTER_* and reflog

From
Philip Oakley <philipoakley@iee.email>
Date
Nov 7, 2019, 13:57 UTC
Message-ID
<3d6e0a08-673d-e83d-d18d-8153840d185d@iee.email>
In-Reply-To
<201910260243.23627.luke@dashjr.org>
copying Dscho,
On 26/10/2019 03:43, Luke Dashjr wrote:
Show 11 quoted lines
> On Saturday 26 October 2019 02:20:39 Jonathan Nieder wrote:
>> Luke Dashjr wrote:
>>> It appears the reflog currently allows its log data (name and date) to be
>>> overridden by the GIT_COMMITTER_* environment variables. At least for my
>>> workflow, this kinda breaks the reflog (as I regularly set
>>> GIT_COMMITTER_DATE to produce deterministic commit objects).
>> Can you say more about this?  What is the workflow this is part of?  Can
>> you describe a sequence of steps and how you are affected during those
>> steps?
> I maintain a bleeding-edge variant of a more stable project, which is
> constantly being rebased on the latest stable version.

This looks to have a strong similarity to the Git-for-Windows patches which are regularly rebased on top of this here upstream Git.

Dscho uses the `garden shears` script [1] to help update the patch set, in conjunction with the 'updated' --rebase-merges option (replaces the deprecated --preserve-merges).

Show 24 quoted lines
> To make this easier, I
> use a Perl script to generate the bleeding-edge version's git branches:
>      https://github.com/bitcoinknots/assemble-deriv
> It uses GIT_COMMITTER_DATE to ensure that I can repeatedly generate the branch
> until everything merges successfully, without polluting the repository with
> hundreds of merge commits each attempt. (Which would be annoying, since I
> literally never prune.)
>
> Because git's reflog also uses GIT_COMMITTER_DATE, my reflogs (HEAD in
> particular) get polluted with incorrect timestamps during this process.
>
>>> Is there a need to support this override for the reflog?
>> Yes.
>>
>>> Is there any reason it can't be changed to use GIT_REFLOG_* instead?
>> Would a new GIT_REFLOG_* set of envvars that overrides GIT_COMMITTER_*
>> work for you?  If I understand correctly, you could set
>> GIT_REFLOG_NAME and GIT_REFLOG_EMAIL to an appropriate identity, but
>> you wouldn't have a good value to put in GIT_REFLOG_DATE.
>>
>> If GIT_COMMITTER_{NAME,EMAIL} were used when writing reflogs but
>> GIT_COMMITTER_DATE weren't, would that help with your workflow?
> Yes, it's really only GIT_COMMITTER_DATE that's messing me up personally.
> I never use GIT_COMMITTER_{NAME,EMAIL}.
-- 
Philip

[1] https://github.com/git-for-windows/build-extra/blob/master/shears.sh
Previous: Luke DashjrNext: Junio C Hamano
Message 4 of 9 in “GIT_COMMITTER_* and reflog”
  1. Luke DashjrOct 25, 2019
  2. Jonathan NiederOct 26, 2019
  3. Luke DashjrOct 26, 2019
  4. Philip OakleyNov 7, 2019
  5. Junio C HamanoOct 26, 2019
  6. Jeff KingOct 26, 2019
  7. Junio C HamanoOct 27, 2019
  8. Phillip WoodOct 29, 2019
  9. Jeff KingOct 29, 2019

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.