Rename .git/rebase to .git/rebase-apply
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Mon, 21 Jul 2008 10:51:02 +0000 (12:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Jul 2008 01:51:47 +0000 (18:51 -0700)
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>
13 files changed:
Documentation/SubmittingPatches
Documentation/git-am.txt
Documentation/git-rebase.txt
Documentation/user-manual.txt
contrib/completion/git-completion.bash
contrib/emacs/git.el
git-am.sh
git-quiltimport.sh
git-rebase.sh
t/t3401-rebase-partial.sh
t/t3407-rebase-abort.sh
t/t4150-am.sh
t/t9106-git-svn-commit-diff-clobber.sh
index fdfa5364414358e006ac20a20672f6c4408cde5d..841bead9db18a025638570c10cac72bcf4791f68 100644 (file)
@@ -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
   patch appropriately.
 
 * Your MUA corrupted your patch; "am" would complain that
-  the patch does not apply.  Look at .git/rebase/ subdirectory and
+  the patch does not apply.  Look at .git/rebase-apply/ subdirectory and
   see what 'patch' file contains and check for the common
   corruption patterns mentioned above.
 
   see what 'patch' file contains and check for the common
   corruption patterns mentioned above.
 
index 719e924980a45ddedce3c0d6f774957b07477fba..c45c53ec2404725394563a9fba40f31cd314adb2 100644 (file)
@@ -143,9 +143,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 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 `.git/rebase`
+The command refuses to process new mailboxes while `.git/rebase-apply`
 directory exists, so if you decide to start over from scratch,
 directory exists, so if you decide to start over from scratch,
-run `rm -f -r .git/rebase` before running the command with mailbox
+run `rm -f -r .git/rebase-apply` before running the command with mailbox
 names.
 
 Before any patches are applied, ORIG_HEAD is set to the tip of the
 names.
 
 Before any patches are applied, ORIG_HEAD is set to the tip of the
index 58a5c746ba221be9da55da6f1100c852aa076a18..59c1b021a6c410e1097df21d6d47365aec6689e2 100644 (file)
@@ -39,8 +39,8 @@ 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
 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 .git/rebase working files, use the command
-`git rebase --abort` instead.
+original <branch> and remove the .git/rebase-apply working files, use the
+command `git rebase --abort` instead.
 
 Assume the following history exists and the current branch is "topic":
 
 
 Assume the following history exists and the current branch is "topic":
 
index 8761ee7e7d7ffe1202daff13c68a81dd2b19e18f..c5641af19059f5531e43bd4d4ff495548030fe98 100644 (file)
@@ -2431,7 +2431,7 @@ $ git rebase origin
 -------------------------------------------------
 
 This will remove each of your commits from mywork, temporarily saving
 -------------------------------------------------
 
 This will remove each of your commits from mywork, temporarily saving
-them as patches (in a directory named ".git/rebase"), update mywork to
+them as patches (in a directory named ".git/rebase-apply"), 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:
 
 point at the latest version of origin, then apply each of the saved
 patches to the new mywork.  The result will look like:
 
index 29f6cd4e9eb07f39cc08838ed52be6cf2c438c2e..2edb341b570315b6ac1500775e03897a24afb23e 100755 (executable)
@@ -73,12 +73,12 @@ __git_ps1 ()
        if [ -n "$g" ]; then
                local r
                local b
        if [ -n "$g" ]; then
                local r
                local b
-               if [ -d "$g/rebase" ]
+               if [ -d "$g/rebase-apply" ]
                then
                then
-                       if test -f "$g/rebase/rebasing"
+                       if test -f "$g/rebase-apply/rebasing"
                        then
                                r="|REBASE"
                        then
                                r="|REBASE"
-                       elif test -f "$g/rebase/applying"
+                       elif test -f "$g/rebase-apply/applying"
                        then
                                r="|AM"
                        else
                        then
                                r="|AM"
                        else
@@ -488,7 +488,7 @@ __git_whitespacelist="nowarn warn error error-all strip"
 _git_am ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
 _git_am ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
-       if [ -d "$dir"/rebase ]; then
+       if [ -d "$dir"/rebase-apply ]; then
                __gitcomp "--skip --resolved"
                return
        fi
                __gitcomp "--skip --resolved"
                return
        fi
@@ -915,7 +915,7 @@ _git_push ()
 _git_rebase ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
 _git_rebase ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
-       if [ -d "$dir"/rebase ] || [ -d "$dir"/rebase-merge ]; then
+       if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
                __gitcomp "--continue --skip --abort"
                return
        fi
                __gitcomp "--continue --skip --abort"
                return
        fi
index 43b059bbaa193a07c5a020286a3fbba343ccfbc1..c1cf1cbcc014e5d6c01a1c33efa2d7bd3b76df88 100644 (file)
@@ -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"))
        "\n")
       (when subject (insert subject "\n\n"))
       (cond (msg (insert msg "\n"))
-            ((file-readable-p ".git/rebase/msg")
-             (insert-file-contents ".git/rebase/msg"))
+            ((file-readable-p ".git/rebase-apply/msg")
+             (insert-file-contents ".git/rebase-apply/msg"))
             ((file-readable-p ".git/MERGE_MSG")
              (insert-file-contents ".git/MERGE_MSG")))
       ; delete empty lines at end
             ((file-readable-p ".git/MERGE_MSG")
              (insert-file-contents ".git/MERGE_MSG")))
       ; delete empty lines at end
