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

[RFC PATCH 0/3] rebase-interactive

From
Wink Saville <wink@saville.com>
Date
Mar 20, 2018, 20:45 UTC
Message-ID
<20180320204507.12623-1-wink@saville.com>

I've not worked on the git sources before and while looking into fixing test_expect_failure 'exchange two commits with -p' in t3404-rebase-interactive.sh, I found it difficult to understand the git testing infracture and git-rebase--interactive.sh.

So as part of learning my way around I thought I'd refactor git-rebase--interactive to make it easier for me to understand. At this point I do have some understanding and will be working on fixing the bug. In the mean time I'm requesting comments on this refactoring patch sequence.

Patch 0001 creates a library of functions which can be used by git-rebase--interactive and git-rebase--interactive--preserve-merges. The functions are those that exist in git-rebase--interactive.sh plus new functions created from the body of git_rebase_interactive that will be used git_rebase_interactive in the third patch and git_rebase_interactive_preserve_merges in the second patch. None of the functions are invoked so there is no logic changes and the system builds and passes all tests on travis-ci.org.

Patch 0002 creates git-rebase--interactive--preserve-merges.sh with the function git_rebase_interactive_preserve_merges. The contents of the function are refactored from git_rebase_interactive and uses existing and new functions in the library. A small modification of git-rebase is also done to invoke the new function when the -p switch is used with git-rebase. When this is applied on top of 0001 the system builds and passes all tests on travis-ci.org.

The final patch, 0003, removes all unused code from git_rebase_interactive and uses the functions from the library where appropriate. And, of course, when applied on top of 0002 the system builds and passes all tests on travis-ci.org.

Wink Saville (3):
  rebase-interactive: create git-rebase--interactive--lib.sh
  rebase-interactive: create git-rebase--interactive--preserve-merges
  rebase-interactive: refactor git-rebase--interactive to use library
 .gitignore                                  |    2 +
 Makefile                                    |    2 +
 git-rebase--interactive--lib.sh             |  944 +++++++++++++++++++++++++
 git-rebase--interactive--preserve-merges.sh |  134 ++++
 git-rebase--interactive.sh                  | 1019 +--------------------------
 git-rebase.sh                               |    7 +-
 6 files changed, 1107 insertions(+), 1001 deletions(-)
 create mode 100644 git-rebase--interactive--lib.sh
 create mode 100644 git-rebase--interactive--preserve-merges.sh
-- 
2.16.2
Next: Wink Saville
Message 1 of 14 in “rebase-interactive”
  1. 0/3 rebase-interactiveWink Saville, Mar 20, 2018
  2. 1/3 rebase-interactive: create git-rebase--interactive--lib.shWink Saville, Mar 20, 2018
  3. 2/3 rebase-interactive: create git-rebase--interactive--preserve-mergesWink Saville, Mar 20, 2018
  4. 3/3 rebase-interactive: refactor git-rebase--interactive to use libraryWink Saville, Mar 20, 2018
  5. Eric SunshineMar 20, 2018
  6. Wink SavilleMar 20, 2018
  7. Eric SunshineMar 20, 2018
  8. Wink SavilleMar 21, 2018
  9. Eric SunshineMar 21, 2018
  10. 0/1 rebase-interactive: Add git_rebase__interactive__preserve_mergesWink Saville, Mar 21, 2018
  11. 1/1 rebase-interactive: Add git_rebase__interactive__preserve_mergesWink Saville, Mar 21, 2018
  12. Junio C HamanoMar 21, 2018
  13. Wink SavilleMar 21, 2018
  14. Junio C HamanoMar 21, 2018

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.