Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin rebase: support --skip
author
Pratik Karki
<predatoramigo@gmail.com>
Wed, 8 Aug 2018 15:06:17 +0000
(20:51 +0545)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 6 Sep 2018 18:55:58 +0000
(11:55 -0700)
This commit adds the option `--skip` which is used to restart
rebase after skipping the current patch.
Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
f957362
)
diff --git
a/builtin/rebase.c
b/builtin/rebase.c
index f112d91d678b0556ea97cd1ac946ff4116dccdbe..c477108f796fbb600d0931bf8622619ea34b234c 100644
(file)
--- a/
builtin/rebase.c
+++ b/
builtin/rebase.c
@@
-21,6
+21,7
@@
#include "diff.h"
#include "wt-status.h"
#include "revision.h"
#include "diff.h"
#include "wt-status.h"
#include "revision.h"
+#include "rerere.h"
static char const * const builtin_rebase_usage[] = {
N_("git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] "
static char const * const builtin_rebase_usage[] = {
N_("git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] "
@@
-468,6
+469,7
@@
int cmd_rebase(int argc, const char **argv, const char *prefix)
enum {
NO_ACTION,
ACTION_CONTINUE,
enum {
NO_ACTION,
ACTION_CONTINUE,
+ ACTION_SKIP,
} action = NO_ACTION;
struct option builtin_rebase_options[] = {
OPT_STRING(0, "onto", &options.onto_name,
} action = NO_ACTION;
struct option builtin_rebase_options[] = {
OPT_STRING(0, "onto", &options.onto_name,
@@
-492,6
+494,8
@@
int cmd_rebase(int argc, const char **argv, const char *prefix)
REBASE_FORCE),
OPT_CMDMODE(0, "continue", &action, N_("continue"),
ACTION_CONTINUE),
REBASE_FORCE),
OPT_CMDMODE(0, "continue", &action, N_("continue"),
ACTION_CONTINUE),
+ OPT_CMDMODE(0, "skip", &action,
+ N_("skip current patch and continue"), ACTION_SKIP),
OPT_END(),
};
OPT_END(),
};
@@
-590,6
+594,20
@@
int cmd_rebase(int argc, const char **argv, const char *prefix)
exit(1);
goto run_rebase;
}
exit(1);
goto run_rebase;
}
+ case ACTION_SKIP: {
+ struct string_list merge_rr = STRING_LIST_INIT_DUP;
+
+ options.action = "skip";
+
+ rerere_clear(&merge_rr);
+ string_list_clear(&merge_rr, 1);
+
+ if (reset_head(NULL, "reset", NULL, 0) < 0)
+ die(_("could not discard worktree changes"));
+ if (read_basic_state(&options))
+ exit(1);
+ goto run_rebase;
+ }
default:
die("TODO");
}
default:
die("TODO");
}