From 145e05ac44b4c574fc22e6d3af7c5a14ad9b7335 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Fri, 10 Aug 2018 18:51:29 +0200 Subject: rebase -i: rewrite append_todo_help() in C This rewrites append_todo_help() from shell to C. It also incorporates some parts of initiate_action() and complete_action() that also write help texts to the todo file. This also introduces the source file rebase-interactive.c. This file will contain functions necessary for interactive rebase that are too specific for the sequencer, and is part of libgit.a. Two flags are added to rebase--helper.c: one to call append_todo_help() (`--append-todo-help`), and another one to tell append_todo_help() to write the help text suited for the edit-todo mode (`--write-edit-todo`). Finally, append_todo_help() is removed from git-rebase--interactive.sh to use `rebase--helper --append-todo-help` instead. Signed-off-by: Alban Gruin Signed-off-by: Junio C Hamano --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 08e5c54549..909a687857 100644 --- a/Makefile +++ b/Makefile @@ -922,6 +922,7 @@ LIB_OBJS += protocol.o LIB_OBJS += quote.o LIB_OBJS += reachable.o LIB_OBJS += read-cache.o +LIB_OBJS += rebase-interactive.o LIB_OBJS += reflog-walk.o LIB_OBJS += refs.o LIB_OBJS += refs/files-backend.o -- cgit v1.2.3 From 53bbcfbde7c29611f16722c3fbcdb2b78718f633 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 27 Sep 2018 23:56:07 +0200 Subject: rebase -i: implement the main part of interactive rebase as a builtin This rewrites the part of interactive rebase which initializes the basic state, make the script and complete the action, as a buitin, named git-rebase--interactive2 for now. Others modes (`--continue`, `--edit-todo`, etc.) will be rewritten in the next commit. git-rebase--interactive.sh is modified to call git-rebase--interactive2 instead of git-rebase--helper. Signed-off-by: Alban Gruin Signed-off-by: Junio C Hamano --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 909a687857..71f8f45fe5 100644 --- a/Makefile +++ b/Makefile @@ -1060,6 +1060,7 @@ BUILTIN_OBJS += builtin/prune.o BUILTIN_OBJS += builtin/pull.o BUILTIN_OBJS += builtin/push.o BUILTIN_OBJS += builtin/read-tree.o +BUILTIN_OBJS += builtin/rebase--interactive2.o BUILTIN_OBJS += builtin/rebase--helper.o BUILTIN_OBJS += builtin/receive-pack.o BUILTIN_OBJS += builtin/reflog.o -- cgit v1.2.3 From cf808208ec09727d993d670619c517bdcb00ca2b Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 27 Sep 2018 23:56:09 +0200 Subject: rebase -i: remove git-rebase--interactive.sh This removes git-rebase--interactive.sh, as its functionnality has been replaced by git-rebase--interactive2. git-rebase--interactive2.c is then renamed to git-rebase--interactive.c. Signed-off-by: Alban Gruin Signed-off-by: Junio C Hamano --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 71f8f45fe5..584834726d 100644 --- a/Makefile +++ b/Makefile @@ -619,7 +619,6 @@ SCRIPT_SH += git-web--browse.sh SCRIPT_LIB += git-mergetool--lib SCRIPT_LIB += git-parse-remote SCRIPT_LIB += git-rebase--am -SCRIPT_LIB += git-rebase--interactive SCRIPT_LIB += git-rebase--preserve-merges SCRIPT_LIB += git-rebase--merge SCRIPT_LIB += git-sh-setup @@ -1060,8 +1059,8 @@ BUILTIN_OBJS += builtin/prune.o BUILTIN_OBJS += builtin/pull.o BUILTIN_OBJS += builtin/push.o BUILTIN_OBJS += builtin/read-tree.o -BUILTIN_OBJS += builtin/rebase--interactive2.o BUILTIN_OBJS += builtin/rebase--helper.o +BUILTIN_OBJS += builtin/rebase--interactive.o BUILTIN_OBJS += builtin/receive-pack.o BUILTIN_OBJS += builtin/reflog.o BUILTIN_OBJS += builtin/remote.o @@ -2400,7 +2399,6 @@ XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \ LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H) LOCALIZED_SH = $(SCRIPT_SH) LOCALIZED_SH += git-parse-remote.sh -LOCALIZED_SH += git-rebase--interactive.sh LOCALIZED_SH += git-rebase--preserve-merges.sh LOCALIZED_SH += git-sh-setup.sh LOCALIZED_PERL = $(SCRIPT_PERL) -- cgit v1.2.3 From 34b47315d9721a576b9536492cca0c11588113a2 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 27 Sep 2018 23:56:10 +0200 Subject: rebase -i: move rebase--helper modes to rebase--interactive This moves the rebase--helper modes still used by git-rebase--preserve-merges.sh (`--shorten-ids`, `--expand-ids`, `--check-todo-list`, `--rearrange-squash` and `--add-exec-commands`) to rebase--interactive.c. git-rebase--preserve-merges.sh is modified accordingly, and rebase--helper.c is removed as it is useless now. Signed-off-by: Alban Gruin Signed-off-by: Junio C Hamano --- Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 584834726d..ca3a0888dd 100644 --- a/Makefile +++ b/Makefile @@ -1059,7 +1059,6 @@ BUILTIN_OBJS += builtin/prune.o BUILTIN_OBJS += builtin/pull.o BUILTIN_OBJS += builtin/push.o BUILTIN_OBJS += builtin/read-tree.o -BUILTIN_OBJS += builtin/rebase--helper.o BUILTIN_OBJS += builtin/rebase--interactive.o BUILTIN_OBJS += builtin/receive-pack.o BUILTIN_OBJS += builtin/reflog.o -- cgit v1.2.3