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

Re: [PATCH/RFC/GSoC 17/17] rebase-interactive: introduce interactive backend for builtin rebase

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 15, 2016, 07:57 UTC
Message-ID
<alpine.DEB.2.20.1603150800420.4690@virtualbox>
In-Reply-To
<1457779597-6918-18-git-send-email-pyokagan@gmail.com>
Hi Paul,
On Sat, 12 Mar 2016, Paul Tan wrote:
Show 12 quoted lines
> Since 1b1dce4 (Teach rebase an interactive mode, 2007-06-25), git-rebase
> supports an interactive mode when passed the -i switch.
> 
> In interactive mode, git-rebase allows users to edit the list of patches
> (using the user's GIT_SEQUENCE_EDITOR), so that the user can reorder,
> edit and delete patches.
> 
> Re-implement a skeletal version of the above feature by introducing a
> rebase-interactive backend for our builtin-rebase. This skeletal
> implementation is only able to pick and re-order commits.
> 
> Signed-off-by: Paul Tan <pyokagan@gmail.com>

It is a pity that both of us worked on overlapping projects in stealth mode. Inevitably, some of the work is now wasted :-(

Not all is lost, though.

Much of the code can be salvaged, although I really want to reiterate that an all-or-nothing conversion of the rebase command is not going to fly.

For several reasons: it would be rather disruptive, huge and hard to review. It would not let anybody else work on that huge task. And you're prone to fall behind due to Git's source code being in constant flux (including the rebase bits).

There is another, really important reason: if you package the conversion into small, neat bundles, it is much easier to avoid too narrow a focus that would tuck perfectly useful functions away in a location where it cannot be reused and where it is likely to be missed by other developers who need the same, or similar functionality (point in case: has_uncommitted_changes()). And we know that this happened in the past, and sometimes resulted in near-duplicated code, hence Karthik's Herculean, still ongoing work.

Lastly, I need to point out that the conversion of rebase into a builtin is not the end game, it is the game's opening.

I could imagine that other Git oldtimers are perfectly happy with the state of the rebase family of commands. I am not. The user interface is klunky, some parts are designed wrong (--preserve-merges, I am looking at you!), the *name* is completely unintuitive, for crying out loud! Just to name a *few* things, there is much more.

I worked around the limitations of the --preserve-merges feature (yeah, blame me...) by inventing the "Garden Shears" [*1*] that can re-plant an entire thicket of topic branches on top of a moving upstream branch. It is similar in spirit to Junio's custom tools that recreate his 'pu' branch over and over again, but uses the interactive rebase as work horse.

The shears can also be used to fix up commits in the middle of a thicket of branches, which is why I wrote the shears script in the first place.

The fact that the interactive rebase does not do the job with which pretty much every project maintainer is faced points out two things: interactive rebase needs to learn new tricks, and we need plumbing to do interactive rebase's bidding (so that we/others can build better UIs, hopefully with much better names, too).

I already know pretty well how I want to implement the shears as a new mode of the interactive rebase, once I finished teaching the sequencer how to process rebase -i's edit scripts (which somebody decided to name "instruction sheets" in the sequencer, to add confusion to poor naming).

All of this let's me think that there is just too much to do for a single developer, and therefore whatever needs to be done must be done in a way that allows more than a single person to complete the whole shebang, or at least their part of it.

So you see, there was a much larger master plan behind my recommendation to go the rebase--helper route.

As to my current state: Junio put me into quite a fix (without knowing it) by releasing 2.7.3 just after I took off for an extended offline weekend, and now I am scrambling because a change in MSYS2's runtime (actually, probably more like: an update of the GCC that is used to compile the runtime, that now causes a regression) is keeping me away from my work on the interactive rebase. Even so, I am pretty far along; There are only three major things left to do: 1) fix fixups/squashes with fast-forwarding picks, 2) implement 'reword', 3) display the progress. And of course 4) clean up the fallout. ;-)

At this point, I'd rather finish this myself than falling prey to Brooks' Law.

I also have to admit that I would love to give you a project over the summer whose logical children are exciting enough to dabble with even during the winter. And somehow I do not see that excitement in the boring conversion from shell to C (even if its outcome is well-needed).

Ciao, Dscho

Footnote *1*: https://github.com/git-for-windows/build-extra/blob/master/shears.sh

Previous: Paul TanNext: Paul Tan
Message 52 of 59 in “A barebones git-rebase in C”
  1. 00/17 A barebones git-rebase in CPaul Tan, Mar 12, 2016
  2. 01/17 perf: introduce performance tests for git-rebasePaul Tan, Mar 12, 2016
  3. Johannes SchindelinMar 16, 2016
  4. Paul TanMar 16, 2016
  5. Johannes SchindelinMar 16, 2016
  6. Thomas GummererMar 18, 2016
  7. Johannes SchindelinMar 18, 2016
  8. Thomas GummererMar 20, 2016
  9. Johannes SchindelinMar 21, 2016
  10. 02/17 sha1_name: implement get_oid() and friendsPaul Tan, Mar 12, 2016
  11. 03/17 builtin-rebase: implement skeletal builtin rebasePaul Tan, Mar 12, 2016
  12. Stefan BellerMar 14, 2016
  13. Johannes SchindelinMar 15, 2016
  14. 04/17 builtin-rebase: parse rebase arguments into a common rebase_options structPaul Tan, Mar 12, 2016
  15. Stefan BellerMar 14, 2016
  16. Johannes SchindelinMar 15, 2016
  17. 05/17 rebase-options: implement rebase_options_load() and rebase_options_save()Paul Tan, Mar 12, 2016
  18. Stefan BellerMar 14, 2016
  19. Johannes SchindelinMar 16, 2016
  20. Paul TanMar 16, 2016
  21. Johannes SchindelinMar 16, 2016
  22. Paul TanMar 21, 2016
  23. Paul TanMar 16, 2016
  24. Stefan BellerMar 16, 2016
  25. 06/17 rebase-am: introduce am backend for builtin rebasePaul Tan, Mar 12, 2016
  26. Johannes SchindelinMar 16, 2016
  27. 07/17 rebase-common: implement refresh_and_write_cache()Paul Tan, Mar 12, 2016
  28. Junio C HamanoMar 14, 2016
  29. Paul TanMar 16, 2016
  30. 08/17 rebase-common: let refresh_and_write_cache() take a flags argumentPaul Tan, Mar 12, 2016
  31. 09/17 rebase-common: implement cache_has_unstaged_changes()Paul Tan, Mar 12, 2016
  32. Johannes SchindelinMar 14, 2016
  33. Junio C HamanoMar 14, 2016
  34. Johannes SchindelinMar 15, 2016
  35. Duy NguyenMar 15, 2016
  36. Johannes SchindelinMar 15, 2016
  37. 10/17 rebase-common: implement cache_has_uncommitted_changes()Paul Tan, Mar 12, 2016
  38. 11/17 rebase-merge: introduce merge backend for builtin rebasePaul Tan, Mar 12, 2016
  39. 12/17 rebase-todo: introduce rebase_todo_itemPaul Tan, Mar 12, 2016
  40. Christian CouderMar 14, 2016
  41. Johannes SchindelinMar 14, 2016
  42. Paul TanMar 16, 2016
  43. Johannes SchindelinMar 16, 2016
  44. 13/17 rebase-todo: introduce rebase_todo_listPaul Tan, Mar 12, 2016
  45. 14/17 status: use rebase_todo_listPaul Tan, Mar 12, 2016
  46. 15/17 wrapper: implement append_file()Paul Tan, Mar 12, 2016
  47. 16/17 editor: implement git_sequence_editor() and launch_sequence_editor()Paul Tan, Mar 12, 2016
  48. Johannes SchindelinMar 15, 2016
  49. Paul TanMar 16, 2016
  50. Johannes SchindelinMar 16, 2016
  51. 17/17 rebase-interactive: introduce interactive backend for builtin rebasePaul Tan, Mar 12, 2016
  52. Johannes SchindelinMar 15, 2016
  53. Paul TanMar 15, 2016
  54. Johannes SchindelinMar 15, 2016
  55. Duy NguyenMar 14, 2016
  56. Stefan BellerMar 14, 2016
  57. Junio C HamanoMar 14, 2016
  58. Paul TanMar 16, 2016
  59. Johannes SchindelinMar 14, 2016

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.