@@ -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))
           (coding-system (git-get-commits-coding-system))
           author-name author-email subject date)
       (when (eq 0 (buffer-size buffer))
-        (when (file-readable-p ".git/rebase/info")
+        (when (file-readable-p ".git/rebase-apply/info")
           (with-temp-buffer
           (with-temp-buffer
-            (insert-file-contents ".git/rebase/info")
+            (insert-file-contents ".git/rebase-apply/info")
             (goto-char (point-min))
             (when (re-search-forward "^Author: \\(.*\\)\nEmail: \\(.*\\)$" nil t)
               (setq author-name (match-string 1))
             (goto-char (point-min))
             (when (re-search-forward "^Author: \\(.*\\)\nEmail: \\(.*\\)$" nil t)
               (setq author-name (match-string 1))
index 60aaa4a583d3e2466ea788d7047a9fc8252b1fe6..9bf12feeb261a9c64568600ef33301e1585f57bb 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
 }
 
 prec=4
 }
 
 prec=4
-dotest="$GIT_DIR/rebase"
+dotest="$GIT_DIR/rebase-apply"
 sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
 sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
index c9aecfd9132f2cb199add497d6c6ab2ebb79fdba..cebaee1cc9dfc28d80173583b144a480be2f9bfd 100755 (executable)
@@ -53,7 +53,7 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
 fi
 
 # Temporary directories
 fi
 
 # Temporary directories
-tmp_dir="$GIT_DIR"/rebase
+tmp_dir="$GIT_DIR"/rebase-apply
 tmp_msg="$tmp_dir/msg"
 tmp_patch="$tmp_dir/patch"
 tmp_info="$tmp_dir/info"
 tmp_msg="$tmp_dir/msg"
 tmp_patch="$tmp_dir/patch"
 tmp_info="$tmp_dir/info"
index 6ef5754814babdb908d794ea030aceca6597b190..412e135c3ae88d76b5bdf3f08083b153da220a95 100755 (executable)
@@ -14,8 +14,8 @@ 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
 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 .git/rebase working files, use the command
-git rebase --abort instead.
+original <branch> and remove the .git/rebase-apply working files, use the
+command git rebase --abort instead.
 
 Note that if <branch> is not specified on the command line, the
 currently checked out branch is used.
 
 Note that if <branch> is not specified on the command line, the
 currently checked out branch is used.
@@ -150,7 +150,7 @@ while test $# != 0
 do
        case "$1" in
        --continue)
 do
        case "$1" in
        --continue)
-               test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
+               test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
                        die "No rebase in progress?"
 
                git diff-files --quiet --ignore-submodules || {
                        die "No rebase in progress?"
 
                git diff-files --quiet --ignore-submodules || {
@@ -173,15 +173,15 @@ do
                        finish_rb_merge
                        exit
                fi
                        finish_rb_merge
                        exit
                fi
-               head_name=$(cat "$GIT_DIR"/rebase/head-name) &&
-               onto=$(cat "$GIT_DIR"/rebase/onto) &&
-               orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
+               head_name=$(cat "$GIT_DIR"/rebase-apply/head-name) &&
+               onto=$(cat "$GIT_DIR"/rebase-apply/onto) &&
+               orig_head=$(cat "$GIT_DIR"/rebase-apply/orig-head) &&
                git am --resolved --3way --resolvemsg="$RESOLVEMSG" &&
                move_to_original_branch
                exit
                ;;
        --skip)
                git am --resolved --3way --resolvemsg="$RESOLVEMSG" &&
                move_to_original_branch
                exit
                ;;
        --skip)
-               test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
+               test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
                        die "No rebase in progress?"
 
                git reset --hard HEAD || exit $?
                        die "No rebase in progress?"
 
                git reset --hard HEAD || exit $?
@@ -201,15 +201,15 @@ do
                        finish_rb_merge
                        exit
                fi
                        finish_rb_merge
                        exit
                fi
-               head_name=$(cat "$GIT_DIR"/rebase/head-name) &&
-               onto=$(cat "$GIT_DIR"/rebase/onto) &&
-               orig_head=$(cat "$GIT_DIR"/rebase/orig-head) &&
+               head_name=$(cat "$GIT_DIR"/rebase-apply/head-name) &&
+               onto=$(cat "$GIT_DIR"/rebase-apply/onto) &&
+               orig_head=$(cat "$GIT_DIR"/rebase-apply/orig-head) &&
                git am -3 --skip --resolvemsg="$RESOLVEMSG" &&
                move_to_original_branch
                exit
                ;;
        --abort)
                git am -3 --skip --resolvemsg="$RESOLVEMSG" &&
                move_to_original_branch
                exit
                ;;
        --abort)
-               test -d "$dotest" -o -d "$GIT_DIR"/rebase ||
+               test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
                        die "No rebase in progress?"
 
                git rerere clear
                        die "No rebase in progress?"
 
                git rerere clear
@@ -217,7 +217,7 @@ do
                then
                        move_to_original_branch
                else
                then
                        move_to_original_branch
                else
-                       dotest="$GIT_DIR"/rebase
+                       dotest="$GIT_DIR"/rebase-apply
                        move_to_original_branch
                fi
                git reset --hard $(cat "$dotest/orig-head")
                        move_to_original_branch
                fi
                git reset --hard $(cat "$dotest/orig-head")
@@ -265,18 +265,20 @@ do
        shift
 done
 
        shift
 done
 
-# Make sure we do not have $GIT_DIR/rebase
+# Make sure we do not have $GIT_DIR/rebase-apply
 if test -z "$do_merge"
 then
 if test -z "$do_merge"
 then
-       if mkdir "$GIT_DIR"/rebase
+       if mkdir "$GIT_DIR"/rebase-apply
        then
        then
-               rmdir "$GIT_DIR"/rebase
+               rmdir "$GIT_DIR"/rebase-apply
        else
                echo >&2 '
        else
                echo >&2 '
-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 '"$GIT_DIR"'/rebase and run me again.  I am stopping in case
-you still have something valuable there.'
+It seems that I cannot create a '"$GIT_DIR"'/rebase-apply 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 '"$GIT_DIR"'/rebase-apply
+ and run me again.  I am stopping in case you still have something
+valuable there.'
                exit 1
        fi
 else
                exit 1
        fi
 else
@@ -395,10 +397,10 @@ then
        git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
        move_to_original_branch
        ret=$?
        git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
        move_to_original_branch
        ret=$?
-       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
+       test 0 != $ret -a -d "$GIT_DIR"/rebase-apply &&
+               echo $head_name > "$GIT_DIR"/rebase-apply/head-name &&
+               echo $onto > "$GIT_DIR"/rebase-apply/onto &&
+               echo $orig_head > "$GIT_DIR"/rebase-apply/orig-head
        exit $ret
 fi
 
        exit $ret
 fi
 
index 36d9a2ae3aa7adb0bff18bb2a4180a2ba4369766..166ddb1447db4c33a79f0e9aea21cb00e8a151f2 100755 (executable)
@@ -50,7 +50,7 @@ test_debug \
 
 test_expect_success \
     'rebase topic branch against new master and check git-am did not get halted' \
 
 test_expect_success \
     'rebase topic branch against new master and check git-am did not get halted' \
-    'git-rebase master && test ! -d .git/rebase'
+    'git-rebase master && test ! -d .git/rebase-apply'
 
 test_expect_success \
        'rebase --merge topic branch that was partially merged upstream' \
 
 test_expect_success \
        'rebase --merge topic branch that was partially merged upstream' \
index 12c8804a030f889bc0a416d5743600aa8a427eb7..4de550a632e6ead08c9629e80901e4735c53f55c 100755 (executable)
@@ -74,7 +74,7 @@ testrebase() {
        '
 }
 
        '
 }
 
