{"thread":{"id":"65614","subject":"[PATCH] sequencer: remove todo_add_branch_context.commit","startedAt":"2026-05-11T12:21:57Z","lastAt":"2026-05-12T06:36:28Z","messageCount":2,"participants":["Abhinav Gupta via GitGitGadget","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"543046","messageId":"pull.2111.git.1778502113485.gitgitgadget@gmail.com","threadId":"65614","inReplyTo":null,"subject":"[PATCH] sequencer: remove todo_add_branch_context.commit","fromName":"Abhinav Gupta via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-11T12:21:53Z","receivedAt":"2026-05-11T12:21:57Z","isPatch":true,"body":"From: Abhinav Gupta <mail@abhinavg.net>\n\nThe 'commit' field in 'struct todo_add_branch_context' is unused.\nIt's written to, but never read from.\nadd_decorations_to_list() gets the commit passed to it explicitly\nas an argument.\n\nSigned-off-by: Abhinav Gupta <mail@abhinavg.net>\n---\n    sequencer: remove todo_add_branch_context.commit\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2111%2Fabhinav%2Fsequencer-todoctx-rm-commit-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2111/abhinav/sequencer-todoctx-rm-commit-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2111\n\n sequencer.c | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex b7d8dca47f..19839da1e6 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -6409,7 +6409,6 @@ struct todo_add_branch_context {\n \tsize_t items_nr;\n \tsize_t items_alloc;\n \tstruct strbuf *buf;\n-\tstruct commit *commit;\n \tstruct string_list refs_to_oids;\n };\n \n@@ -6498,7 +6497,6 @@ static int todo_list_add_update_ref_commands(struct todo_list *todo_list)\n \t\tctx.items[ctx.items_nr++] = todo_list->items[i++];\n \n \t\tif (item->commit) {\n-\t\t\tctx.commit = item->commit;\n \t\t\tadd_decorations_to_list(item->commit, &ctx);\n \t\t}\n \t}\n\nbase-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0\n-- \ngitgitgadget\n"},{"id":"543143","messageId":"agLKVn6RF4UBYd_8@pks.im","threadId":"65614","inReplyTo":"pull.2111.git.1778502113485.gitgitgadget@gmail.com","subject":"Re: [PATCH] sequencer: remove todo_add_branch_context.commit","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-05-12T06:36:13Z","receivedAt":"2026-05-12T06:36:28Z","isPatch":true,"body":"On Mon, May 11, 2026 at 12:21:53PM +0000, Abhinav Gupta via GitGitGadget wrote:\n> From: Abhinav Gupta <mail@abhinavg.net>\n> \n> The 'commit' field in 'struct todo_add_branch_context' is unused.\n> It's written to, but never read from.\n> add_decorations_to_list() gets the commit passed to it explicitly\n> as an argument.\n\nTo add some historic flavor: the struct has been introduced via\n900b50c242 (rebase: add --update-refs option, 2022-07-19), and the\n`commit` field was already unused back then.\n\n> diff --git a/sequencer.c b/sequencer.c\n> index b7d8dca47f..19839da1e6 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -6409,7 +6409,6 @@ struct todo_add_branch_context {\n>  \tsize_t items_nr;\n>  \tsize_t items_alloc;\n>  \tstruct strbuf *buf;\n> -\tstruct commit *commit;\n>  \tstruct string_list refs_to_oids;\n>  };\n>  \n> @@ -6498,7 +6497,6 @@ static int todo_list_add_update_ref_commands(struct todo_list *todo_list)\n>  \t\tctx.items[ctx.items_nr++] = todo_list->items[i++];\n>  \n>  \t\tif (item->commit) {\n> -\t\t\tctx.commit = item->commit;\n>  \t\t\tadd_decorations_to_list(item->commit, &ctx);\n>  \t\t}\n\nNit: while at it we could've also dropped the curly braces according to\nour coding guidelines. But that alone isn't worth a reroll.\n\nOther than that this is a welcome cleanup, thanks!\n\nPatrick\n"}]}