@matheusbsbs / matheus-bagliano / commits / 51ef1daa4a
Fork 0

Rename .git/rebase to .git/rebase-apply

With git-am, it sounds awkward to have the patches in ".git/rebase/", but for technical reasons, we have to keep the same directory name for git-am and git-rebase. ".git/rebase-apply" seems to be a good compromise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jul 21, 2008 at 12:51 UTC 51ef1daa4a0dfaa4d777b2fa949ba051cf800554
13 files changed +58 -54
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 .git/rebase/ subdirectory and
304 + the patch does not apply. Look at .git/rebase-apply/ 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
@@ -143,9 +143,9 @@ aborts in the middle,. You can recover from this in one of two ways:
143 the index file to bring it in a state that the patch should
144 have produced. Then run the command with '--resolved' option.
145
146 -The command refuses to process new mailboxes while `.git/rebase`
146 +The command refuses to process new mailboxes while `.git/rebase-apply`
147 directory exists, so if you decide to start over from scratch,
148 -run `rm -f -r .git/rebase` before running the command with mailbox
148 +run `rm -f -r .git/rebase-apply` before running the command with mailbox
149 names.
150
151 Before any patches are applied, ORIG_HEAD is set to the tip of the
Documentation/git-rebase.txt
+2 -2
@@ -39,8 +39,8 @@ 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 .git/rebase working files, use the command
43 -`git rebase --abort` instead.
42 +original <branch> and remove the .git/rebase-apply working files, use the
43 +command `git rebase --abort` instead.
44
45 Assume the following history exists and the current branch is "topic":
46
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 ".git/rebase"), update mywork to
2434 +them as patches (in a directory named ".git/rebase-apply"), 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
+5 -5
@@ -73,12 +73,12 @@ __git_ps1 ()
73 if [ -n "$g" ]; then
74 local r
75 local b
76 - if [ -d "$g/rebase" ]
76 + if [ -d "$g/rebase-apply" ]
77 then
78 - if test -f "$g/rebase/rebasing"
78 + if test -f "$g/rebase-apply/rebasing"
79 then
80 r="|REBASE"
81 - elif test -f "$g/rebase/applying"
81 + elif test -f "$g/rebase-apply/applying"
82 then
83 r="|AM"
84 else
@@ -488,7 +488,7 @@ __git_whitespacelist="nowarn warn error error-all strip"
488 _git_am ()
489 {
490 local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
491 - if [ -d "$dir"/rebase ]; then
491 + if [ -d "$dir"/rebase-apply ]; 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 "$dir"/rebase ] || [ -d "$dir"/rebase-merge ]; then
918 + if [ -d "$dir"/rebase-apply ] || [ -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 ".git/rebase/msg")
1256 - (insert-file-contents ".git/rebase/msg"))
1255 + ((file-readable-p ".git/rebase-apply/msg")
1256 + (insert-file-contents ".git/rebase-apply/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 ".git/rebase/info")
1275 + (when (file-readable-p ".git/rebase-apply/info")
1276 (with-temp-buffer
1277 - (insert-file-contents ".git/rebase/info")
1277 + (insert-file-contents ".git/rebase-apply/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
+1 -1
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
121 }
122
123 prec=4
124 -dotest="$GIT_DIR/rebase"
124 +dotest="$GIT_DIR/rebase-apply"
125 sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
126 resolvemsg= resume=
127 git_apply_opt=
git-quiltimport.sh
+1 -1
@@ -53,7 +53,7 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
53 fi
54
55 # Temporary directories
56 -tmp_dir="$GIT_DIR"/rebase
56 +tmp_dir="$GIT_DIR"/rebase-apply
57 tmp_msg="$tmp_dir/msg"
58 tmp_patch="$tmp_dir/patch"
59 tmp_info="$tmp_dir/info"
git-rebase.sh
+25 -23
@@ -14,8 +14,8 @@ 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 .git/rebase working files, use the command
18 -git rebase --abort instead.
17 +original <branch> and remove the .git/rebase-apply working files, use the
18 +command git rebase --abort instead.
19
20 Note that if <branch> is not specified on the command line, the
21 currently checked out branch is used.
@@ -150,7 +150,7 @@ while test $# != 0
150 do
151 case "$1" in
152 --continue)
153 - test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
153 + test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
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 "$GIT_DIR"/rebase/head-name) &&
177 - onto=$(cat "$GIT_DIR"/rebase/onto) &&
178 - orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
176 + head_name=$(cat "$GIT_DIR"/rebase-apply/head-name) &&
177 + onto=$(cat "$GIT_DIR"/rebase-apply/onto) &&
178 + orig_head=$(cat "$GIT_DIR"/rebase-apply/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 "$GIT_DIR"/rebase ||
184 + test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
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 "$GIT_DIR"/rebase/head-name) &&
205 - onto=$(cat "$GIT_DIR"/rebase/onto) &&
206 - orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
204 + head_name=$(cat "$GIT_DIR"/rebase-apply/head-name) &&
205 + onto=$(cat "$GIT_DIR"/rebase-apply/onto) &&
206 + orig_head=$(cat "$GIT_DIR"/rebase-apply/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 "$GIT_DIR"/rebase ||
212 + test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
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="$GIT_DIR"/rebase
220 + dotest="$GIT_DIR"/rebase-apply
221 move_to_original_branch
222 fi
223 git reset --hard $(cat "$dotest/orig-head")
@@ -265,18 +265,20 @@ do
265 shift
266 done
267
268 -# Make sure we do not have $GIT_DIR/rebase
268 +# Make sure we do not have $GIT_DIR/rebase-apply
269 if test -z "$do_merge"
270 then
271 - if mkdir "$GIT_DIR"/rebase
271 + if mkdir "$GIT_DIR"/rebase-apply
272 then
273 - rmdir "$GIT_DIR"/rebase
273 + rmdir "$GIT_DIR"/rebase-apply
274 else
275 echo >&2 '
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 '"$GIT_DIR"'/rebase and run me again. I am stopping in case
279 -you still have something valuable there.'
276 +It seems that I cannot create a '"$GIT_DIR"'/rebase-apply directory,
277 +and I wonder if you are in the middle of patch application or another
278 +rebase. If that is not the case, please
279 + rm -fr '"$GIT_DIR"'/rebase-apply
280 + and run me again. I am stopping in case you still have something
281 +valuable there.'
282 exit 1
283 fi
284 else
@@ -395,10 +397,10 @@ then
397 git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
398 move_to_original_branch
399 ret=$?
398 - test 0 != $ret -a -d "$GIT_DIR"/rebase &&
399 - echo $head_name > "$GIT_DIR"/rebase/head-name &&
400 - echo $onto > "$GIT_DIR"/rebase/onto &&
401 - echo $orig_head > "$GIT_DIR"/rebase/orig-head
400 + test 0 != $ret -a -d "$GIT_DIR"/rebase-apply &&
401 + echo $head_name > "$GIT_DIR"/rebase-apply/head-name &&
402 + echo $onto > "$GIT_DIR"/rebase-apply/onto &&
403 + echo $orig_head > "$GIT_DIR"/rebase-apply/orig-head
404 exit $ret
405 fi
406
t/t3401-rebase-partial.sh
+1 -1
@@ -50,7 +50,7 @@ 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 .git/rebase'
53 + 'git-rebase master && test ! -d .git/rebase-apply'
54
55 test_expect_success \
56 'rebase --merge topic branch that was partially merged upstream' \
t/t3407-rebase-abort.sh
+1 -1
@@ -74,7 +74,7 @@ testrebase() {
74 '
75 }
76
77 -testrebase "" .git/rebase
77 +testrebase "" .git/rebase-apply
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 .git/rebase &&
105 + ! test -d .git/rebase-apply &&
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 .git/rebase &&
126 + ! test -d .git/rebase-apply &&
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 .git/rebase &&
166 + ! test -d .git/rebase-apply &&
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 .git/rebase &&
179 + ! test -d .git/rebase-apply &&
180 test -z "$(git diff lorem)"
181 '
182
183 test_expect_success 'am pauses on conflict' '
184 git checkout lorem2^^ &&
185 test_must_fail git am lorem-move.patch &&
186 - test -d .git/rebase
186 + test -d .git/rebase-apply
187 '
188
189 test_expect_success 'am --skip works' '
190 git am --skip &&
191 - ! test -d .git/rebase &&
191 + ! test -d .git/rebase-apply &&
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 test_must_fail git am lorem-move.patch &&
199 - test -d .git/rebase &&
199 + test -d .git/rebase-apply &&
200 echo resolved >>file &&
201 git add file &&
202 git am --resolved &&
203 - ! test -d .git/rebase &&
203 + ! test -d .git/rebase-apply &&
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 .git/rebase &&
210 + ! test -d .git/rebase-apply &&
211 test -z "$(git diff master^..HEAD)"
212 '
213
214 test_expect_success 'am fails on mail without patch' '
215 test_must_fail git am <failmail &&
216 - rm -r .git/rebase/
216 + rm -r .git/rebase-apply/
217 '
218
219 test_expect_success 'am fails on empty patch' '
220 echo "---" >>failmail &&
221 test_must_fail git am <failmail &&
222 git am --skip &&
223 - ! test -d .git/rebase
223 + ! test -d .git/rebase-apply
224 '
225
226 test_expect_success 'am works from stdin in subdirectory' '
t/t9106-git-svn-commit-diff-clobber.sh
+3 -1
@@ -87,7 +87,9 @@ 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 .git/rebase'
90 +test_expect_success 'check that rebase really failed' '
91 + test -d .git/rebase-apply
92 +'
93
94 test_expect_success 'resolve, continue the rebase and dcommit' "
95 echo clobber and I really mean it > file &&