-testrebase "" .git/rebase
+testrebase "" .git/rebase-apply
 testrebase " --merge" .git/rebase-merge
 
 test_done
 testrebase " --merge" .git/rebase-merge
 
 test_done
index 98ba020d895f05c269fbba2a91c66d874245b145..6e6aaf59364456e21bb1deda960edb5295a71131 100755 (executable)
@@ -102,7 +102,7 @@ test_expect_success 'am applies patch correctly' '
        git checkout first &&
        test_tick &&
        git am <patch1 &&
        git checkout first &&
        test_tick &&
        git am <patch1 &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        test -z "$(git diff second)" &&
        test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
        test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
        test -z "$(git diff second)" &&
        test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
        test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
@@ -123,7 +123,7 @@ test_expect_success 'am changes committer and keeps author' '
        test_tick &&
        git checkout first &&
        git am patch2 &&
        test_tick &&
        git checkout first &&
        git am patch2 &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
        test -z "$(git diff master..HEAD)" &&
        test -z "$(git diff master^..HEAD^)" &&
        test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
        test -z "$(git diff master..HEAD)" &&
        test -z "$(git diff master^..HEAD^)" &&
@@ -163,7 +163,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '
 test_expect_success 'am --keep really keeps the subject' '
        git checkout HEAD^ &&
        git am --keep patch4 &&
 test_expect_success 'am --keep really keeps the subject' '
        git checkout HEAD^ &&
        git am --keep patch4 &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        git-cat-file commit HEAD |
                grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third"
 '
        git-cat-file commit HEAD |
                grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third"
 '
