]> git.ipfire.org Git - thirdparty/git.git/blame - git-rebase.sh
Makefile: Include subdirectories in "make cover" reports
[thirdparty/git.git] / git-rebase.sh
CommitLineData
59e6b23a
JH
1#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano.
4#
5
bffd750a 6USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--no-ff] [--onto <newbase>] (<upstream>|--root) [<branch>] [--quiet | -q]'
031321c6
SE
7LONG_USAGE='git-rebase replaces <branch> with a new branch of the
8same name. When the --onto option is provided the new branch starts
9out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>
10It then attempts to create a new commit for each commit from the original
11<branch> that does not exist in the <upstream> branch.
69a60af5 12
031321c6
SE
13It is possible that a merge failure will prevent this process from being
14completely automatic. You will have to resolve any such merge failure
cc120056
SE
15and run git rebase --continue. Another option is to bypass the commit
16that caused the merge failure with git rebase --skip. To restore the
51ef1daa
JS
17original <branch> and remove the .git/rebase-apply working files, use the
18command git rebase --abort instead.
69a60af5 19
031321c6 20Note that if <branch> is not specified on the command line, the
702088af 21currently checked out branch is used.
e646c9c8 22
031321c6 23Example: git-rebase master~1 topic
e646c9c8 24
031321c6
SE
25 A---B---C topic A'\''--B'\''--C'\'' topic
26 / --> /
27 D---E---F---G master D---E---F---G master
e646c9c8 28'
533b7039
JH
29
30SUBDIRECTORY_OK=Yes
8f321a39 31OPTIONS_SPEC=
ae2b0f15 32. git-sh-setup
f9474132 33set_reflog_action rebase
7eff28a9 34require_work_tree
533b7039 35cd_to_toplevel
4282c4fb 36
61dfa1bb
JH
37LF='
38'
c4427656 39OK_TO_SKIP_PRE_REBASE=
cc120056
SE
40RESOLVEMSG="
41When you have resolved this problem run \"git rebase --continue\".
42If you would prefer to skip this patch, instead run \"git rebase --skip\".
43To restore the original branch and stop rebasing run \"git rebase --abort\".
44"
e646c9c8 45unset newbase
a06f678e 46strategy=recursive
58634dbf 47do_merge=
28ed6e7b 48dotest="$GIT_DIR"/rebase-merge
58634dbf 49prec=4
b758789c 50verbose=
a9c3821c 51diffstat=$(git config --bool rebase.stat)
67dad687 52git_am_opt=
190f5323 53rebase_root=
b2f82e05 54force_rebase=
cb6020bb 55allow_rerere_autoupdate=
58634dbf
EW
56
57continue_merge () {
58 test -n "$prev_head" || die "prev_head must be defined"
59 test -d "$dotest" || die "$dotest directory does not exist"
60
5be60078 61 unmerged=$(git ls-files -u)
58634dbf
EW
62 if test -n "$unmerged"
63 then
64 echo "You still have unmerged paths in your index"
9b07873a 65 echo "did you forget to use git add?"
66eb64cb 66 die "$RESOLVEMSG"
58634dbf
EW
67 fi
68
889a50e9 69 cmt=`cat "$dotest/current"`
6848d58c 70 if ! git diff-index --quiet --ignore-submodules HEAD --
58634dbf 71 then
e637122e 72 if ! git commit --no-verify -C "$cmt"
f0ef0596
EW
73 then
74 echo "Commit failed, please do not call \"git commit\""
75 echo "directly, but instead do one of the following: "
76 die "$RESOLVEMSG"
77 fi
0e987a12
SB
78 if test -z "$GIT_QUIET"
79 then
80 printf "Committed: %0${prec}d " $msgnum
81 fi
96e19488 82 echo "$cmt $(git rev-parse HEAD^0)" >> "$dotest/rewritten"
58634dbf 83 else
0e987a12
SB
84 if test -z "$GIT_QUIET"
85 then
86 printf "Already applied: %0${prec}d " $msgnum
87 fi
88 fi
0aa958d4 89 test -z "$GIT_QUIET" &&
31d87385 90 GIT_PAGER='' git log --format=%s -1 "$cmt"
58634dbf 91
5be60078 92 prev_head=`git rev-parse HEAD^0`
58634dbf 93 # save the resulting commit so we can read-tree on it later
58634dbf
EW
94 echo "$prev_head" > "$dotest/prev_head"
95
96 # onto the next patch:
97 msgnum=$(($msgnum + 1))
5887ac82 98 echo "$msgnum" >"$dotest/msgnum"
58634dbf
EW
99}
100
101call_merge () {
889a50e9 102 cmt="$(cat "$dotest/cmt.$1")"
58634dbf 103 echo "$cmt" > "$dotest/current"
5be60078 104 hd=$(git rev-parse --verify HEAD)
6fd2f5e6 105 cmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)
889a50e9
JS
106 msgnum=$(cat "$dotest/msgnum")
107 end=$(cat "$dotest/end")
0bb733c9 108 eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
889a50e9 109 eval GITHEAD_$hd='$(cat "$dotest/onto_name")'
0bb733c9 110 export GITHEAD_$cmt GITHEAD_$hd
0e987a12
SB
111 if test -n "$GIT_QUIET"
112 then
113 export GIT_MERGE_VERBOSITY=1
114 fi
0bb733c9 115 git-merge-$strategy "$cmt^" -- "$hd" "$cmt"
58634dbf
EW
116 rv=$?
117 case "$rv" in
118 0)
0bb733c9 119 unset GITHEAD_$cmt GITHEAD_$hd
9e4bc7dd 120 return
58634dbf
EW
121 ;;
122 1)
cb6020bb 123 git rerere $allow_rerere_autoupdate
66eb64cb 124 die "$RESOLVEMSG"
58634dbf
EW
125 ;;
126 2)
127 echo "Strategy: $rv $strategy failed, try another" 1>&2
66eb64cb 128 die "$RESOLVEMSG"
58634dbf
EW
129 ;;
130 *)
131 die "Unknown exit code ($rv) from command:" \
132 "git-merge-$strategy $cmt^ -- HEAD $cmt"
133 ;;
134 esac
135}
136
6fd2f5e6
JS
137move_to_original_branch () {
138 test -z "$head_name" &&
139 head_name="$(cat "$dotest"/head-name)" &&
140 onto="$(cat "$dotest"/onto)" &&
141 orig_head="$(cat "$dotest"/orig-head)"
142 case "$head_name" in
143 refs/*)
144 message="rebase finished: $head_name onto $onto"
145 git update-ref -m "$message" \
146 $head_name $(git rev-parse HEAD) $orig_head &&
147 git symbolic-ref HEAD $head_name ||
148 die "Could not move back to $head_name"
149 ;;
150 esac
151}
152
58634dbf 153finish_rb_merge () {
6fd2f5e6 154 move_to_original_branch
eb2151bb 155 git notes copy --for-rewrite=rebase < "$dotest"/rewritten
96e19488
TR
156 if test -x "$GIT_DIR"/hooks/post-rewrite &&
157 test -s "$dotest"/rewritten; then
158 "$GIT_DIR"/hooks/post-rewrite rebase < "$dotest"/rewritten
159 fi
58634dbf 160 rm -r "$dotest"
0e987a12 161 say All done.
58634dbf
EW
162}
163
1b1dce4b 164is_interactive () {
f8cca019
AE
165 while test $# != 0
166 do
167 case "$1" in
168 -i|--interactive)
169 interactive_rebase=explicit
170 break
171 ;;
172 -p|--preserve-merges)
173 interactive_rebase=implied
174 ;;
175 esac
1b1dce4b 176 shift
f8cca019
AE
177 done
178
179 if [ "$interactive_rebase" = implied ]; then
180 GIT_EDITOR=:
181 export GIT_EDITOR
182 fi
183
184 test -n "$interactive_rebase" || test -f "$dotest"/interactive
1b1dce4b
JS
185}
186
d70b4a8f 187run_pre_rebase_hook () {
c4427656
NS
188 if test -z "$OK_TO_SKIP_PRE_REBASE" &&
189 test -x "$GIT_DIR/hooks/pre-rebase"
d70b4a8f 190 then
bc2bbc45
SB
191 "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} ||
192 die "The pre-rebase hook refused to rebase."
d70b4a8f
NS
193 fi
194}
195
9b752a6e
SB
196test -f "$GIT_DIR"/rebase-apply/applying &&
197 die 'It looks like git-am is in progress. Cannot rebase.'
198
1b1dce4b
JS
199is_interactive "$@" && exec git-rebase--interactive "$@"
200
822f7c73 201while test $# != 0
e646c9c8
JH
202do
203 case "$1" in
c4427656
NS
204 --no-verify)
205 OK_TO_SKIP_PRE_REBASE=yes
206 ;;
031321c6 207 --continue)
51ef1daa 208 test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
cd5320f2
SB
209 die "No rebase in progress?"
210
25e93250 211 git update-index --ignore-submodules --refresh &&
6848d58c 212 git diff-files --quiet --ignore-submodules || {
06aff47b 213 echo "You must edit all merge conflicts and then"
9b07873a 214 echo "mark them as resolved using git add"
031321c6 215 exit 1
06aff47b 216 }
58634dbf
EW
217 if test -d "$dotest"
218 then
889a50e9
JS
219 prev_head=$(cat "$dotest/prev_head")
220 end=$(cat "$dotest/end")
221 msgnum=$(cat "$dotest/msgnum")
222 onto=$(cat "$dotest/onto")
0e987a12 223 GIT_QUIET=$(cat "$dotest/quiet")
58634dbf
EW
224 continue_merge
225 while test "$msgnum" -le "$end"
226 do
227 call_merge "$msgnum"
228 continue_merge
229 done
230 finish_rb_merge
231 exit
232 fi
51ef1daa
JS
233 head_name=$(cat "$GIT_DIR"/rebase-apply/head-name) &&
234 onto=$(cat "$GIT_DIR"/rebase-apply/onto) &&
235 orig_head=$(cat "$GIT_DIR"/rebase-apply/orig-head) &&
0e987a12 236 GIT_QUIET=$(cat "$GIT_DIR"/rebase-apply/quiet)
3f735b66
JS
237 git am --resolved --3way --resolvemsg="$RESOLVEMSG" &&
238 move_to_original_branch
cc120056
SE
239 exit
240 ;;
241 --skip)
51ef1daa 242 test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
cd5320f2
SB
243 die "No rebase in progress?"
244
fb6e4e1f 245 git reset --hard HEAD || exit $?
58634dbf
EW
246 if test -d "$dotest"
247 then
b4372ef1 248 git rerere clear
889a50e9
JS
249 prev_head=$(cat "$dotest/prev_head")
250 end=$(cat "$dotest/end")
251 msgnum=$(cat "$dotest/msgnum")
d5e673b6 252 msgnum=$(($msgnum + 1))
889a50e9 253 onto=$(cat "$dotest/onto")
0e987a12 254 GIT_QUIET=$(cat "$dotest/quiet")
d5e673b6
EW
255 while test "$msgnum" -le "$end"
256 do
257 call_merge "$msgnum"
258 continue_merge
259 done
260 finish_rb_merge
261 exit
58634dbf 262 fi
51ef1daa
JS
263 head_name=$(cat "$GIT_DIR"/rebase-apply/head-name) &&
264 onto=$(cat "$GIT_DIR"/rebase-apply/onto) &&
265 orig_head=$(cat "$GIT_DIR"/rebase-apply/orig-head) &&
0e987a12 266 GIT_QUIET=$(cat "$GIT_DIR"/rebase-apply/quiet)
6fd2f5e6
JS
267 git am -3 --skip --resolvemsg="$RESOLVEMSG" &&
268 move_to_original_branch
031321c6
SE
269 exit
270 ;;
271 --abort)
51ef1daa 272 test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
cd5320f2
SB
273 die "No rebase in progress?"
274
b4372ef1 275 git rerere clear
58634dbf
EW
276 if test -d "$dotest"
277 then
0e987a12 278 GIT_QUIET=$(cat "$dotest/quiet")
6fd2f5e6 279 move_to_original_branch
cd5320f2 280 else
51ef1daa 281 dotest="$GIT_DIR"/rebase-apply
0e987a12 282 GIT_QUIET=$(cat "$dotest/quiet")
6fd2f5e6 283 move_to_original_branch
58634dbf 284 fi
97b88dd5 285 git reset --hard $(cat "$dotest/orig-head")
48411d22 286 rm -r "$dotest"
031321c6
SE
287 exit
288 ;;
e646c9c8
JH
289 --onto)
290 test 2 -le "$#" || usage
291 newbase="$2"
292 shift
293 ;;
58634dbf
EW
294 -M|-m|--m|--me|--mer|--merg|--merge)
295 do_merge=t
296 ;;
297 -s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
298 --strateg=*|--strategy=*|\
299 -s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
300 case "$#,$1" in
301 *,*=*)
8096fae7 302 strategy=`expr "z$1" : 'z-[^=]*=\(.*\)'` ;;
58634dbf
EW
303 1,*)
304 usage ;;
305 *)
306 strategy="$2"
307 shift ;;
308 esac
309 do_merge=t
310 ;;
a9c3821c
TAV
311 -n|--no-stat)
312 diffstat=
313 ;;
314 --stat)
315 diffstat=t
316 ;;
b758789c
RS
317 -v|--verbose)
318 verbose=t
a9c3821c 319 diffstat=t
0e987a12
SB
320 GIT_QUIET=
321 ;;
322 -q|--quiet)
323 GIT_QUIET=t
324 git_am_opt="$git_am_opt -q"
325 verbose=
326 diffstat=
b758789c 327 ;;
059f446d
BF
328 --whitespace=*)
329 git_am_opt="$git_am_opt $1"
b2f82e05
SR
330 case "$1" in
331 --whitespace=fix|--whitespace=strip)
332 force_rebase=t
333 ;;
334 esac
059f446d 335 ;;
86c91f91
GB
336 --ignore-whitespace)
337 git_am_opt="$git_am_opt $1"
338 ;;
570ccad3
MB
339 --committer-date-is-author-date|--ignore-date)
340 git_am_opt="$git_am_opt $1"
341 force_rebase=t
342 ;;
67dad687 343 -C*)
059f446d 344 git_am_opt="$git_am_opt $1"
67dad687 345 ;;
190f5323
TR
346 --root)
347 rebase_root=t
348 ;;
1bc6bf6d 349 -f|--f|--fo|--for|--forc|--force|--force-r|--force-re|--force-reb|--force-reba|--force-rebas|--force-rebase|--no-ff)
b2f82e05
SR
350 force_rebase=t
351 ;;
cb6020bb
JH
352 --rerere-autoupdate|--no-rerere-autoupdate)
353 allow_rerere_autoupdate="$1"
354 ;;
e646c9c8
JH
355 -*)
356 usage
357 ;;
358 *)
359 break
360 ;;
361 esac
362 shift
363done
51b2ead0 364test $# -gt 2 && usage
2db8aaec 365
bffd750a
JN
366if test $# -eq 0 && test -z "$rebase_root"
367then
368 test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply || usage
369 test -d "$dotest" -o -f "$GIT_DIR"/rebase-apply/rebasing &&
370 die 'A rebase is in progress, try --continue, --skip or --abort.'
371fi
372
51ef1daa 373# Make sure we do not have $GIT_DIR/rebase-apply
58634dbf 374if test -z "$do_merge"
7f4bd5d8 375then
9b752a6e 376 if mkdir "$GIT_DIR"/rebase-apply 2>/dev/null
58634dbf 377 then
51ef1daa 378 rmdir "$GIT_DIR"/rebase-apply
58634dbf
EW
379 else
380 echo >&2 '
9b752a6e
SB
381It seems that I cannot create a rebase-apply directory, and
382I wonder if you are in the middle of patch application or another
51ef1daa
JS
383rebase. If that is not the case, please
384 rm -fr '"$GIT_DIR"'/rebase-apply
9b752a6e 385and run me again. I am stopping in case you still have something
51ef1daa 386valuable there.'
58634dbf
EW
387 exit 1
388 fi
389else
390 if test -d "$dotest"
391 then
28ed6e7b 392 die "previous rebase directory $dotest still exists." \
9b752a6e 393 'Try git rebase (--continue | --abort | --skip)'
58634dbf 394 fi
7f4bd5d8
JH
395fi
396
7f59dbbb 397# The tree must be really really clean.
4cfbe06f
MM
398if ! git update-index --ignore-submodules --refresh > /dev/null; then
399 echo >&2 "cannot rebase: you have unstaged changes"
0c3d3ac3 400 git diff-files --name-status -r --ignore-submodules -- >&2
4cfbe06f 401 exit 1
07e62b73 402fi
6848d58c 403diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
32d99544 404case "$diff" in
07e62b73
JK
405?*) echo >&2 "cannot rebase: your index contains uncommitted changes"
406 echo >&2 "$diff"
7f59dbbb
JH
407 exit 1
408 ;;
409esac
99a92f92 410
190f5323
TR
411if test -z "$rebase_root"
412then
413 # The upstream head must be given. Make sure it is valid.
414 upstream_name="$1"
415 shift
416 upstream=`git rev-parse --verify "${upstream_name}^0"` ||
417 die "invalid upstream $upstream_name"
418 unset root_flag
419 upstream_arg="$upstream_name"
420else
421 test -z "$newbase" && die "--root must be used with --onto"
422 unset upstream_name
423 unset upstream
424 root_flag="--root"
425 upstream_arg="$root_flag"
426fi
32d99544 427
a1bf91e0
JH
428# Make sure the branch to rebase onto is valid.
429onto_name=${newbase-"$upstream_name"}
9f21e97d
NS
430case "$onto_name" in
431*...*)
432 if left=${onto_name%...*} right=${onto_name#*...} &&
433 onto=$(git merge-base --all ${left:-HEAD} ${right:-HEAD})
434 then
435 case "$onto" in
436 ?*"$LF"?*)
437 die "$onto_name: there are more than one merge bases"
438 ;;
439 '')
440 die "$onto_name: there is no merge base"
441 ;;
442 esac
443 else
61dfa1bb 444 die "$onto_name: there is no merge base"
9f21e97d
NS
445 fi
446 ;;
447*)
61dfa1bb 448 onto=$(git rev-parse --verify "${onto_name}^0") || exit
9f21e97d
NS
449 ;;
450esac
a1bf91e0 451
9a111c91 452# If a hook exists, give it a chance to interrupt
190f5323 453run_pre_rebase_hook "$upstream_arg" "$@"
9a111c91 454
0cb06644
JH
455# If the branch to rebase is given, that is the branch we will rebase
456# $branch_name -- branch being rebased, or HEAD (already detached)
457# $orig_head -- commit object name of tip of the branch before rebasing
458# $head_name -- refs/heads/<that-branch> or "detached HEAD"
459switch_to=
59e6b23a 460case "$#" in
190f5323 4611)
0cb06644 462 # Is it "rebase other $branchname" or "rebase other $commit"?
190f5323
TR
463 branch_name="$1"
464 switch_to="$1"
0cb06644 465
190f5323
TR
466 if git show-ref --verify --quiet -- "refs/heads/$1" &&
467 branch=$(git rev-parse -q --verify "refs/heads/$1")
0cb06644 468 then
190f5323
TR
469 head_name="refs/heads/$1"
470 elif branch=$(git rev-parse -q --verify "$1")
0cb06644
JH
471 then
472 head_name="detached HEAD"
473 else
474 usage
475 fi
e646c9c8
JH
476 ;;
477*)
0cb06644 478 # Do not need to switch branches, we are already on it.
bcf31618
JH
479 if branch_name=`git symbolic-ref -q HEAD`
480 then
0cb06644 481 head_name=$branch_name
bcf31618
JH
482 branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
483 else
0cb06644 484 head_name="detached HEAD"
bcf31618
JH
485 branch_name=HEAD ;# detached
486 fi
0cb06644 487 branch=$(git rev-parse --verify "${branch_name}^0") || exit
e646c9c8 488 ;;
59e6b23a 489esac
0cb06644 490orig_head=$branch
59e6b23a 491
190f5323
TR
492# Now we are rebasing commits $upstream..$branch (or with --root,
493# everything leading up to $branch) on top of $onto
e646c9c8 494
1308c17b
JS
495# Check if we are already based on $onto with linear history,
496# but this should be done only when upstream and onto are the same.
5be60078 497mb=$(git merge-base "$onto" "$branch")
1308c17b
JS
498if test "$upstream" = "$onto" && test "$mb" = "$onto" &&
499 # linear history?
e1622bfc 500 ! (git rev-list --parents "$onto".."$branch" | sane_grep " .* ") > /dev/null
7f4bd5d8 501then
b2f82e05
SR
502 if test -z "$force_rebase"
503 then
504 # Lazily switch to the target branch if needed...
505 test -z "$switch_to" || git checkout "$switch_to"
0e987a12 506 say "Current branch $branch_name is up to date."
b2f82e05
SR
507 exit 0
508 else
0e987a12 509 say "Current branch $branch_name is up to date, rebase forced."
b2f82e05 510 fi
7f4bd5d8
JH
511fi
512
0cb06644 513# Detach HEAD and reset the tree
0e987a12 514say "First, rewinding head to replay your work on top of it..."
324c2c31 515git checkout -q "$onto^0" || die "could not detach HEAD"
22e40795 516git update-ref ORIG_HEAD $branch
32d99544 517
a9c3821c
TAV
518if test -n "$diffstat"
519then
520 if test -n "$verbose"
521 then
522 echo "Changes from $mb to $onto:"
523 fi
524 # We want color (if set), but no pager
525 GIT_PAGER='' git diff --stat --summary "$mb" "$onto"
526fi
527
e646c9c8 528# If the $onto is a proper descendant of the tip of the branch, then
a75d7b54 529# we just fast-forwarded.
83c31614 530if test "$mb" = "$branch"
32d99544 531then
0e987a12 532 say "Fast-forwarded $branch_name to $onto_name."
6fd2f5e6 533 move_to_original_branch
32d99544
LS
534 exit 0
535fi
536
190f5323
TR
537if test -n "$rebase_root"
538then
539 revisions="$onto..$orig_head"
540else
541 revisions="$upstream..$orig_head"
542fi
543
58634dbf
EW
544if test -z "$do_merge"
545then
0cb06644 546 git format-patch -k --stdout --full-index --ignore-if-in-upstream \
190f5323 547 $root_flag "$revisions" |
3041c324 548 git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
6fd2f5e6
JS
549 move_to_original_branch
550 ret=$?
51ef1daa
JS
551 test 0 != $ret -a -d "$GIT_DIR"/rebase-apply &&
552 echo $head_name > "$GIT_DIR"/rebase-apply/head-name &&
553 echo $onto > "$GIT_DIR"/rebase-apply/onto &&
0e987a12
SB
554 echo $orig_head > "$GIT_DIR"/rebase-apply/orig-head &&
555 echo "$GIT_QUIET" > "$GIT_DIR"/rebase-apply/quiet
6fd2f5e6 556 exit $ret
58634dbf
EW
557fi
558
559# start doing a rebase with git-merge
560# this is rename-aware if the recursive (default) strategy is used
561
562mkdir -p "$dotest"
563echo "$onto" > "$dotest/onto"
0bb733c9 564echo "$onto_name" > "$dotest/onto_name"
6fd2f5e6 565prev_head=$orig_head
58634dbf 566echo "$prev_head" > "$dotest/prev_head"
6fd2f5e6
JS
567echo "$orig_head" > "$dotest/orig-head"
568echo "$head_name" > "$dotest/head-name"
0e987a12 569echo "$GIT_QUIET" > "$dotest/quiet"
58634dbf
EW
570
571msgnum=0
190f5323 572for cmt in `git rev-list --reverse --no-merges "$revisions"`
58634dbf
EW
573do
574 msgnum=$(($msgnum + 1))
5887ac82 575 echo "$cmt" > "$dotest/cmt.$msgnum"
58634dbf
EW
576done
577
5887ac82
JH
578echo 1 >"$dotest/msgnum"
579echo $msgnum >"$dotest/end"
58634dbf
EW
580
581end=$msgnum
582msgnum=1
583
584while test "$msgnum" -le "$end"
585do
586 call_merge "$msgnum"
587 continue_merge
588done
cc120056 589
58634dbf 590finish_rb_merge