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

Re: [PATCH v2 0/2] rebase: stop setting GIT_REFLOG_ACTION

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Nov 9, 2022, 16:30 UTC
Message-ID
<28100f66-bd3d-d564-cb40-44b65ef415bc@dunelm.org.uk>
In-Reply-To
<221109.86leokp0vm.gmgdl@evledraar.gmail.com>
On 09/11/2022 16:05, Ævar Arnfjörð Bjarmason wrote:
Show 49 quoted lines
> 
> On Wed, Nov 09 2022, Phillip Wood via GitGitGadget wrote:
> 
>> This is a follow up to pw/rebase-reflog-fixes that moves away from using
>> GIT_REFLOG_ACTION internally.
>>
>> Thanks to Taylor & Ævar for their comments on V1. I've updated the commit
>> message of patch 1 as suggested by Taylor, the code is unchanged.
>>
>> Phillip Wood (2):
>>    sequencer: stop exporting GIT_REFLOG_ACTION
>>    rebase: stop exporting GIT_REFLOG_ACTION
>>
>>   builtin/rebase.c | 27 +++++++++++++++------------
>>   sequencer.c      | 45 +++++++++++++++++++++++++--------------------
>>   sequencer.h      |  6 ++++++
>>   3 files changed, 46 insertions(+), 32 deletions(-)
>>
>>
>> base-commit: 3b08839926fcc7cc48cf4c759737c1a71af430c1
>> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1405%2Fphillipwood%2Fmore-rebase-reflog-fixes-v2
>> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1405/phillipwood/more-rebase-reflog-fixes-v2
>> Pull-Request: https://github.com/gitgitgadget/git/pull/1405
>>
>> Range-diff vs v1:
>>
>>   1:  e9c3f5ac5c6 ! 1:  655b4e89f59 sequencer: stop exporting GIT_REFLOG_ACTION
>>       @@ Commit message
>>            pass the reflog action around in a variable and use it to set
>>            GIT_REFLOG_ACTION in the child environment when running "git commit".
>>        
>>       +    Within the sequencer GIT_REFLOG_ACTION is no longer set and is only read
>>       +    by sequencer_reflog_action(). It is still set by rebase before calling
>>       +    the sequencer, that will be addressed in the next commit. cherry-pick
>>       +    and revert are unaffected as they do not set GIT_REFLOG_ACTION before
>>       +    calling the sequencer.
>>       +
>>            Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
>>        
>>         ## sequencer.c ##
>>   2:  d3747bcc8d1 = 2:  31df037eafe rebase: stop exporting GIT_REFLOG_ACTION
> 
> Thanks, FWIW I'm happy to give this my "Reviewed-by", per [1] I've
> looked this over carefully.
> 
> The tl;dr of that is that this fixes a leak, and adds another one, but
> the root cause of the added one is that you're using an existing
> destructor that we sometimes don't call, which we can just address as a
> follow-up generic issue (I've got patches to fix it).

It is worth noting that the leak that is fixed was unbounded and grew with each commit whereas the new one is a fixed size and is only a "leak" because we don't clean up properly when exiting.

Show 6 quoted lines
> But for now this is a good step forward, and fixes the leak that's
> "unique" t this codepath.
> 
> And of course, just makes managing the "reflog" variable nicer in
> general, as we're no longer talking to ourselves within the same process
> with setenv()/getenv().
Yes, that was the main aim really
Best Wishes
Phillip
> 1. https://lore.kernel.org/git/221108.864jv9sc9r.gmgdl@evledraar.gmail.com/
Previous: Ævar Arnfjörð BjarmasonNext: Taylor Blau
Message 17 of 18 in “rebase: stop setting GIT_REFLOG_ACTION”
  1. 0/2 rebase: stop setting GIT_REFLOG_ACTIONPhillip Wood via GitGitGadget, Nov 4, 2022
  2. 1/2 sequencer: stop exporting GIT_REFLOG_ACTIONPhillip Wood via GitGitGadget, Nov 4, 2022
  3. Taylor BlauNov 4, 2022
  4. Ævar Arnfjörð BjarmasonNov 7, 2022
  5. Phillip WoodNov 7, 2022
  6. Phillip WoodNov 8, 2022
  7. Ævar Arnfjörð BjarmasonNov 8, 2022
  8. 2/2 rebase: stop exporting GIT_REFLOG_ACTIONPhillip Wood via GitGitGadget, Nov 4, 2022
  9. Taylor BlauNov 4, 2022
  10. Taylor BlauNov 4, 2022
  11. Ævar Arnfjörð BjarmasonNov 7, 2022
  12. Taylor BlauNov 7, 2022
  13. 0/2 rebase: stop setting GIT_REFLOG_ACTIONPhillip Wood via GitGitGadget, Nov 9, 2022
  14. 1/2 sequencer: stop exporting GIT_REFLOG_ACTIONPhillip Wood via GitGitGadget, Nov 9, 2022
  15. 2/2 rebase: stop exporting GIT_REFLOG_ACTIONPhillip Wood via GitGitGadget, Nov 9, 2022
  16. Ævar Arnfjörð BjarmasonNov 9, 2022
  17. Phillip WoodNov 9, 2022
  18. Taylor BlauNov 9, 2022

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.