@@ -176,19 +176,19 @@ test_expect_success 'am -3 falls back to 3-way merge' '
        test_tick &&
        git commit -m "copied stuff" &&
        git am -3 lorem-move.patch &&
        test_tick &&
        git commit -m "copied stuff" &&
        git am -3 lorem-move.patch &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        test -z "$(git diff lorem)"
 '
 
 test_expect_success 'am pauses on conflict' '
        git checkout lorem2^^ &&
        test_must_fail git am lorem-move.patch &&
        test -z "$(git diff lorem)"
 '
 
 test_expect_success 'am pauses on conflict' '
        git checkout lorem2^^ &&
        test_must_fail git am lorem-move.patch &&
-       test -d .git/rebase
+       test -d .git/rebase-apply
 '
 
 test_expect_success 'am --skip works' '
        git am --skip &&
 '
 
 test_expect_success 'am --skip works' '
        git am --skip &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        test -z "$(git diff lorem2^^ -- file)" &&
        test goodbye = "$(cat another)"
 '
        test -z "$(git diff lorem2^^ -- file)" &&
        test goodbye = "$(cat another)"
 '
@@ -196,31 +196,31 @@ test_expect_success 'am --skip works' '
 test_expect_success 'am --resolved works' '
        git checkout lorem2^^ &&
        test_must_fail git am lorem-move.patch &&
 test_expect_success 'am --resolved works' '
        git checkout lorem2^^ &&
        test_must_fail git am lorem-move.patch &&
-       test -d .git/rebase &&
+       test -d .git/rebase-apply &&
        echo resolved >>file &&
        git add file &&
        git am --resolved &&
        echo resolved >>file &&
        git add file &&
        git am --resolved &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        test goodbye = "$(cat another)"
 '
 
 test_expect_success 'am takes patches from a Pine mailbox' '
        git checkout first &&
        cat pine patch1 | git am &&
        test goodbye = "$(cat another)"
 '
 
 test_expect_success 'am takes patches from a Pine mailbox' '
        git checkout first &&
        cat pine patch1 | git am &&
-       ! test -d .git/rebase &&
+       ! test -d .git/rebase-apply &&
        test -z "$(git diff master^..HEAD)"
 '
 
 test_expect_success 'am fails on mail without patch' '
        test_must_fail git am <failmail &&
        test -z "$(git diff master^..HEAD)"
 '
 
 test_expect_success 'am fails on mail without patch' '
        test_must_fail git am <failmail &&
-       rm -r .git/rebase/
+       rm -r .git/rebase-apply/
 '
 
 test_expect_success 'am fails on empty patch' '
        echo "---" >>failmail &&
        test_must_fail git am <failmail &&
        git am --skip &&
 '
 
 test_expect_success 'am fails on empty patch' '
        echo "---" >>failmail &&
        test_must_fail git am <failmail &&
        git am --skip &&
-       ! test -d .git/rebase
+       ! test -d .git/rebase-apply
 '
 
 test_expect_success 'am works from stdin in subdirectory' '
 '
 
 test_expect_success 'am works from stdin in subdirectory' '
index 08bf1f08e331790d1a4e2fd1c698ecd5ea860e41..83896e96876d8cca24496c7cb278732a308e3d92 100755 (executable)
@@ -87,7 +87,9 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
        "
 
 
        "
 
 
-test_expect_success 'check that rebase really failed' 'test -d .git/rebase'
+test_expect_success 'check that rebase really failed' '
+       test -d .git/rebase-apply
+'
 
 test_expect_success 'resolve, continue the rebase and dcommit' "
        echo clobber and I really mean it > file &&
 
 test_expect_success 'resolve, continue the rebase and dcommit' "
        echo clobber and I really mean it > file &&