Skip to content

Commit c155ee0

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge 'drop-rebase--am.sh'
This topic branch cleans up some left-overs that were forgotten when removing the scripted `git rebase`. As these patches are based on top of v2.22.0-rc1 (which *did* drop the scripted `git-rebase.sh`), instead of v2.21.0 (on which the current `master` of Git for Windows is based, and which did *not* yet drop the scripted `git rebase`) it does not make sense to try to backport them to `master`. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents f5d2f34 + 3b756fd commit c155ee0

8 files changed

+58
-167
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@
122122
/git-range-diff
123123
/git-read-tree
124124
/git-rebase
125-
/git-rebase--am
126-
/git-rebase--common
127-
/git-rebase--interactive
128125
/git-rebase--preserve-merges
129126
/git-receive-pack
130127
/git-reflog

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,6 @@ SCRIPT_SH += git-web--browse.sh
624624

625625
SCRIPT_LIB += git-mergetool--lib
626626
SCRIPT_LIB += git-parse-remote
627-
SCRIPT_LIB += git-rebase--am
628-
SCRIPT_LIB += git-rebase--common
629627
SCRIPT_LIB += git-rebase--preserve-merges
630628
SCRIPT_LIB += git-sh-setup
631629
SCRIPT_LIB += git-sh-i18n

builtin/rebase.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,10 +1153,6 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)
11531153
}
11541154

11551155
switch (opts->type) {
1156-
case REBASE_AM:
1157-
backend = "git-rebase--am";
1158-
backend_func = "git_rebase__am";
1159-
break;
11601156
case REBASE_PRESERVE_MERGES:
11611157
backend = "git-rebase--preserve-merges";
11621158
backend_func = "git_rebase__preserve_merges";
@@ -1167,8 +1163,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)
11671163
}
11681164

11691165
strbuf_addf(&script_snippet,
1170-
". git-sh-setup && . git-rebase--common &&"
1171-
" . %s && %s", backend, backend_func);
1166+
". git-sh-setup && . %s && %s", backend, backend_func);
11721167
argv[0] = script_snippet.buf;
11731168

11741169
status = run_command_v_opt(argv, RUN_USING_SHELL);

git-rebase--am.sh

Lines changed: 0 additions & 85 deletions
This file was deleted.

git-rebase--common.sh

Lines changed: 0 additions & 69 deletions
This file was deleted.

git-rebase--preserve-merges.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,61 @@ rewritten_pending="$state_dir"/rewritten-pending
7777
# and leaves CR at the end instead.
7878
cr=$(printf "\015")
7979

80+
resolvemsg="
81+
$(gettext 'Resolve all conflicts manually, mark them as resolved with
82+
"git add/rm <conflicted_files>", then run "git rebase --continue".
83+
You can instead skip this commit: run "git rebase --skip".
84+
To abort and get back to the state before "git rebase", run "git rebase --abort".')
85+
"
86+
87+
write_basic_state () {
88+
echo "$head_name" > "$state_dir"/head-name &&
89+
echo "$onto" > "$state_dir"/onto &&
90+
echo "$orig_head" > "$state_dir"/orig-head &&
91+
test t = "$GIT_QUIET" && : > "$state_dir"/quiet
92+
test t = "$verbose" && : > "$state_dir"/verbose
93+
test -n "$strategy" && echo "$strategy" > "$state_dir"/strategy
94+
test -n "$strategy_opts" && echo "$strategy_opts" > \
95+
"$state_dir"/strategy_opts
96+
test -n "$allow_rerere_autoupdate" && echo "$allow_rerere_autoupdate" > \
97+
"$state_dir"/allow_rerere_autoupdate
98+
test -n "$gpg_sign_opt" && echo "$gpg_sign_opt" > "$state_dir"/gpg_sign_opt
99+
test -n "$signoff" && echo "$signoff" >"$state_dir"/signoff
100+
test -n "$reschedule_failed_exec" && : > "$state_dir"/reschedule-failed-exec
101+
}
102+
103+
apply_autostash () {
104+
if test -f "$state_dir/autostash"
105+
then
106+
stash_sha1=$(cat "$state_dir/autostash")
107+
if git stash apply $stash_sha1 >/dev/null 2>&1
108+
then
109+
echo "$(gettext 'Applied autostash.')" >&2
110+
else
111+
git stash store -m "autostash" -q $stash_sha1 ||
112+
die "$(eval_gettext "Cannot store \$stash_sha1")"
113+
gettext 'Applying autostash resulted in conflicts.
114+
Your changes are safe in the stash.
115+
You can run "git stash pop" or "git stash drop" at any time.
116+
' >&2
117+
fi
118+
fi
119+
}
120+
121+
output () {
122+
case "$verbose" in
123+
'')
124+
output=$("$@" 2>&1 )
125+
status=$?
126+
test $status != 0 && printf "%s\n" "$output"
127+
return $status
128+
;;
129+
*)
130+
"$@"
131+
;;
132+
esac
133+
}
134+
80135
strategy_args=${strategy:+--strategy=$strategy}
81136
test -n "$strategy_opts" &&
82137
eval '

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ static int parse_key_value_squoted(char *buf, struct string_list *list)
767767
* GIT_AUTHOR_DATE='$author_date'
768768
*
769769
* where $author_name, $author_email and $author_date are quoted. We are strict
770-
* with our parsing, as the file was meant to be eval'd in the old
770+
* with our parsing, as the file was meant to be eval'd in the now-removed
771771
* git-am.sh/git-rebase--interactive.sh scripts, and thus if the file differs
772772
* from what this function expects, it is better to bail out than to do
773773
* something that the user does not expect.

t/t3400-rebase.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ EOF
285285
test_cmp From_.msg out
286286
'
287287

288-
test_expect_success 'rebase--am.sh and --show-current-patch' '
288+
test_expect_success 'rebase --am and --show-current-patch' '
289289
test_create_repo conflict-apply &&
290290
(
291291
cd conflict-apply &&

0 commit comments

Comments
 (0)