All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH 1/2] sequencer: stop exporting GIT_REFLOG_ACTION
Date: Tue, 8 Nov 2022 09:54:05 +0000	[thread overview]
Message-ID: <16baa0cd-0797-4427-3e39-e5ffd2dca544@dunelm.org.uk> (raw)
In-Reply-To: <03cd4cdb-5f6b-11b9-1959-d58d5b544565@dunelm.org.uk>

Hi Ævar

On 07/11/2022 19:35, Phillip Wood wrote:
>>> @@ -5116,7 +5121,7 @@ static int single_pick(struct repository *r,
>>>               TODO_PICK : TODO_REVERT;
>>>       item.commit = cmit;
>>> -    setenv(GIT_REFLOG_ACTION, action_name(opts), 0);
>>> +    opts->reflog_message = sequencer_reflog_action(opts);
>>>       return do_pick_commit(r, &item, opts, 0, &check_todo);
>>
>> Here you're adding a new memory leak, which you can see if you run
>> e.g. the 1st test of ./t1013-read-tree-submodule.sh before & after this
>> change.

What's a read-tree test using rebase for? I find the submodule tests 
completely incomprehensible. It is calling 
test_submodule_switch_recursing_with_args() which does not call rebase 
directly but who knows what is going on in all the helper functions. 
Have you got a simple example of a test which shows a new leak?

> I'm not sure how, opts->reflog_message will be a copy of 
> opts->reflog_action which is freed at the end of the rebase. I'll have a 
> proper look tomorrow to see if I'm missing something.

So it is possible this is showing up because I think we only free the 
heap allocated members of opts in sequencer_remove_state() and that is 
not called when we stop for a conflict resolution, a break command, a 
failed exec or a rescheduled pick/reset etc. The way to fix that would 
be to refactor sequencer_remove_state() to create replay_opts_release() 
and call that from builtin/{revert,rebase}.c

As that is unrelated to removing the setenv() calls which is the focus 
of this series I will not be doing that in this series.

> Best Wishes
> 
> Phillip

  reply	other threads:[~2022-11-08  9:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 15:19 [PATCH 0/2] rebase: stop setting GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-11-04 15:19 ` [PATCH 1/2] sequencer: stop exporting GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-11-04 21:56   ` Taylor Blau
2022-11-07 16:12   ` Ævar Arnfjörð Bjarmason
2022-11-07 19:35     ` Phillip Wood
2022-11-08  9:54       ` Phillip Wood [this message]
2022-11-08 14:51         ` Ævar Arnfjörð Bjarmason
2022-11-04 15:19 ` [PATCH 2/2] rebase: " Phillip Wood via GitGitGadget
2022-11-04 21:49 ` [PATCH 0/2] rebase: stop setting GIT_REFLOG_ACTION Taylor Blau
2022-11-04 21:49   ` Taylor Blau
2022-11-07 15:51   ` Ævar Arnfjörð Bjarmason
2022-11-07 19:56     ` Taylor Blau
2022-11-09 14:21 ` [PATCH v2 " Phillip Wood via GitGitGadget
2022-11-09 14:21   ` [PATCH v2 1/2] sequencer: stop exporting GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-11-09 14:21   ` [PATCH v2 2/2] rebase: " Phillip Wood via GitGitGadget
2022-11-09 16:05   ` [PATCH v2 0/2] rebase: stop setting GIT_REFLOG_ACTION Ævar Arnfjörð Bjarmason
2022-11-09 16:30     ` Phillip Wood
2022-11-09 23:17       ` Taylor Blau

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=16baa0cd-0797-4427-3e39-e5ffd2dca544@dunelm.org.uk \
    --to=phillip.wood123@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.