Skip to content

Commit

Permalink
Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
Browse files Browse the repository at this point in the history
Since the files generated and used during a rebase are never to be
tracked, they should live in $GIT_DIR.  While at it, avoid the rather
meaningless term "dotest" to "rebase", and unhide ".dotest-merge".

This was wished for on the mailing list, but so far unimplemented.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jul 16, 2008
1 parent 6c11a5f commit 28ed6e7
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion Documentation/SubmittingPatches
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ If it does not apply correctly, there can be various reasons.
patch appropriately.

* Your MUA corrupted your patch; "am" would complain that
the patch does not apply. Look at .dotest/ subdirectory and
the patch does not apply. Look at .git/rebase/ subdirectory and
see what 'patch' file contains and check for the common
corruption patterns mentioned above.

Expand Down
4 changes: 2 additions & 2 deletions Documentation/git-am.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ aborts in the middle,. You can recover from this in one of two ways:
the index file to bring it in a state that the patch should
have produced. Then run the command with '--resolved' option.

The command refuses to process new mailboxes while `.dotest`
The command refuses to process new mailboxes while `.git/rebase`
directory exists, so if you decide to start over from scratch,
run `rm -f -r .dotest` before running the command with mailbox
run `rm -f -r .git/rebase` before running the command with mailbox
names.

Before any patches are applied, ORIG_HEAD is set to the tip of the
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-rebase.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It is possible that a merge failure will prevent this process from being
completely automatic. You will have to resolve any such merge failure
and run `git rebase --continue`. Another option is to bypass the commit
that caused the merge failure with `git rebase --skip`. To restore the
original <branch> and remove the .dotest working files, use the command
original <branch> and remove the .git/rebase working files, use the command
`git rebase --abort` instead.

Assume the following history exists and the current branch is "topic":
Expand Down
2 changes: 1 addition & 1 deletion Documentation/user-manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,7 @@ $ git rebase origin
-------------------------------------------------

This will remove each of your commits from mywork, temporarily saving
them as patches (in a directory named ".dotest"), update mywork to
them as patches (in a directory named ".git/rebase"), update mywork to
point at the latest version of origin, then apply each of the saved
patches to the new mywork. The result will look like:

Expand Down
20 changes: 10 additions & 10 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,26 @@ __git_ps1 ()
if [ -n "$g" ]; then
local r
local b
if [ -d "$g/../.dotest" ]
if [ -d "$g/rebase" ]
then
if test -f "$g/../.dotest/rebasing"
if test -f "$g/rebase/rebasing"
then
r="|REBASE"
elif test -f "$g/../.dotest/applying"
elif test -f "$g/rebase/applying"
then
r="|AM"
else
r="|AM/REBASE"
fi
b="$(git symbolic-ref HEAD 2>/dev/null)"
elif [ -f "$g/.dotest-merge/interactive" ]
elif [ -f "$g/rebase-merge/interactive" ]
then
r="|REBASE-i"
b="$(cat "$g/.dotest-merge/head-name")"
elif [ -d "$g/.dotest-merge" ]
b="$(cat "$g/rebase-merge/head-name")"
elif [ -d "$g/rebase-merge" ]
then
r="|REBASE-m"
b="$(cat "$g/.dotest-merge/head-name")"
b="$(cat "$g/rebase-merge/head-name")"
elif [ -f "$g/MERGE_HEAD" ]
then
r="|MERGING"
Expand Down Expand Up @@ -487,8 +487,8 @@ __git_whitespacelist="nowarn warn error error-all strip"

