@matheusbsbs / matheus-bagliano / commits / 28ed6e7b32
Fork 0

Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"

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>

Johannes Schindelin committed Jul 16, 2008 at 03:33 UTC 28ed6e7b321bee3dd7e4aa9c0ff7da64844136f6
15 files changed +66 -66
Documentation/SubmittingPatches
+1 -1
@@ -301,7 +301,7 @@ If it does not apply correctly, there can be various reasons.
301 patch appropriately.
302
303 * Your MUA corrupted your patch; "am" would complain that
304 - the patch does not apply. Look at .dotest/ subdirectory and
304 + the patch does not apply. Look at .git/rebase/ subdirectory and
305 see what 'patch' file contains and check for the common
306 corruption patterns mentioned above.
307
Documentation/git-am.txt
+2 -2
@@ -140,9 +140,9 @@ aborts in the middle,. You can recover from this in one of two ways:
140 the index file to bring it in a state that the patch should
141 have produced. Then run the command with '--resolved' option.
142
143 -The command refuses to process new mailboxes while `.dotest`
143 +The command refuses to process new mailboxes while `.git/rebase`
144 directory exists, so if you decide to start over from scratch,
145 -run `rm -f -r .dotest` before running the command with mailbox
145 +run `rm -f -r .git/rebase` before running the command with mailbox
146 names.
147
148 Before any patches are applied, ORIG_HEAD is set to the tip of the
Documentation/git-rebase.txt
+1 -1
@@ -39,7 +39,7 @@ It is possible that a merge failure will prevent this process from being
39 completely automatic. You will have to resolve any such merge failure
40 and run `git rebase --continue`. Another option is to bypass the commit
41 that caused the merge failure with `git rebase --skip`. To restore the
42 -original <branch> and remove the .dotest working files, use the command
42 +original <branch> and remove the .git/rebase working files, use the command
43 `git rebase --abort` instead.
44
45 Assume the following history exists and the current branch is "topic":
Documentation/user-manual.txt
+1 -1
@@ -2431,7 +2431,7 @@ $ git rebase origin
2431 -------------------------------------------------
2432
2433 This will remove each of your commits from mywork, temporarily saving
2434 -them as patches (in a directory named ".dotest"), update mywork to
2434 +them as patches (in a directory named ".git/rebase"), update mywork to
2435 point at the latest version of origin, then apply each of the saved
2436 patches to the new mywork. The result will look like:
2437
contrib/completion/git-completion.bash
+10 -10
@@ -73,26 +73,26 @@ __git_ps1 ()
73 if [ -n "$g" ]; then
74 local r
75 local b
76 - if [ -d "$g/../.dotest" ]
76 + if [ -d "$g/rebase" ]
77 then
78 - if test -f "$g/../.dotest/rebasing"
78 + if test -f "$g/rebase/rebasing"
79 then
80 r="|REBASE"
81 - elif test -f "$g/../.dotest/applying"
81 + elif test -f "$g/rebase/applying"
82 then
83 r="|AM"
84 else
85 r="|AM/REBASE"
86 fi
87 b="$(git symbolic-ref HEAD 2>/dev/null)"
88 - elif [ -f "$g/.dotest-merge/interactive" ]
88 + elif [ -f "$g/rebase-merge/interactive" ]
89 then
90 r="|REBASE-i"
91 - b="$(cat "$g/.dotest-merge/head-name")"
92 - elif [ -d "$g/.dotest-merge" ]
91 + b="$(cat "$g/rebase-merge/head-name")"
92 + elif [ -d "$g/rebase-merge" ]
93 then
94 r="|REBASE-m"
95 - b="$(cat "$g/.dotest-merge/head-name")"
95 + b="$(cat "$g/rebase-merge/head-name")"
96 elif [ -f "$g/MERGE_HEAD" ]
97 then
98 r="|MERGING"
@@ -487,8 +487,8 @@ __git_whitespacelist="nowarn warn error error-all strip"
487
488 _git_am ()
489 {
490 - local cur="${COMP_WORDS[COMP_CWORD]}"
491 - if [ -d .dotest ]; then
490 + local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
491 + if [ -d "$dir"/rebase ]; then
492 __gitcomp "--skip --resolved"
493 return
494 fi
@@ -915,7 +915,7 @@ _git_push ()
915 _git_rebase ()
916 {
917 local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
918 - if [ -d .dotest ] || [ -d "$dir"/.dotest-merge ]; then
918 + if [ -d "$dir"/rebase ] || [ -d "$dir"/rebase-merge ]; then
919 __gitcomp "--continue --skip --abort"
920 return
921 fi
contrib/emacs/git.el
+4 -4
@@ -1252,8 +1252,8 @@ Return the list of files that haven't been handled."
1252 "\n")
1253 (when subject (insert subject "\n\n"))
1254 (cond (msg (insert msg "\n"))
1255 - ((file-readable-p ".dotest/msg")
1256 - (insert-file-contents ".dotest/msg"))
1255 + ((file-readable-p ".git/rebase/msg")
1256 + (insert-file-contents ".git/rebase/msg"))
1257 ((file-readable-p ".git/MERGE_MSG")
1258 (insert-file-contents ".git/MERGE_MSG")))
1259 ; delete empty lines at end
@@ -1272,9 +1272,9 @@ Return the list of files that haven't been handled."
1272 (coding-system (git-get-commits-coding-system))
1273 author-name author-email subject date)
1274 (when (eq 0 (buffer-size buffer))
1275 - (when (file-readable-p ".dotest/info")
1275 + (when (file-readable-p ".git/rebase/info")
1276 (with-temp-buffer
1277 - (insert-file-contents ".dotest/info")
1277 + (insert-file-contents ".git/rebase/info")
1278 (goto-char (point-min))
1279 (when (re-search-forward "^Author: \\(.*\\)\nEmail: \\(.*\\)$" nil t)
1280 (setq author-name (match-string 1))
git-am.sh
+3 -3
@@ -119,7 +119,7 @@ It does not apply to blobs recorded in its index."
119 }
120
121 prec=4
122 -dotest=".dotest"
122 +dotest="$GIT_DIR/rebase"
123 sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=
124 resolvemsg= resume=
125 git_apply_opt=
@@ -195,7 +195,7 @@ then
195 false
196 ;;
197 esac ||
198 - die "previous dotest directory $dotest still exists but mbox given."
198 + die "previous rebase directory $dotest still exists but mbox given."
199 resume=yes
200 else
201 # Make sure we are not given --skip nor --resolved
@@ -325,7 +325,7 @@ do
325 <"$dotest"/info >/dev/null &&
326 go_next && continue
327
328 - test -s $dotest/patch || {
328 + test -s "$dotest/patch" || {
329 echo "Patch is empty. Was it split wrong?"
330 stop_here $this
331 }
git-quiltimport.sh
+1 -1
@@ -53,7 +53,7 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
53 fi
54
55 # Temporary directories
56 -tmp_dir=.dotest
56 +tmp_dir="$GIT_DIR"/rebase
57 tmp_msg="$tmp_dir/msg"
58 tmp_patch="$tmp_dir/patch"
59 tmp_info="$tmp_dir/info"
git-rebase--interactive.sh
+1 -1
@@ -31,7 +31,7 @@ skip skip current patch and continue rebasing process
31 . git-sh-setup
32 require_work_tree
33
34 -DOTEST="$GIT_DIR/.dotest-merge"
34 +DOTEST="$GIT_DIR/rebase-merge"
35 TODO="$DOTEST"/git-rebase-todo
36 DONE="$DOTEST"/done
37 MSG="$DOTEST"/message
git-rebase.sh
+22 -22
@@ -14,7 +14,7 @@ It is possible that a merge failure will prevent this process from being
14 completely automatic. You will have to resolve any such merge failure
15 and run git rebase --continue. Another option is to bypass the commit
16 that caused the merge failure with git rebase --skip. To restore the
17 -original <branch> and remove the .dotest working files, use the command
17 +original <branch> and remove the .git/rebase working files, use the command
18 git rebase --abort instead.
19
20 Note that if <branch> is not specified on the command line, the
@@ -42,7 +42,7 @@ To restore the original branch and stop rebasing run \"git rebase --abort\".
42 unset newbase
43 strategy=recursive
44 do_merge=
45 -dotest=$GIT_DIR/.dotest-merge
45 +dotest="$GIT_DIR"/rebase-merge
46 prec=4
47 verbose=
48 git_am_opt=
@@ -150,7 +150,7 @@ while test $# != 0
150 do
151 case "$1" in
152 --continue)
153 - test -d "$dotest" -o -d .dotest ||
153 + test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
154 die "No rebase in progress?"
155
156 git diff-files --quiet --ignore-submodules || {
@@ -173,15 +173,15 @@ do
173 finish_rb_merge
174 exit
175 fi
176 - head_name=$(cat .dotest/head-name) &&
177 - onto=$(cat .dotest/onto) &&
178 - orig_head=$(cat .dotest/orig-head) &&
176 + head_name=$(cat "$GIT_DIR"/rebase/head-name) &&
177 + onto=$(cat "$GIT_DIR"/rebase/onto) &&
178 + orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
179 git am --resolved --3way --resolvemsg="$RESOLVEMSG" &&
180 move_to_original_branch
181 exit
182 ;;
183 --skip)
184 - test -d "$dotest" -o -d .dotest ||
184 + test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
185 die "No rebase in progress?"
186
187 git reset --hard HEAD || exit $?
@@ -201,15 +201,15 @@ do
201 finish_rb_merge
202 exit
203 fi
204 - head_name=$(cat .dotest/head-name) &&
205 - onto=$(cat .dotest/onto) &&
206 - orig_head=$(cat .dotest/orig-head) &&
204 + head_name=$(cat "$GIT_DIR"/rebase/head-name) &&
205 + onto=$(cat "$GIT_DIR"/rebase/onto) &&
206 + orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
207 git am -3 --skip --resolvemsg="$RESOLVEMSG" &&
208 move_to_original_branch
209 exit
210 ;;
211 --abort)
212 - test -d "$dotest" -o -d .dotest ||
212 + test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
213 die "No rebase in progress?"
214
215 git rerere clear
@@ -217,7 +217,7 @@ do
217 then
218 move_to_original_branch
219 else
220 - dotest=.dotest
220 + dotest="$GIT_DIR"/rebase
221 move_to_original_branch
222 fi
223 git reset --hard $(cat "$dotest/orig-head")
@@ -265,24 +265,24 @@ do
265 shift
266 done
267
268 -# Make sure we do not have .dotest
268 +# Make sure we do not have $GIT_DIR/rebase
269 if test -z "$do_merge"
270 then
271 - if mkdir .dotest
271 + if mkdir "$GIT_DIR"/rebase
272 then
273 - rmdir .dotest
273 + rmdir "$GIT_DIR"/rebase
274 else
275 echo >&2 '
276 -It seems that I cannot create a .dotest directory, and I wonder if you
276 +It seems that I cannot create a '"$GIT_DIR"'/rebase directory, and I wonder if you
277 are in the middle of patch application or another rebase. If that is not
278 -the case, please rm -fr .dotest and run me again. I am stopping in case
278 +the case, please rm -fr '"$GIT_DIR"'/rebase and run me again. I am stopping in case
279 you still have something valuable there.'
280 exit 1
281 fi
282 else
283 if test -d "$dotest"
284 then
285 - die "previous dotest directory $dotest still exists." \
285 + die "previous rebase directory $dotest still exists." \
286 'try git-rebase < --continue | --abort >'
287 fi
288 fi
@@ -396,10 +396,10 @@ then
396 git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
397 move_to_original_branch
398 ret=$?
399 - test 0 != $ret -a -d .dotest &&
400 - echo $head_name > .dotest/head-name &&
401 - echo $onto > .dotest/onto &&
402 - echo $orig_head > .dotest/orig-head
399 + test 0 != $ret -a -d "$GIT_DIR"/rebase &&
400 + echo $head_name > "$GIT_DIR"/rebase/head-name &&
401 + echo $onto > "$GIT_DIR"/rebase/onto &&
402 + echo $orig_head > "$GIT_DIR"/rebase/orig-head
403 exit $ret
404 fi
405
t/t3401-rebase-partial.sh
+2 -2
@@ -50,12 +50,12 @@ test_debug \
50
51 test_expect_success \
52 'rebase topic branch against new master and check git-am did not get halted' \
53 - 'git-rebase master && test ! -d .dotest'
53 + 'git-rebase master && test ! -d .git/rebase'
54
55 test_expect_success \
56 'rebase --merge topic branch that was partially merged upstream' \
57 'git-checkout -f my-topic-branch-merge &&
58 git-rebase --merge master-merge &&
59 - test ! -d .git/.dotest-merge'
59 + test ! -d .git/rebase-merge'
60
61 test_done
t/t3404-rebase-interactive.sh
+4 -4
@@ -159,19 +159,19 @@ test_expect_success 'stop on conflicting pick' '
159 git tag new-branch1 &&
160 test_must_fail git rebase -i master &&
161 test "$(git rev-parse HEAD~3)" = "$(git rev-parse master)" &&
162 - test_cmp expect .git/.dotest-merge/patch &&
162 + test_cmp expect .git/rebase-merge/patch &&
163 test_cmp expect2 file1 &&
164 test "$(git-diff --name-status |
165 sed -n -e "/^U/s/^U[^a-z]*//p")" = file1 &&
166 - test 4 = $(grep -v "^#" < .git/.dotest-merge/done | wc -l) &&
167 - test 0 = $(grep -c "^[^#]" < .git/.dotest-merge/git-rebase-todo)
166 + test 4 = $(grep -v "^#" < .git/rebase-merge/done | wc -l) &&
167 + test 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo)
168 '
169
170 test_expect_success 'abort' '
171 git rebase --abort &&
172 test $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&
173 test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&
174 - ! test -d .git/.dotest-merge
174 + ! test -d .git/rebase-merge
175 '
176
177 test_expect_success 'retain authorship' '
t/t3407-rebase-abort.sh
+2 -2
@@ -74,7 +74,7 @@ testrebase() {
74 '
75 }
76
77 -testrebase "" .dotest
78 -testrebase " --merge" .git/.dotest-merge
77 +testrebase "" .git/rebase
78 +testrebase " --merge" .git/rebase-merge
79
80 test_done
t/t4150-am.sh
+11 -11
@@ -102,7 +102,7 @@ test_expect_success 'am applies patch correctly' '
102 git checkout first &&
103 test_tick &&
104 git am <patch1 &&
105 - ! test -d .dotest &&
105 + ! test -d .git/rebase &&
106 test -z "$(git diff second)" &&
107 test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
108 test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
@@ -123,7 +123,7 @@ test_expect_success 'am changes committer and keeps author' '
123 test_tick &&
124 git checkout first &&
125 git am patch2 &&
126 - ! test -d .dotest &&
126 + ! test -d .git/rebase &&
127 test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
128 test -z "$(git diff master..HEAD)" &&
129 test -z "$(git diff master^..HEAD^)" &&
@@ -163,7 +163,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '
163 test_expect_success 'am --keep really keeps the subject' '
164 git checkout HEAD^ &&
165 git am --keep patch4 &&
166 - ! test -d .dotest &&
166 + ! test -d .git/rebase &&
167 git-cat-file commit HEAD |
168 grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third"
169 '
@@ -176,19 +176,19 @@ test_expect_success 'am -3 falls back to 3-way merge' '
176 test_tick &&
177 git commit -m "copied stuff" &&
178 git am -3 lorem-move.patch &&
179 - ! test -d .dotest &&
179 + ! test -d .git/rebase &&
180 test -z "$(git diff lorem)"
181 '
182
183 test_expect_success 'am pauses on conflict' '
184 git checkout lorem2^^ &&
185 ! git am lorem-move.patch &&
186 - test -d .dotest
186 + test -d .git/rebase
187 '
188
189 test_expect_success 'am --skip works' '
190 git am --skip &&
191 - ! test -d .dotest &&
191 + ! test -d .git/rebase &&
192 test -z "$(git diff lorem2^^ -- file)" &&
193 test goodbye = "$(cat another)"
194 '
@@ -196,31 +196,31 @@ test_expect_success 'am --skip works' '
196 test_expect_success 'am --resolved works' '
197 git checkout lorem2^^ &&
198 ! git am lorem-move.patch &&
199 - test -d .dotest &&
199 + test -d .git/rebase &&
200 echo resolved >>file &&
201 git add file &&
202 git am --resolved &&
203 - ! test -d .dotest &&
203 + ! test -d .git/rebase &&
204 test goodbye = "$(cat another)"
205 '
206
207 test_expect_success 'am takes patches from a Pine mailbox' '
208 git checkout first &&
209 cat pine patch1 | git am &&
210 - ! test -d .dotest &&
210 + ! test -d .git/rebase &&
211 test -z "$(git diff master^..HEAD)"
212 '
213
214 test_expect_success 'am fails on mail without patch' '
215 ! git am <failmail &&
216 - rm -r .dotest/
216 + rm -r .git/rebase/
217 '
218
219 test_expect_success 'am fails on empty patch' '
220 echo "---" >>failmail &&
221 ! git am <failmail &&
222 git am --skip &&
223 - ! test -d .dotest
223 + ! test -d .git/rebase
224 '
225
226 test_expect_success 'am works from stdin in subdirectory' '
t/t9106-git-svn-commit-diff-clobber.sh
+1 -1
@@ -87,7 +87,7 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
87 "
88
89
90 -test_expect_success 'check that rebase really failed' 'test -d .dotest'
90 +test_expect_success 'check that rebase really failed' 'test -d .git/rebase'
91
92 test_expect_success 'resolve, continue the rebase and dcommit' "
93 echo clobber and I really mean it > file &&