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

Patrick Steinhardt <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 08:42:23AM -0700, Junio C Hamano wrote:
> Junio C Hamano <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.