_git_am ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
if [ -d .dotest ]; then
local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
if [ -d "$dir"/rebase ]; then
__gitcomp "--skip --resolved"
return
fi
Expand Down Expand Up @@ -915,7 +915,7 @@ _git_push ()
_git_rebase ()
{
local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
if [ -d .dotest ] || [ -d "$dir"/.dotest-merge ]; then
if [ -d "$dir"/rebase ] || [ -d "$dir"/rebase-merge ]; then
__gitcomp "--continue --skip --abort"
return
fi
Expand Down
8 changes: 4 additions & 4 deletions contrib/emacs/git.el
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,8 @@ Return the list of files that haven't been handled."
"\n")
(when subject (insert subject "\n\n"))
(cond (msg (insert msg "\n"))
((file-readable-p ".dotest/msg")
(insert-file-contents ".dotest/msg"))
((file-readable-p ".git/rebase/msg")
(insert-file-contents ".git/rebase/msg"))
((file-readable-p ".git/MERGE_MSG")
(insert-file-contents ".git/MERGE_MSG")))
; delete empty lines at end
Expand All @@ -1272,9 +1272,9 @@ Return the list of files that haven't been handled."
(coding-system (git-get-commits-coding-system))
author-name author-email subject date)
(when (eq 0 (buffer-size buffer))
(when (file-readable-p ".dotest/info")
(when (file-readable-p ".git/rebase/info")
(with-temp-buffer
(insert-file-contents ".dotest/info")
(insert-file-contents ".git/rebase/info")
(goto-char (point-min))
(when (re-search-forward "^Author: \\(.*\\)\nEmail: \\(.*\\)$" nil t)
(setq author-name (match-string 1))
Expand Down
6 changes: 3 additions & 3 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ It does not apply to blobs recorded in its index."
}

prec=4
dotest=".dotest"
dotest="$GIT_DIR/rebase"
sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=
resolvemsg= resume=
git_apply_opt=
Expand Down Expand Up @@ -195,7 +195,7 @@ then
false
;;
esac ||
die "previous dotest directory $dotest still exists but mbox given."
die "previous rebase directory $dotest still exists but mbox given."
resume=yes
else
# Make sure we are not given --skip nor --resolved
Expand Down Expand Up @@ -325,7 +325,7 @@ do
<"$dotest"/info >/dev/null &&
go_next && continue

test -s $dotest/patch || {
test -s "$dotest/patch" || {
echo "Patch is empty. Was it split wrong?"
stop_here $this
}
Expand Down
2 changes: 1 addition & 1 deletion git-quiltimport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
fi

# Temporary directories
tmp_dir=.dotest
tmp_dir="$GIT_DIR"/rebase
tmp_msg="$tmp_dir/msg"
tmp_patch="$tmp_dir/patch"
tmp_info="$tmp_dir/info"
Expand Down
2 changes: 1 addition & 1 deletion git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ skip skip current patch and continue rebasing process
. git-sh-setup
require_work_tree

DOTEST="$GIT_DIR/.dotest-merge"
DOTEST="$GIT_DIR/rebase-merge"
TODO="$DOTEST"/git-rebase-todo
DONE="$DOTEST"/done
MSG="$DOTEST"/message
Expand Down
44 changes: 22 additions & 22 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It is possible that a merge failure will prevent this process from being
completely automatic. You will have to resolve any such merge failure
and run git rebase --continue. Another option is to bypass the commit
that caused the merge failure with git rebase --skip. To restore the
original <branch> and remove the .dotest working files, use the command
original <branch> and remove the .git/rebase working files, use the command
git rebase --abort instead.
Note that if <branch> is not specified on the command line, the
Expand Down Expand Up @@ -42,7 +42,7 @@ To restore the original branch and stop rebasing run \"git rebase --abort\".
unset newbase
strategy=recursive
do_merge=
dotest=$GIT_DIR/.dotest-merge
dotest="$GIT_DIR"/rebase-merge
prec=4
verbose=
git_am_opt=
Expand Down Expand Up @@ -150,7 +150,7 @@ while test $# != 0
do
case "$1" in
--continue)
test -d "$dotest" -o -d .dotest ||
test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
die "No rebase in progress?"

git diff-files --quiet --ignore-submodules || {
Expand All @@ -173,15 +173,15 @@ do
finish_rb_merge
exit
fi
head_name=$(cat .dotest/head-name) &&
onto=$(cat .dotest/onto) &&
orig_head=$(cat .dotest/orig-head) &&
head_name=$(cat "$GIT_DIR"/rebase/head-name) &&
onto=$(cat "$GIT_DIR"/rebase/onto) &&
orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
git am --resolved --3way --resolvemsg="$RESOLVEMSG" &&
move_to_original_branch
exit
;;
--skip)
test -d "$dotest" -o -d .dotest ||
test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
die "No rebase in progress?"

git reset --hard HEAD || exit $?
Expand All @@ -201,23 +201,23 @@ do
finish_rb_merge
exit
fi
head_name=$(cat .dotest/head-name) &&
onto=$(cat .dotest/onto) &&
orig_head=$(cat .dotest/orig-head) &&
head_name=$(cat "$GIT_DIR"/rebase/head-name) &&
onto=$(cat "$GIT_DIR"/rebase/onto) &&
orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
git am -3 --skip --resolvemsg="$RESOLVEMSG" &&
move_to_original_branch
exit
;;
--abort)
test -d "$dotest" -o -d .dotest ||
test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
die "No rebase in progress?"

git rerere clear
if test -d "$dotest"
then
move_to_original_branch
else
dotest=.dotest
dotest="$GIT_DIR"/rebase
move_to_original_branch
fi
git reset --hard $(cat "$dotest/orig-head")
Expand Down Expand Up @@ -265,24 +265,24 @@ do
shift
done

# Make sure we do not have .dotest
# Make sure we do not have $GIT_DIR/rebase
if test -z "$do_merge"
then
if mkdir .dotest
if mkdir "$GIT_DIR"/rebase
then
rmdir .dotest
rmdir "$GIT_DIR"/rebase
else
echo >&2 '
It seems that I cannot create a .dotest directory, and I wonder if you
It seems that I cannot create a '"$GIT_DIR"'/rebase directory, and I wonder if you
are in the middle of patch application or another rebase. If that is not
the case, please rm -fr .dotest and run me again. I am stopping in case
the case, please rm -fr '"$GIT_DIR"'/rebase and run me again. I am stopping in case
you still have something valuable there.'
exit 1
fi
else
if test -d "$dotest"
then
die "previous dotest directory $dotest still exists." \
die "previous rebase directory $dotest still exists." \
'try git-rebase < --continue | --abort >'
fi
fi
Expand Down Expand Up @@ -396,10 +396,10 @@ then
git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
move_to_original_branch
ret=$?
test 0 != $ret -a -d .dotest &&
echo $head_name > .dotest/head-name &&
echo $onto > .dotest/onto &&
echo $orig_head > .dotest/orig-head
test 0 != $ret -a -d "$GIT_DIR"/rebase &&
echo $head_name > "$GIT_DIR"/rebase/head-name &&
echo $onto > "$GIT_DIR"/rebase/onto &&
echo $orig_head > "$GIT_DIR"/rebase/orig-head
exit $ret
fi

Expand Down
4 changes: 2 additions & 2 deletions t/t3401-rebase-partial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ test_debug \

test_expect_success \
'rebase topic branch against new master and check git-am did not get halted' \
'git-rebase master && test ! -d .dotest'
'git-rebase master && test ! -d .git/rebase'

test_expect_success \
'rebase --merge topic branch that was partially merged upstream' \
'git-checkout -f my-topic-branch-merge &&
git-rebase --merge master-merge &&
test ! -d .git/.dotest-merge'
test ! -d .git/rebase-merge'

test_done
8 changes: 4 additions & 4 deletions t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,19 @@ test_expect_success 'stop on conflicting pick' '
git tag new-branch1 &&
test_must_fail git rebase -i master &&
test "$(git rev-parse HEAD~3)" = "$(git rev-parse master)" &&
test_cmp expect .git/.dotest-merge/patch &&
test_cmp expect .git/rebase-merge/patch &&
test_cmp expect2 file1 &&
test "$(git-diff --name-status |
sed -n -e "/^U/s/^U[^a-z]*//p")" = file1 &&
test 4 = $(grep -v "^#" < .git/.dotest-merge/done | wc -l) &&
test 0 = $(grep -c "^[^#]" < .git/.dotest-merge/git-rebase-todo)
test 4 = $(grep -v "^#" < .git/rebase-merge/done | wc -l) &&
test 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo)
'

test_expect_success 'abort' '
git rebase --abort &&
test $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&
test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&
! test -d .git/.dotest-merge
! test -d .git/rebase-merge
'

test_expect_success 'retain authorship' '
Expand Down
4 changes: 2 additions & 2 deletions t/t3407-rebase-abort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ testrebase() {
'
}

testrebase "" .dotest
testrebase " --merge" .git/.dotest-merge
testrebase "" .git/rebase
testrebase " --merge" .git/rebase-merge

test_done
Loading

0 comments on commit 28ed6e7

Please sign in to comment.