Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Abhinav Gupta via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Abhinav Gupta <mail@abhinavg.net>
Subject: Re: [PATCH] sequencer: remove todo_add_branch_context.commit
Date: Tue, 12 May 2026 08:36:13 +0200	[thread overview]
Message-ID: <agLKVn6RF4UBYd_8@pks.im> (raw)
In-Reply-To: <pull.2111.git.1778502113485.gitgitgadget@gmail.com>

On Mon, May 11, 2026 at 12:21:53PM +0000, Abhinav Gupta via GitGitGadget wrote:
> From: Abhinav Gupta <mail@abhinavg.net>
> 
> The 'commit' field in 'struct todo_add_branch_context' is unused.
> It's written to, but never read from.
> add_decorations_to_list() gets the commit passed to it explicitly
> as an argument.

To add some historic flavor: the struct has been introduced via
900b50c242 (rebase: add --update-refs option, 2022-07-19), and the
`commit` field was already unused back then.

> diff --git a/sequencer.c b/sequencer.c
> index b7d8dca47f..19839da1e6 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -6409,7 +6409,6 @@ struct todo_add_branch_context {
>  	size_t items_nr;
>  	size_t items_alloc;
>  	struct strbuf *buf;
> -	struct commit *commit;
>  	struct string_list refs_to_oids;
>  };
>  
> @@ -6498,7 +6497,6 @@ static int todo_list_add_update_ref_commands(struct todo_list *todo_list)
>  		ctx.items[ctx.items_nr++] = todo_list->items[i++];
>  
>  		if (item->commit) {
> -			ctx.commit = item->commit;
>  			add_decorations_to_list(item->commit, &ctx);
>  		}

Nit: while at it we could've also dropped the curly braces according to
our coding guidelines. But that alone isn't worth a reroll.

Other than that this is a welcome cleanup, thanks!

Patrick

      reply	other threads:[~2026-05-12  6:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 12:21 [PATCH] sequencer: remove todo_add_branch_context.commit Abhinav Gupta via GitGitGadget
2026-05-12  6:36 ` Patrick Steinhardt [this message]

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=agLKVn6RF4UBYd_8@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=mail@abhinavg.net \
    /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