Merge branch 'pk/rebase-in-c'
authorJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 02:04:52 +0000 (11:04 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 02:04:52 +0000 (11:04 +0900)
Rewrite of the "rebase" machinery in C.

* pk/rebase-in-c:
  builtin/rebase: support running "git rebase <upstream>"
  rebase: refactor common shell functions into their own file
  rebase: start implementing it as a builtin

1  2 
.gitignore
Makefile
builtin.h
git-legacy-rebase.sh
git.c

diff --cc .gitignore
Simple merge
diff --cc Makefile
+++ b/Makefile
@@@ -1091,8 -1063,8 +1092,9 @@@ BUILTIN_OBJS += builtin/prune-packed.
  BUILTIN_OBJS += builtin/prune.o
  BUILTIN_OBJS += builtin/pull.o
  BUILTIN_OBJS += builtin/push.o
 +BUILTIN_OBJS += builtin/range-diff.o
  BUILTIN_OBJS += builtin/read-tree.o
+ BUILTIN_OBJS += builtin/rebase.o
  BUILTIN_OBJS += builtin/rebase--helper.o
  BUILTIN_OBJS += builtin/receive-pack.o
  BUILTIN_OBJS += builtin/reflog.o
diff --cc builtin.h
+++ b/builtin.h
@@@ -202,8 -201,8 +202,9 @@@ extern int cmd_prune(int argc, const ch
  extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
  extern int cmd_pull(int argc, const char **argv, const char *prefix);
  extern int cmd_push(int argc, const char **argv, const char *prefix);
 +extern int cmd_range_diff(int argc, const char **argv, const char *prefix);
  extern int cmd_read_tree(int argc, const char **argv, const char *prefix);
+ extern int cmd_rebase(int argc, const char **argv, const char *prefix);
  extern int cmd_rebase__helper(int argc, const char **argv, const char *prefix);
  extern int cmd_receive_pack(int argc, const char **argv, const char *prefix);
  extern int cmd_reflog(int argc, const char **argv, const char *prefix);
Simple merge
diff --cc git.c
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -524,8 -520,13 +524,14 @@@ static struct cmd_struct commands[] = 
        { "prune-packed", cmd_prune_packed, RUN_SETUP },
        { "pull", cmd_pull, RUN_SETUP | NEED_WORK_TREE },
        { "push", cmd_push, RUN_SETUP },
 +      { "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER },
        { "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
+       /*
+        * NEEDSWORK: Until the rebase is independent and needs no redirection
+        * to rebase shell script this is kept as is, then should be changed to
+        * RUN_SETUP | NEED_WORK_TREE
+        */
+       { "rebase", cmd_rebase },
        { "rebase--helper", cmd_rebase__helper, RUN_SETUP | NEED_WORK_TREE },
        { "receive-pack", cmd_receive_pack },
        { "reflog", cmd_reflog, RUN_SETUP },