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

Re: [PATCH v2] stash: add 'reword' subcommand

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 11, 2026, 12:49 UTC
Message-ID
<ansaTmLSGUjWegFG@pks.im>
In-Reply-To
<xmqq4ihjf7ds.fsf@gitster.g>
On Tue, Jul 28, 2026 at 08:42:23AM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > I wonder if the reflog API needs to be extended before we can
> > implement this properly.  I imagine a set of functions like (there
> > may be others)
> >
> >  * refs_reflog_replace(ref_stash, idx, &reflog_data);
> >  * refs_reflog_edit_in_bulk(ref_stash, num_edit, reflog_edit[]);
> >
> > will become the foundations of such a feature.
> 
> On further thought, I think this fits pretty well into the general
> architecture of the refs subsystem.  Both backends would need
> refs_reflog_edit_in_bulk() in their vtable, while the single-entry
> edit can just be a thin wrapper passing a single-element
> reflog_edit[] array with a 'replace' operation.

Our reflog interfaces are still quite awful, but they have recently evolved so that we can at least batch-commit reflog entries via our transaction interfaces. They are still severely lacking though, and I haven't yet had the time (or motivation) to improve upon this.

> If someone is interested in implementing this, there are a few
> tricky details to be careful about:

I think instead of introducing the proposed interface, we should first investigate whether we can make the reference transactions more powerful to allow for all of these use cases.

Thanks!
Patrick
Previous: Junio C Hamano
Message 12 of 12 in “stash: add 'rename' subcommand”
  1. stash: add 'rename' subcommandEmin Özata via GitGitGadget, Jul 16, 2026
  2. Patrick SteinhardtJul 16, 2026
  3. Junio C HamanoJul 16, 2026
  4. brian m. carlsonJul 16, 2026
  5. Junio C HamanoJul 17, 2026
  6. erik88Jul 26, 2026
  7. Junio C HamanoJul 27, 2026
  8. EminJul 27, 2026
  9. stash: add 'reword' subcommandEmin Özata via GitGitGadget, Jul 27, 2026
  10. Junio C HamanoJul 27, 2026
  11. Junio C HamanoJul 28, 2026
  12. Patrick SteinhardtAug 11, 2026

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.