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

Re: unifying sequencer's options persisting, was Re: [PATCH v2] sequencer: fix edit handling for cherry-pick and revert messages

From
Elijah Newren <newren@gmail.com>
Date
Apr 2, 2021, 22:18 UTC
Message-ID
<CABPp-BEzayZkEZ36CFNBGz9X3jv0MNUnWa2EhzKKmWcb83yRmw@mail.gmail.com>
In-Reply-To
<xmqqa6qg4d0i.fsf@gitster.g>
On Fri, Apr 2, 2021 at 2:01 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
>
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
> > I think we would save a lot by only syncing the state to disk when we
> > stop or run an exec command (the state needs to be synced so exec
> > commands can alter the todo list). In those cases we need to write the
> > index and possibly run an external process so writing a couple of
> > files is probably insignificant.
>
> The optimization opportunity of this may be a lot smaller than you
> would think---you must cater to not just exec but hook scripts that
> are run while a new commit is made, which means every step you'd
> need to write anyway.

From Documentation/git-rebase.txt, right after discussing how the backends disagree on which hooks are called and how they are called:

...In each case, the calling of these hooks was by accident of implementation rather than by design (both backends were originally implemented as shell scripts and happened to invoke other commands like 'git checkout' or 'git commit' that would call the hooks). Both backends should have the same behavior, though it is not entirely clear which, if any, is correct. We will likely make rebase stop calling either of these hooks in the future.

Even if others now disagree with the above, I know I can get a huge speedup by changing sequencer to stop per-commit wasteful work (stop forking processes like "git commit", don't write control structures if the rebase hasn't ended or hit a conflict, don't update the working copy or index or reflog). It's enough of a speedup that if backward compatibility won't allow such a method to be used by default, I'd still make yet another backend that could be optionally used. And I'd have the default rebase and cherry-pick start printing annoying deprecation notices so that users become aware of a faster option. Should I go that route? t/helpers/test-fast-rebase.c already has a good start...

Show 11 quoted lines
> > Where I think we can usefully consolidate is the one-line files which
> > store the options rather than state - these are read an written much
> > less frequently so I don't think they have much of a performance hit
> > but it would be much nicer to just serialize the options to a single
> > file.
>
> Would that break external scripts, hooks, etc.?  I am not sure if we
> even have any rough consensus for allowing other people to peek into
> the .git/rebase-*/ directories, but I am inclined to say that it
> sounds more like a solution looking for a problem than a good idea
> to solve some concrete problem.

To be honest, my bigger complaint with the non-unified backend config is how far it bled into the code and how difficult it is to determine how things are controlled and which sections of code are relevant for which types of operations. And how much of a pain I'm worried it'd make the "allow rebasing and cherry-picking in a bare repository (or for an unchecked-out branch)" functionality. Perhaps the code can be cleaned up without changing these on-disk structures, in which case my concern for this point would lessen.

Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 28 in “sequencer: fix edit handling for cherry-pick and revert messages”
  1. sequencer: fix edit handling for cherry-pick and revert messagesElijah Newren via GitGitGadget, Mar 26, 2021
  2. Philip OakleyMar 26, 2021
  3. Elijah NewrenMar 26, 2021
  4. Junio C HamanoMar 28, 2021
  5. Phillip WoodMar 29, 2021
  6. Junio C HamanoMar 29, 2021
  7. Elijah NewrenMar 29, 2021
  8. sequencer: fix edit handling for cherry-pick and revert messagesElijah Newren via GitGitGadget, Mar 30, 2021
  9. Johannes SchindelinMar 30, 2021
  10. Junio C HamanoMar 30, 2021
  11. Elijah NewrenMar 30, 2021
  12. Ævar Arnfjörð BjarmasonMar 31, 2021
  13. Elijah NewrenMar 31, 2021
  14. Junio C HamanoMar 31, 2021
  15. Elijah NewrenApr 1, 2021
  16. Elijah NewrenMar 30, 2021
  17. unifying sequencer's options persisting, was Re: [PATCH v2] sequencer: fix edit handling for cherry-pick and revert messagesJohannes Schindelin, Mar 31, 2021
  18. Phillip WoodApr 2, 2021
  19. Phillip WoodApr 2, 2021
  20. Junio C HamanoApr 2, 2021
  21. Elijah NewrenApr 2, 2021
  22. Junio C HamanoApr 2, 2021
  23. Johannes SchindelinApr 8, 2021
  24. Junio C HamanoApr 8, 2021
  25. Christian CouderApr 8, 2021
  26. Johannes SchindelinApr 9, 2021
  27. sequencer: fix edit handling for cherry-pick and revert messagesElijah Newren via GitGitGadget, Mar 31, 2021
  28. Johannes SchindelinMar 31, 2021

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.