Skip to content

Commit 12b9df2

Browse files
jamillGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge 'builtin-stash-rebase-v3'
To avoid having to play tricks as in earlier rounds, we bit the sour apple and rebased the `builtin-stash-rebase-v3` branch thicket onto the commit starting Git for Windows' merging-rebase. (The merging-rebase pulls in the previous branch thicket via a "fake merge", i.e. a merge commit that does not actually apply any changes from the merged commit history. This has the unfortunate side effect of confusing `merge` into thinking that any branch that was merged into an earlier round does not need to be merged again.) Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 5f286ec + 6737c99 commit 12b9df2

21 files changed

+2326
-108
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
/git-interpret-trailers
8484
/git-instaweb
8585
/git-legacy-rebase
86+
/git-legacy-rebase--interactive
87+
/git-legacy-stash
8688
/git-log
8789
/git-ls-files
8890
/git-ls-remote

Documentation/git-stash.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SYNOPSIS
99
--------
1010
[verse]
1111
'git stash' list [<options>]
12-
'git stash' show [<stash>]
12+
'git stash' show [<options>] [<stash>]
1313
'git stash' drop [-q|--quiet] [<stash>]
1414
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
1515
'git stash' branch <branchname> [<stash>]
@@ -106,7 +106,7 @@ stash@{1}: On master: 9cc0589... Add git-stash
106106
The command takes options applicable to the 'git log'
107107
command to control what is shown and how. See linkgit:git-log[1].
108108

109-
show [<stash>]::
109+
show [<options>] [<stash>]::
110110

111111
Show the changes recorded in the stash entry as a diff between the
112112
stashed contents and the commit back when the stash entry was first

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,13 @@ SCRIPT_SH += git-merge-resolve.sh
633633
SCRIPT_SH += git-mergetool.sh
634634
SCRIPT_SH += git-quiltimport.sh
635635
SCRIPT_SH += git-legacy-rebase.sh
636+
SCRIPT_SH += git-legacy-stash.sh
636637
SCRIPT_SH += git-remote-testgit.sh
637638
SCRIPT_SH += git-request-pull.sh
638-
SCRIPT_SH += git-stash.sh
639639
SCRIPT_SH += git-submodule.sh
640640
SCRIPT_SH += git-web--browse.sh
641641

642+
SCRIPT_LIB += git-legacy-rebase--interactive
642643
SCRIPT_LIB += git-mergetool--lib
643644
SCRIPT_LIB += git-parse-remote
644645
SCRIPT_LIB += git-rebase--am
@@ -1151,6 +1152,7 @@ BUILTIN_OBJS += builtin/shortlog.o
11511152
BUILTIN_OBJS += builtin/show-branch.o
11521153
BUILTIN_OBJS += builtin/show-index.o
11531154
BUILTIN_OBJS += builtin/show-ref.o
1155+
BUILTIN_OBJS += builtin/stash.o
11541156
BUILTIN_OBJS += builtin/stripspace.o
11551157
BUILTIN_OBJS += builtin/submodule--helper.o
11561158
BUILTIN_OBJS += builtin/symbolic-ref.o

builtin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ extern int cmd_show(int argc, const char **argv, const char *prefix);
225225
extern int cmd_show_branch(int argc, const char **argv, const char *prefix);
226226
extern int cmd_show_index(int argc, const char **argv, const char *prefix);
227227
extern int cmd_status(int argc, const char **argv, const char *prefix);
228+
extern int cmd_stash(int argc, const char **argv, const char *prefix);
228229
extern int cmd_stripspace(int argc, const char **argv, const char *prefix);
229230
extern int cmd_submodule__helper(int argc, const char **argv, const char *prefix);
230231
extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);

builtin/rebase--interactive.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
143143
char *raw_strategies = NULL;
144144
enum {
145145
NONE = 0, CONTINUE, SKIP, EDIT_TODO, SHOW_CURRENT_PATCH,
146-
SHORTEN_OIDS, EXPAND_OIDS, CHECK_TODO_LIST, REARRANGE_SQUASH, ADD_EXEC
146+
SHORTEN_OIDS, EXPAND_OIDS, CHECK_TODO_LIST, REARRANGE_SQUASH, ADD_EXEC,
147+
MAKE_SCRIPT, SKIP_UNNECESSARY_PICKS,
147148
} command = 0;
148149
struct option options[] = {
149150
OPT_BOOL(0, "ff", &opts.allow_ff, N_("allow fast-forward")),
@@ -196,6 +197,10 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
196197
OPT_RERERE_AUTOUPDATE(&opts.allow_rerere_auto),
197198
OPT_BOOL(0, "reschedule-failed-exec", &opts.reschedule_failed_exec,
198199
N_("automatically re-schedule any `exec` that fails")),
200+
OPT_CMDMODE(0, "make-script", &command,
201+
N_("make rebase script"), MAKE_SCRIPT),
202+
OPT_CMDMODE(0, "skip-unnecessary-picks", &command,
203+
N_("skip unnecessary picks"), SKIP_UNNECESSARY_PICKS),
199204
OPT_END()
200205
};
201206

@@ -267,6 +272,17 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
267272
case ADD_EXEC:
268273
ret = sequencer_add_exec_commands(the_repository, cmd);
269274
break;
275+
case MAKE_SCRIPT:
276+
ret = sequencer_make_script(the_repository, stdout, argc, argv, flags);
277+
break;
278+
case SKIP_UNNECESSARY_PICKS: {
279+
struct object_id oid;
280+
281+
ret = skip_unnecessary_picks(the_repository, &oid);
282+
if (!ret)
283+
printf("%s\n", oid_to_hex(&oid));
284+
break;
285+
}
270286
default:
271287
BUG("invalid command '%d'", command);
272288
}

0 commit comments

Comments
 (0)