Re: [PATCH v10] show-branch: convert per-branch flags to commit-slab
- From
- Gatla Vishweshwar Reddy <gatlavishweshwarreddy26@gmail.com>
- Date
- Jul 23, 2026, 21:33 UTC
- Message-ID
- <20260723213316.89081-1-gatlavishweshwarreddy26@gmail.com>
- In-Reply-To
- <xmqqo6fxe8rf.fsf@gitster.g>
> We are removing this initialization. Why? Have we changed the > API to make BSS initialization sufficient? Does the updated > code no longer use this structure? Do we initialize it > somewhere else now?
The init_commit_name_slab() call was removed by mistake in v7 when I restructured the initialization order. I moved the slab initialization for rev_flags_slab to after ref collection, and accidentally dropped the name_slab initialization entirely in the process. The API has not changed — BSS initialization is not sufficient because slab_size remains 0, causing division by zero when commit_to_name() tries to compute which slab page contains a commit's data using c->index / s->slab_size. The structure is still used throughout — name_commits(), name_commit(), name_parent() all call commit_to_name(). It is not initialized anywhere else. It was a plain mistake that I should have caught by running ./git show-branch master before sending.
> Firing off a new iteration before there is a rough consensus > on what it should look like is a total waste of everyone's time.
Understood. I will not send another version until I answer every question through discussion first.
> If you can resurrect and continue the chat session with the > AI agent that spawned the v9 patch, ask it why it decided > to delete that init_commit_name_slab() call.
The deletion happened when I restructured the initialization block in v7 — moving flags_stride and init_commit_rev_flags_with_stride to after ref collection. The name_slab init was in the same block and got dropped in the process. The AI did not flag it as significant because it was focused on the rev_flags_slab changes. I did not catch it because I did not run the binary. Both failures — the AI not flagging it and me not running it — are my failures to own.
Please ask me any questions you need answered to be satisfied this is a human-understood patch. I will answer each and move this patch forward.
Vishweshwar