* Git rebase failure: .dotest overwritten
@ 2008-07-15 21:08 Joe Fiorini
2008-07-15 21:22 ` Stephan Beyer
0 siblings, 1 reply; 37+ messages in thread
From: Joe Fiorini @ 2008-07-15 21:08 UTC (permalink / raw)
To: git
A friend of mine asked me for help with a git rebase problem. I was
clueless. Here is what he was seeing:
The main problem seems to be the following error: "fatal: Untracked
working tree file '.dotest/0001' would be overwritten by merge."; also
all the files that it says "already exist in working directory" did
not exist before he ran the rebase. Maybe it's trying to run the
rebase more than once? His working copy was clean. Any thoughts? Any
other details I can provide?
Thanks!
Joe
git rebase master
First, rewinding head to replay your work on top of it...
HEAD is now at 9bba5f1... Create function snippet
Applying People page templates
.dotest/patch:59: trailing whitespace.
.dotest/patch:60: space before tab in indent.
parent::BuildControlArray($EventParameters);
.dotest/patch:61: space before tab in indent.
}
.dotest/patch:65: trailing whitespace, space before tab in indent.
.dotest/patch:67: trailing whitespace.
error: .dotest/0001: already exists in working directory
error: .dotest/0002: already exists in working directory
error: .dotest/0003: already exists in working directory
error: .dotest/binary: already exists in working directory
error: .dotest/final-commit: already exists in working directory
error: .dotest/info: already exists in working directory
error: .dotest/keep: already exists in working directory
error: .dotest/last: already exists in working directory
error: .dotest/msg: already exists in working directory
error: .dotest/msg-clean: already exists in working directory
error: .dotest/next: already exists in working directory
error: .dotest/patch: already exists in working directory
error: .dotest/sign: already exists in working directory
error: .dotest/utf8: already exists in working directory
error: .dotest/whitespace: already exists in working directory
Using index info to reconstruct a base tree...
stdin:59: trailing whitespace.
stdin:60: space before tab in indent.
parent::BuildControlArray($EventParameters);
stdin:61: space before tab in indent.
}
stdin:65: trailing whitespace, space before tab in indent.
stdin:67: trailing whitespace.
warning: squelched 49 whitespace errors
warning: 54 lines add whitespace errors.
Falling back to patching base and 3-way merge...
fatal: Untracked working tree file '.dotest/0001' would be overwritten by merge.
Failed to merge in the changes.
Patch failed at 0001.
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
--
joe fiorini
http://www.faithfulgeek.org
// freelancing & knowledge sharing
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Git rebase failure: .dotest overwritten
2008-07-15 21:08 Git rebase failure: .dotest overwritten Joe Fiorini
@ 2008-07-15 21:22 ` Stephan Beyer
2008-07-15 21:48 ` René Scharfe
0 siblings, 1 reply; 37+ messages in thread
From: Stephan Beyer @ 2008-07-15 21:22 UTC (permalink / raw)
To: Joe Fiorini; +Cc: git
Hi,
Joe Fiorini wrote:
> A friend of mine asked me for help with a git rebase problem. I was
> clueless. Here is what he was seeing:
> The main problem seems to be the following error: "fatal: Untracked
> working tree file '.dotest/0001' would be overwritten by merge."; also
> all the files that it says "already exist in working directory" did
> not exist before he ran the rebase. Maybe it's trying to run the
> rebase more than once? His working copy was clean. Any thoughts? Any
> other details I can provide?
git-rebase (without -i/-m) generates a directory called ".dotest/" to
save temporary stuff like the commits you want to rebase.
And it seems that at least one commit in his repo has .dotest/* files
in the tree, so that message occurs.
Hmm, he should perhaps clean that commit up and remove the .dotest
files from it. (After figuring out that commit, he could try
git rebase -i ...
and change the "pick" line to "edit".)
Regards.
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: Git rebase failure: .dotest overwritten
2008-07-15 21:22 ` Stephan Beyer
@ 2008-07-15 21:48 ` René Scharfe
2008-07-16 0:47 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Johannes Schindelin
0 siblings, 1 reply; 37+ messages in thread
From: René Scharfe @ 2008-07-15 21:48 UTC (permalink / raw)
To: Stephan Beyer; +Cc: Joe Fiorini, git, Johannes Schindelin, Jari Aalto
Stephan Beyer schrieb:
> git-rebase (without -i/-m) generates a directory called ".dotest/" to
> save temporary stuff like the commits you want to rebase.
In February it was discussed to move .dotest below $GIT_DIR. There was
even a patch (to rename it to .git-dotest). I suspect the upcoming
version 1.6.0 is a good opportunity to finally remove this wart.
René
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-15 21:48 ` René Scharfe
@ 2008-07-16 0:47 ` Johannes Schindelin
2008-07-16 0:57 ` Linus Torvalds
` (2 more replies)
0 siblings, 3 replies; 37+ messages in thread
From: Johannes Schindelin @ 2008-07-16 0:47 UTC (permalink / raw)
To: René Scharfe, gitster; +Cc: Stephan Beyer, Joe Fiorini, git, Jari Aalto
[-- Attachment #1: Type: TEXT/PLAIN, Size: 18180 bytes --]
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>
---
On Tue, 15 Jul 2008, René Scharfe wrote:
> Stephan Beyer schrieb:
> > git-rebase (without -i/-m) generates a directory called
> > ".dotest/" to save temporary stuff like the commits you want to
> > rebase.
>
> In February it was discussed to move .dotest below $GIT_DIR.
> There was even a patch (to rename it to .git-dotest). I suspect the
> upcoming version 1.6.0 is a good opportunity to finally remove this
> wart.
I kind of expected this to be a good opportunity to increase the
track record for a certain GSoC project, but here you have it.
Documentation/SubmittingPatches | 2 +-
Documentation/git-am.txt | 4 +-
Documentation/git-rebase.txt | 2 +-
Documentation/user-manual.txt | 2 +-
contrib/emacs/git.el | 8 +++---
git-am.sh | 6 ++--
git-completion.bash | 20 +++++++-------
git-quiltimport.sh | 2 +-
git-rebase--interactive.sh | 2 +-
git-rebase.sh | 46 ++++++++++++++++----------------
t/t3401-rebase-partial.sh | 4 +-
t/t3404-rebase-interactive.sh | 8 +++---
t/t3407-rebase-abort.sh | 4 +-
t/t4150-am.sh | 22 +++++++-------
t/t9106-git-svn-commit-diff-clobber.sh | 2 +-
15 files changed, 67 insertions(+), 67 deletions(-)
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b116475..fdfa536 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -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.
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 3863eeb..5b800d3 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -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.
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index f3459c7..c645073 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -38,7 +38,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":
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 01c1af6..94c9a58 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -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:
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 4fa853f..43b059b 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -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
@@ -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))
diff --git a/git-am.sh b/git-am.sh
index fe53608..3a11f8b 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -118,7 +118,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=
@@ -194,7 +194,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
@@ -324,7 +324,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
}
diff --git a/git-completion.bash b/git-completion.bash
index 04e2ef5..8c8af4f 100755
--- a/git-completion.bash
+++ b/git-completion.bash
@@ -68,26 +68,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"
@@ -455,8 +455,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
@@ -864,7 +864,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
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 7cd8f71..d1efa1d 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -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"
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 297b646..dd01a45 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -17,7 +17,7 @@ OPTIONS_SPEC=
. 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
diff --git a/git-rebase.sh b/git-rebase.sh
index bf0e7a9..74ff873 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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
@@ -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=
@@ -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 || {
@@ -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 $?
@@ -200,19 +200,19 @@ do
done
finish_rb_merge
exit
- elif ! test -d .dotest
+ elif ! test -d "$GIT_DIR"/rebase
then
die "No rebase in progress?"
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
@@ -220,7 +220,7 @@ do
then
move_to_original_branch
else
- dotest=.dotest
+ dotest="$GIT_DIR"/rebase
move_to_original_branch
fi
git reset --hard $(cat "$dotest/orig-head")
@@ -268,24 +268,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/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/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
@@ -399,10 +399,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
diff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh
index 4934a4e..36d9a2a 100755
--- a/t/t3401-rebase-partial.sh
+++ b/t/t3401-rebase-partial.sh
@@ -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
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 1c80148..d27554e 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -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' '
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 1777ffe..12c8804 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -74,7 +74,7 @@ testrebase() {
'
}
-testrebase "" .dotest
-testrebase " --merge" .git/.dotest-merge
+testrebase "" .git/rebase
+testrebase " --merge" .git/rebase-merge
test_done
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index bc98260..5cbd5ef 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -102,7 +102,7 @@ test_expect_success 'am applies patch correctly' '
git checkout first &&
test_tick &&
git am <patch1 &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
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 -d .dotest &&
+ ! test -d .git/rebase &&
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 -d .dotest &&
+ ! test -d .git/rebase &&
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 -d .dotest &&
+ ! test -d .git/rebase &&
test -z "$(git diff lorem)"
'
test_expect_success 'am pauses on conflict' '
git checkout lorem2^^ &&
! git am lorem-move.patch &&
- test -d .dotest
+ test -d .git/rebase
'
test_expect_success 'am --skip works' '
git am --skip &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
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^^ &&
! git am lorem-move.patch &&
- test -d .dotest &&
+ test -d .git/rebase &&
echo resolved >>file &&
git add file &&
git am --resolved &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
test goodbye = "$(cat another)"
'
test_expect_success 'am takes patches from a Pine mailbox' '
git checkout first &&
cat pine patch1 | git am &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
test -z "$(git diff master^..HEAD)"
'
test_expect_success 'am fails on mail without patch' '
! git am <failmail &&
- rm -r .dotest/
+ rm -r .git/rebase/
'
test_expect_success 'am fails on empty patch' '
echo "---" >>failmail &&
! git am <failmail &&
git am --skip &&
- ! test -d .dotest
+ ! test -d .git/rebase
'
test_expect_success 'am works from stdin in subdirectory' '
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index 58a3a7b..27a65e0 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -87,7 +87,7 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
"
-test_expect_success 'check that rebase really failed' 'test -d .dotest'
+test_expect_success 'check that rebase really failed' 'test -d .git/rebase'
test_expect_success 'resolve, continue the rebase and dcommit' "
echo clobber and I really mean it > file &&
--
1.5.6.2.449.g342381.dirty
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 0:47 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Johannes Schindelin
@ 2008-07-16 0:57 ` Linus Torvalds
2008-07-16 1:10 ` Junio C Hamano
2008-07-16 1:26 ` Theodore Tso
2 siblings, 0 replies; 37+ messages in thread
From: Linus Torvalds @ 2008-07-16 0:57 UTC (permalink / raw)
To: Johannes Schindelin
Cc: René Scharfe, gitster, Stephan Beyer, Joe Fiorini, git,
Jari Aalto
On Wed, 16 Jul 2008, Johannes Schindelin wrote:
>
> 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".
Ack. Please make it so. Even _I_ have now taught myself to do "git am"
instead of using my old "dotest" alias.
Linus
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 0:47 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Johannes Schindelin
2008-07-16 0:57 ` Linus Torvalds
@ 2008-07-16 1:10 ` Junio C Hamano
2008-07-16 1:15 ` Johannes Schindelin
2008-07-16 1:26 ` Theodore Tso
2 siblings, 1 reply; 37+ messages in thread
From: Junio C Hamano @ 2008-07-16 1:10 UTC (permalink / raw)
To: Johannes Schindelin
Cc: René Scharfe, gitster, Stephan Beyer, Joe Fiorini, git,
Jari Aalto
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 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".
I understand moving away from .dotest/ to .git/something, but I do not
follow the logic of making that something to rebase at all. It is a
scratch area for "am" (and applymbox), isn't it?
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:10 ` Junio C Hamano
@ 2008-07-16 1:15 ` Johannes Schindelin
2008-07-16 1:19 ` Junio C Hamano
` (2 more replies)
0 siblings, 3 replies; 37+ messages in thread
From: Johannes Schindelin @ 2008-07-16 1:15 UTC (permalink / raw)
To: Junio C Hamano
Cc: René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Hi,
On Tue, 15 Jul 2008, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > 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".
>
> I understand moving away from .dotest/ to .git/something, but I do not
> follow the logic of making that something to rebase at all. It is a
> scratch area for "am" (and applymbox), isn't it?
Of course, you can name it as you want. But I thought that the name
"rebase" applies as well: the patches are rebased from somewhere else on
top of HEAD :-)
Ciao,
Dscho
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:15 ` Johannes Schindelin
@ 2008-07-16 1:19 ` Junio C Hamano
2008-07-16 1:33 ` [PATCH for master] " Johannes Schindelin
2008-07-16 1:52 ` [PATCH] " Linus Torvalds
2008-07-16 21:27 ` Petr Baudis
2 siblings, 1 reply; 37+ messages in thread
From: Junio C Hamano @ 2008-07-16 1:19 UTC (permalink / raw)
To: Johannes Schindelin
Cc: René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Of course, you can name it as you want. But I thought that the name
> "rebase" applies as well: the patches are rebased from somewhere else...
Somewhere else being my mailbox or gmane newsgroup?
The patch does not apply to my master anyway, sigh...
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 0:47 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Johannes Schindelin
2008-07-16 0:57 ` Linus Torvalds
2008-07-16 1:10 ` Junio C Hamano
@ 2008-07-16 1:26 ` Theodore Tso
2008-07-16 1:47 ` Stephan Beyer
2008-07-16 19:18 ` Junio C Hamano
2 siblings, 2 replies; 37+ messages in thread
From: Theodore Tso @ 2008-07-16 1:26 UTC (permalink / raw)
To: Johannes Schindelin
Cc: René Scharfe, gitster, Stephan Beyer, Joe Fiorini, git,
Jari Aalto
On Wed, Jul 16, 2008 at 02:47:33AM +0200, Johannes Schindelin wrote:
>
> 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.
While you have "git am" open, how about adding an "git am --abort"
which nukes the .dotest aka .git/rebase directory, and resets HEAD
back to the original position?
And another nice shortcut would be "git am --forceapply" which applies
the patch, leaving .rej files for the user to resolve by hand. That
makes it easier for the user to manually run patch while passing a
filename in .dotest aka .git/rebase.
These two additions would make the git-am workflow much smoother.
Regards,
- Ted
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH for master] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:19 ` Junio C Hamano
@ 2008-07-16 1:33 ` Johannes Schindelin
0 siblings, 0 replies; 37+ messages in thread
From: Johannes Schindelin @ 2008-07-16 1:33 UTC (permalink / raw)
To: Junio C Hamano
Cc: René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
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>
---
On Tue, 15 Jul 2008, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Of course, you can name it as you want. But I thought that
> > the name "rebase" applies as well: the patches are rebased from
> > somewhere else...
>
> Somewhere else being my mailbox or gmane newsgroup?
Something like this *-)
> The patch does not apply to my master anyway, sigh...
Here you are.
Documentation/SubmittingPatches | 2 +-
Documentation/git-am.txt | 4 +-
Documentation/git-rebase.txt | 2 +-
Documentation/user-manual.txt | 2 +-
contrib/completion/git-completion.bash | 20 +++++++-------
contrib/emacs/git.el | 8 +++---
git-am.sh | 6 ++--
git-quiltimport.sh | 2 +-
git-rebase--interactive.sh | 2 +-
git-rebase.sh | 44 ++++++++++++++++----------------
t/t3401-rebase-partial.sh | 4 +-
t/t3404-rebase-interactive.sh | 8 +++---
t/t3407-rebase-abort.sh | 4 +-
t/t4150-am.sh | 22 ++++++++--------
t/t9106-git-svn-commit-diff-clobber.sh | 2 +-
15 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b116475..fdfa536 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -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.
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 1395c7d..2d7f162 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -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
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index e30f6a6..51afc87 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -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":
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 92d4007..8761ee7 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -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:
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 03e4e02..29f6cd4 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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"
@@ -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
@@ -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
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 4fa853f..43b059b 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -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
@@ -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))
diff --git a/git-am.sh b/git-am.sh
index 52b5669..cc8787b 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -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=
@@ -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
@@ -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
}
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 7cd8f71..d1efa1d 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -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"
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a35212d..da79a24 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -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
diff --git a/git-rebase.sh b/git-rebase.sh
index 2597d77..5fe06d1 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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
@@ -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=
@@ -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 || {
@@ -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 $?
@@ -201,15 +201,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 -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
@@ -217,7 +217,7 @@ do
then
move_to_original_branch
else
- dotest=.dotest
+ dotest="$GIT_DIR"/rebase
move_to_original_branch
fi
git reset --hard $(cat "$dotest/orig-head")
@@ -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/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/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
@@ -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
diff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh
index 4934a4e..36d9a2a 100755
--- a/t/t3401-rebase-partial.sh
+++ b/t/t3401-rebase-partial.sh
@@ -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
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 092aa26..ffe3dd9 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -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' '
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 1777ffe..12c8804 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -74,7 +74,7 @@ testrebase() {
'
}
-testrebase "" .dotest
-testrebase " --merge" .git/.dotest-merge
+testrebase "" .git/rebase
+testrebase " --merge" .git/rebase-merge
test_done
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index bc98260..5cbd5ef 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -102,7 +102,7 @@ test_expect_success 'am applies patch correctly' '
git checkout first &&
test_tick &&
git am <patch1 &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
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 -d .dotest &&
+ ! test -d .git/rebase &&
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 -d .dotest &&
+ ! test -d .git/rebase &&
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 -d .dotest &&
+ ! test -d .git/rebase &&
test -z "$(git diff lorem)"
'
test_expect_success 'am pauses on conflict' '
git checkout lorem2^^ &&
! git am lorem-move.patch &&
- test -d .dotest
+ test -d .git/rebase
'
test_expect_success 'am --skip works' '
git am --skip &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
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^^ &&
! git am lorem-move.patch &&
- test -d .dotest &&
+ test -d .git/rebase &&
echo resolved >>file &&
git add file &&
git am --resolved &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
test goodbye = "$(cat another)"
'
test_expect_success 'am takes patches from a Pine mailbox' '
git checkout first &&
cat pine patch1 | git am &&
- ! test -d .dotest &&
+ ! test -d .git/rebase &&
test -z "$(git diff master^..HEAD)"
'
test_expect_success 'am fails on mail without patch' '
! git am <failmail &&
- rm -r .dotest/
+ rm -r .git/rebase/
'
test_expect_success 'am fails on empty patch' '
echo "---" >>failmail &&
! git am <failmail &&
git am --skip &&
- ! test -d .dotest
+ ! test -d .git/rebase
'
test_expect_success 'am works from stdin in subdirectory' '
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index 58a3a7b..27a65e0 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -87,7 +87,7 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
"
-test_expect_success 'check that rebase really failed' 'test -d .dotest'
+test_expect_success 'check that rebase really failed' 'test -d .git/rebase'
test_expect_success 'resolve, continue the rebase and dcommit' "
echo clobber and I really mean it > file &&
--
1.5.6.2.449.g342381.dirty
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:26 ` Theodore Tso
@ 2008-07-16 1:47 ` Stephan Beyer
2008-07-16 19:18 ` Junio C Hamano
1 sibling, 0 replies; 37+ messages in thread
From: Stephan Beyer @ 2008-07-16 1:47 UTC (permalink / raw)
To: Theodore Tso
Cc: Johannes Schindelin, René Scharfe, gitster, Joe Fiorini, git,
Jari Aalto
Hi,
Theodore Tso wrote:
> While you have "git am" open, how about adding an "git am --abort"
> which nukes the .dotest aka .git/rebase directory, and resets HEAD
> back to the original position?
Perhaps it will not conform you, but my sequencer patchset (coming
tomorrow or the day after, I think), will add --abort as a trivial
patch (running sequencer --abort).
Regards.
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:15 ` Johannes Schindelin
2008-07-16 1:19 ` Junio C Hamano
@ 2008-07-16 1:52 ` Linus Torvalds
2008-07-16 2:30 ` Johannes Schindelin
2008-07-16 21:27 ` Petr Baudis
2 siblings, 1 reply; 37+ messages in thread
From: Linus Torvalds @ 2008-07-16 1:52 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Junio C Hamano, René Scharfe, Stephan Beyer, Joe Fiorini,
git, Jari Aalto
On Wed, 16 Jul 2008, Johannes Schindelin wrote:
>
> Of course, you can name it as you want. But I thought that the name
> "rebase" applies as well: the patches are rebased from somewhere else on
> top of HEAD :-)
Well, the original thing was not rebasing, it was patch application. You
could _perhaps_ call that "rebasing" from another tree, but that's a
stretch.
But I don't really care about the name. _Anything_ is better then
".dotest", after all.
Linus
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:52 ` [PATCH] " Linus Torvalds
@ 2008-07-16 2:30 ` Johannes Schindelin
2008-07-16 3:05 ` Junio C Hamano
0 siblings, 1 reply; 37+ messages in thread
From: Johannes Schindelin @ 2008-07-16 2:30 UTC (permalink / raw)
To: Linus Torvalds
Cc: Junio C Hamano, René Scharfe, Stephan Beyer, Joe Fiorini,
git, Jari Aalto
Hi,
On Tue, 15 Jul 2008, Linus Torvalds wrote:
> On Wed, 16 Jul 2008, Johannes Schindelin wrote:
> >
> > Of course, you can name it as you want. But I thought that the name
> > "rebase" applies as well: the patches are rebased from somewhere else
> > on top of HEAD :-)
>
> Well, the original thing was not rebasing, it was patch application. You
> could _perhaps_ call that "rebasing" from another tree, but that's a
> stretch.
Hey, I do not insist on that name. I just explained why I thought it was
okay even for am. If you know a better name, just tell me, and I'll adapt
the patch in no time (at least as long as I am awake).
Ciao,
Dscho
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 2:30 ` Johannes Schindelin
@ 2008-07-16 3:05 ` Junio C Hamano
0 siblings, 0 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-16 3:05 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Linus Torvalds, René Scharfe, Stephan Beyer, Joe Fiorini,
git, Jari Aalto
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> Well, the original thing was not rebasing, it was patch application. You
>> could _perhaps_ call that "rebasing" from another tree, but that's a
>> stretch.
>
> Hey, I do not insist on that name. I just explained why I thought it was
> okay even for am. If you know a better name, just tell me, and I'll adapt
> the patch in no time (at least as long as I am awake).
I obviously do not care too much about the name, as long as you volunteer
to squelch any newbie questions here and #git "Why is it called rebase
when I asked for am???".
Anyway, it's all in 'master' now, and you will see a huge "What's in" and
much leaner "What's cooking" shortly.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:26 ` Theodore Tso
2008-07-16 1:47 ` Stephan Beyer
@ 2008-07-16 19:18 ` Junio C Hamano
2008-07-19 18:40 ` Olivier Marin
2008-07-19 19:49 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Olivier Marin
1 sibling, 2 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-16 19:18 UTC (permalink / raw)
To: Theodore Tso, Nanako Shiraishi
Cc: Johannes Schindelin, René Scharfe, gitster, Stephan Beyer,
Joe Fiorini, git, Jari Aalto
Theodore Tso <tytso@mit.edu> writes:
> While you have "git am" open, how about adding an "git am --abort"
> which nukes the .dotest aka .git/rebase directory, and resets HEAD
> back to the original position?
This does not seem to have reached the list nor its archives. I cannot
say I have really looked at it deeply but it may be a good starting
point. It needs docs ;-)
-- >8 --
From: Nanako Shiraishi <nanako3@lavabit.com>
Date: Wed, 16 Jul 2008 19:39:10 +0900
Subject: [PATCH] git am --abort
After failing to apply patches in the middle of a series, "git am --abort"
lets you go back to the original commit.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
git-am.sh | 19 +++++++++++++++----
t/t4151-am-abort.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 4 deletions(-)
create mode 100755 t/t4151-am-abort.sh
diff --git a/git-am.sh b/git-am.sh
index cc8787b..a44bd7a 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -22,6 +22,7 @@ p= pass it through git-apply
resolvemsg= override error message when patch failure occurs
r,resolved to be used after a patch failure
skip skip the current patch
+abort abandon patch application and clear .dotest directory
rebasing (internal use for git-rebase)"
. git-sh-setup
@@ -120,7 +121,7 @@ It does not apply to blobs recorded in its index."
prec=4
dotest="$GIT_DIR/rebase"
-sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=
+sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
resolvemsg= resume=
git_apply_opt=
@@ -145,6 +146,8 @@ do
resolved=t ;;
--skip)
skip=t ;;
+ --abort)
+ abort=t ;;
--rebasing)
rebasing=t threeway=t keep=t binary=t ;;
-d|--dotest)
@@ -177,7 +180,7 @@ fi
if test -d "$dotest"
then
- case "$#,$skip$resolved" in
+ case "$#,$skip$resolved$abort" in
0,*t*)
# Explicit resume command and we do not have file, so
# we are happy.
@@ -197,9 +200,17 @@ then
esac ||
die "previous rebase directory $dotest still exists but mbox given."
resume=yes
+
+ case "$abort" in
+ t)
+ rm -fr "$dotest" &&
+ git read-tree -m -u ORIG_HEAD &&
+ git reset ORIG_HEAD && :
+ exit ;;
+ esac
else
- # Make sure we are not given --skip nor --resolved
- test ",$skip,$resolved," = ,,, ||
+ # Make sure we are not given --skip, --resolved, nor --abort
+ test "$skip$resolved$abort" = "" ||
die "Resolve operation not in progress, we are not resuming."
# Start afresh.
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
new file mode 100755
index 0000000..96b2cd5
--- /dev/null
+++ b/t/t4151-am-abort.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+test_description='am --abort'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ for i in a b c d e f g
+ do
+ echo $i
+ done >file-1 &&
+ cp file-1 file-2 &&
+ test_tick &&
+ git add file-1 file-2 &&
+ git commit -m initial &&
+ git tag initial &&
+ for i in 2 3 4 5
+ do
+ echo $i >>file-1 &&
+ test_tick &&
+ git commit -a -m $i || break
+ done &&
+ git format-patch initial &&
+ git checkout -b side initial &&
+ echo local change >file-2 &&
+ cp file-2 file-2-expect
+'
+
+test_expect_success 'am stops at a patch that does not apply' '
+ test_must_fail git am 000[124]-*.patch &&
+ git log --pretty=tformat:%s >actual &&
+ for i in 3 2 initial
+ do
+ echo $i
+ done >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'am --abort goes back' '
+ git am --abort &&
+ git rev-parse HEAD >actual &&
+ git rev-parse initial >expect &&
+ test_cmp expect actual &&
+ test_cmp file-2-expect file-2 &&
+ git diff-index --exit-code --cached HEAD
+'
+
+test_done
--
1.5.6
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 1:15 ` Johannes Schindelin
2008-07-16 1:19 ` Junio C Hamano
2008-07-16 1:52 ` [PATCH] " Linus Torvalds
@ 2008-07-16 21:27 ` Petr Baudis
2008-07-16 21:44 ` Junio C Hamano
2 siblings, 1 reply; 37+ messages in thread
From: Petr Baudis @ 2008-07-16 21:27 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Junio C Hamano, René Scharfe, Stephan Beyer, Joe Fiorini,
git, Jari Aalto
Hi,
On Wed, Jul 16, 2008 at 03:15:42AM +0200, Johannes Schindelin wrote:
> On Tue, 15 Jul 2008, Junio C Hamano wrote:
>
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> > > 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".
> >
> > I understand moving away from .dotest/ to .git/something, but I do not
> > follow the logic of making that something to rebase at all. It is a
> > scratch area for "am" (and applymbox), isn't it?
>
> Of course, you can name it as you want. But I thought that the name
> "rebase" applies as well: the patches are rebased from somewhere else on
> top of HEAD :-)
even not considering the sequencer work, wouldn't "sequence" be a well
descriptive name?
Petr "Pasky" Baudis
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 21:27 ` Petr Baudis
@ 2008-07-16 21:44 ` Junio C Hamano
0 siblings, 0 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-16 21:44 UTC (permalink / raw)
To: Petr Baudis
Cc: Johannes Schindelin, René Scharfe, Stephan Beyer,
Joe Fiorini, git, Jari Aalto
Petr Baudis <pasky@suse.cz> writes:
>> Of course, you can name it as you want. But I thought that the name
>> "rebase" applies as well: the patches are rebased from somewhere else on
>> top of HEAD :-)
>
> even not considering the sequencer work, wouldn't "sequence" be a well
> descriptive name?
Heh, I did not want to become a painter, especially I already have a
rather busy plumber job, but here is my thought process:
* "rebase-merge" is used only by rebase that uses merge as the pick
mechanism;
* when $dotest is used by rebase, it is to implement the "pick" mechanism
based on applying patches. "rebase-apply" is a good parallel to
"rebase-merge" here;
* when $dotest is used by am, it is to hold the patches to be applied.
Calling the directory "rebase-apply" would be easy to understand for
somebody who does _not_ know nor care about such low-level details, too.
It is a temporary holding area that is used by the procedure to rebase a
history and the procedure to apply patches.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 19:18 ` Junio C Hamano
@ 2008-07-19 18:40 ` Olivier Marin
2008-07-19 22:18 ` Junio C Hamano
2008-07-23 0:10 ` [PATCH] am --abort: Add to bash-completion and mention in git-rerere documentation Stephan Beyer
2008-07-19 19:49 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Olivier Marin
1 sibling, 2 replies; 37+ messages in thread
From: Olivier Marin @ 2008-07-19 18:40 UTC (permalink / raw)
To: Junio C Hamano
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Junio C Hamano a écrit :
> Theodore Tso <tytso@mit.edu> writes:
>
>> While you have "git am" open, how about adding an "git am --abort"
>> which nukes the .dotest aka .git/rebase directory, and resets HEAD
>> back to the original position?
>
> This does not seem to have reached the list nor its archives. I cannot
> say I have really looked at it deeply but it may be a good starting
> point. It needs docs ;-)
This can be squashed to Nanako's path: it adds missing docs,
'git rerere clear' and move $dotest deletion at the end in case
'git read-tree' failed (because of a dirty index).
Olivier.
-- >8 --
Subject: [PATCH] git am --abort
To squash.
Signed-off-by: Olivier Marin <dkr@freesurf.fr>
---
Documentation/git-am.txt | 5 ++++-
git-am.sh | 8 +++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 2d7f162..e010a16 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -13,7 +13,7 @@ SYNOPSIS
[--3way] [--interactive] [--binary]
[--whitespace=<option>] [-C<n>] [-p<n>]
[<mbox> | <Maildir>...]
-'git am' (--skip | --resolved)
+'git am' (--skip | --resolved | --abort)
DESCRIPTION
-----------
@@ -99,6 +99,9 @@ default. You could use `--no-utf8` to override this.
or `--skip` to handle the failure. This is solely
for internal use between 'git-rebase' and 'git-am'.
+--abort::
+ Restore the original branch and abort the patching operation.
+
DISCUSSION
----------
diff --git a/git-am.sh b/git-am.sh
index 5e645e4..04b2e96 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -22,7 +22,7 @@ p= pass it through git-apply
resolvemsg= override error message when patch failure occurs
r,resolved to be used after a patch failure
skip skip the current patch
-abort abandon patch application and clear .dotest directory
+abort restore the original branch and abort the patching operation.
rebasing (internal use for git-rebase)"
. git-sh-setup
@@ -55,6 +55,7 @@ stop_here_user_resolve () {
fi
echo "When you have resolved this problem run \"$cmdline --resolved\"."
echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"."
+ echo "To restore the original branch and stop patching run \"$cmdline --abort\"."
stop_here $1
}
@@ -203,9 +204,10 @@ then
case "$abort" in
t)
- rm -fr "$dotest" &&
+ git rerere clear &&
git read-tree -m -u ORIG_HEAD &&
- git reset ORIG_HEAD && :
+ git reset ORIG_HEAD &&
+ rm -fr "$dotest"
exit ;;
esac
else
--
1.5.6.3.441.g3087
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-16 19:18 ` Junio C Hamano
2008-07-19 18:40 ` Olivier Marin
@ 2008-07-19 19:49 ` Olivier Marin
2008-07-19 19:59 ` Stephan Beyer
2008-07-19 21:52 ` Junio C Hamano
1 sibling, 2 replies; 37+ messages in thread
From: Olivier Marin @ 2008-07-19 19:49 UTC (permalink / raw)
To: Junio C Hamano
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Junio C Hamano a écrit :
> Theodore Tso <tytso@mit.edu> writes:
>
>> While you have "git am" open, how about adding an "git am --abort"
>> which nukes the .dotest aka .git/rebase directory, and resets HEAD
>> back to the original position?
>
> This does not seem to have reached the list nor its archives. I cannot
> say I have really looked at it deeply but it may be a good starting
> point. It needs docs ;-)
Thinking about the way "git am" works:
It tries to apply patches even on a dirty tree which makes difficult
to automatically do a "git reset --hard" with --skip or --abort and
forces the user to clean the index by hand if last patch failed with
unmerged files.
So, do some people still use "git am" with a dirty tree or will a
patch that make it work like "git rebase" be accepted?
I think users can use "git stash" and "git stash pop" today. Did I
miss something?
Note: the version that use "git sequencer" seems to work like I want
but I do not know if it is a side effect or not.
Olivier.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 19:49 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Olivier Marin
@ 2008-07-19 19:59 ` Stephan Beyer
2008-07-19 20:25 ` Olivier Marin
2008-07-19 21:52 ` Junio C Hamano
1 sibling, 1 reply; 37+ messages in thread
From: Stephan Beyer @ 2008-07-19 19:59 UTC (permalink / raw)
To: Olivier Marin
Cc: Junio C Hamano, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Hi,
Olivier Marin wrote:
> Note: the version that use "git sequencer" seems to work like I want
> but I do not know if it is a side effect or not.
If you mean with "work like I want" that it complains about an unclean
work tree: the check is explicitly done by git-sequencer.
I guess there are situations where you want to apply a patch on a dirty
work tree, e.g. if you fixed some tiny issues so that patches can
apply cleanly.
But I think it does not hurt to commit such tiny changes and perhaps
squash later.
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 19:59 ` Stephan Beyer
@ 2008-07-19 20:25 ` Olivier Marin
0 siblings, 0 replies; 37+ messages in thread
From: Olivier Marin @ 2008-07-19 20:25 UTC (permalink / raw)
To: Stephan Beyer
Cc: Junio C Hamano, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Stephan Beyer a écrit :
>
> If you mean with "work like I want" that it complains about an unclean
> work tree: the check is explicitly done by git-sequencer.
Yes, I mean: refuse to work if the tree is not clean _and_ --skip
and --abort clean the index/tree for me.
With current git version "git am --skip" refuse to continue with a
message: "Dirty index: cannot apply patches (dirty: ...)", if some
files stay unmerged.
As a user I find --skip and --abort useless^Wpainful to use in this
situation.
> I guess there are situations where you want to apply a patch on a dirty
> work tree, e.g. if you fixed some tiny issues so that patches can
> apply cleanly.
Maybe.
Olivier.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 19:49 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Olivier Marin
2008-07-19 19:59 ` Stephan Beyer
@ 2008-07-19 21:52 ` Junio C Hamano
2008-07-19 22:39 ` Jakub Narebski
2008-07-21 13:39 ` Olivier Marin
1 sibling, 2 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-19 21:52 UTC (permalink / raw)
To: Olivier Marin
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Olivier Marin <dkr+ml.git@free.fr> writes:
> It tries to apply patches even on a dirty tree which makes difficult
> to automatically do a "git reset --hard" with --skip or --abort and
> forces the user to clean the index by hand if last patch failed with
> unmerged files.
>
> So, do some people still use "git am" with a dirty tree or will a
> patch that make it work like "git rebase" be accepted?
Anything that changes "am" to require a clean working tree will NEVER be
accepted. I personally rely on the ability for it to run in a dirty tree,
so does Linus.
Side note. Anything that changes "merge" to require a clean
working tree is also unacceptable. Cf.
http://thread.gmane.org/gmane.comp.version-control.git/9073/focus=9089
Linus talks about "patch" in the paragraph second to the last one
in the message; back then he was talking about "git-applymbox" but
the same argument there applies to its newer incarnation "git-am".
Side note #2. It would have been nice if "rebase" were also
written in such a way that it can work in a dirty tree as long as
local changes did not interfere with the operation, but it is a
lot more involved.
When I looked at the "am --abort" patch briefly, I had an impression (by
reading its test case) that it correctly refrained from doing the
destructive "reset --hard".
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 18:40 ` Olivier Marin
@ 2008-07-19 22:18 ` Junio C Hamano
2008-07-19 22:27 ` Junio C Hamano
2008-07-22 23:47 ` Stephan Beyer
2008-07-23 0:10 ` [PATCH] am --abort: Add to bash-completion and mention in git-rerere documentation Stephan Beyer
1 sibling, 2 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-19 22:18 UTC (permalink / raw)
To: Olivier Marin
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Olivier Marin <dkr+ml.git@free.fr> writes:
> Subject: [PATCH] git am --abort
>
> To squash.
>
> Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Thanks.
> @@ -203,9 +204,10 @@ then
>
> case "$abort" in
> t)
> - rm -fr "$dotest" &&
> + git rerere clear &&
> git read-tree -m -u ORIG_HEAD &&
> - git reset ORIG_HEAD && :
> + git reset ORIG_HEAD &&
> + rm -fr "$dotest"
> exit ;;
> esac
> else
Clearing the rerere information needs to be done, but I think we should
drop the last && to make sure we remove "$dotest" and exit with its exit
status.
I'm happy with the documentation and help-text parts of your patch, but
probably this, on top of 1a6f6bb (git am --abort, 2008-07-16), is more
appropriate?
---
git-am.sh | 6 +++---
t/t4151-am-abort.sh | 46 +++++++++++++++++++++++++++-------------------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index a44bd7a..5cbf8f4 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -203,9 +203,9 @@ then
case "$abort" in
t)
- rm -fr "$dotest" &&
- git read-tree -m -u ORIG_HEAD &&
- git reset ORIG_HEAD && :
+ git rerere clear
+ git read-tree --reset -u HEAD ORIG_HEAD
+ rm -fr "$dotest"
exit ;;
esac
else
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index 96b2cd5..dda7e2c 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -22,27 +22,35 @@ test_expect_success setup '
done &&
git format-patch initial &&
git checkout -b side initial &&
- echo local change >file-2 &&
- cp file-2 file-2-expect
+ echo local change >file-2-expect
'
-test_expect_success 'am stops at a patch that does not apply' '
- test_must_fail git am 000[124]-*.patch &&
- git log --pretty=tformat:%s >actual &&
- for i in 3 2 initial
- do
- echo $i
- done >expect &&
- test_cmp expect actual
-'
+for with3 in '' ' -3'
+do
+ test_expect_success "am$with3 stops at a patch that does not apply" '
-test_expect_success 'am --abort goes back' '
- git am --abort &&
- git rev-parse HEAD >actual &&
- git rev-parse initial >expect &&
- test_cmp expect actual &&
- test_cmp file-2-expect file-2 &&
- git diff-index --exit-code --cached HEAD
-'
+ git reset --hard initial &&
+ cp file-2-expect file-2 &&
+
+ test_must_fail git am$with3 000[124]-*.patch &&
+ git log --pretty=tformat:%s >actual &&
+ for i in 3 2 initial
+ do
+ echo $i
+ done >expect &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "am --abort goes back after failed am$with3" '
+ git-am --abort &&
+ git rev-parse HEAD >actual &&
+ git rev-parse initial >expect &&
+ test_cmp expect actual &&
+ test_cmp file-2-expect file-2 &&
+ git diff-index --exit-code --cached HEAD &&
+ test ! -f .git/rr-cache/MERGE_RR
+ '
+
+done
test_done
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 22:18 ` Junio C Hamano
@ 2008-07-19 22:27 ` Junio C Hamano
2008-07-22 23:47 ` Stephan Beyer
1 sibling, 0 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-19 22:27 UTC (permalink / raw)
To: Olivier Marin
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Junio C Hamano <gitster@pobox.com> writes:
> I'm happy with the documentation and help-text parts of your patch, but
> probably this, on top of 1a6f6bb (git am --abort, 2008-07-16), is more
> appropriate?
>
> ---
> git-am.sh | 6 +++---
> t/t4151-am-abort.sh | 46 +++++++++++++++++++++++++++-------------------
> 2 files changed, 30 insertions(+), 22 deletions(-)
>
> diff --git a/git-am.sh b/git-am.sh
> index a44bd7a..5cbf8f4 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -203,9 +203,9 @@ then
>
> case "$abort" in
> t)
> - rm -fr "$dotest" &&
> - git read-tree -m -u ORIG_HEAD &&
> - git reset ORIG_HEAD && :
> + git rerere clear
> + git read-tree --reset -u HEAD ORIG_HEAD
> + rm -fr "$dotest"
We still need "git reset ORIG_HEAD" after the read-tree. Sorry about the
noise.
> exit ;;
> esac
> else
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 21:52 ` Junio C Hamano
@ 2008-07-19 22:39 ` Jakub Narebski
2008-07-21 13:39 ` Olivier Marin
1 sibling, 0 replies; 37+ messages in thread
From: Jakub Narebski @ 2008-07-19 22:39 UTC (permalink / raw)
To: git
[This is git@vger.kernel.org only copy]
Junio C Hamano wrote:
> Olivier Marin <dkr+ml.git@free.fr> writes:
>
>> It tries to apply patches even on a dirty tree which makes difficult
>> to automatically do a "git reset --hard" with --skip or --abort and
>> forces the user to clean the index by hand if last patch failed with
>> unmerged files.
>>
>> So, do some people still use "git am" with a dirty tree or will a
>> patch that make it work like "git rebase" be accepted?
>
> Anything that changes "am" to require a clean working tree will NEVER be
> accepted. I personally rely on the ability for it to run in a dirty tree,
> so does Linus.
>
> Side note. Anything that changes "merge" to require a clean
> working tree is also unacceptable. Cf.
>
> http://thread.gmane.org/gmane.comp.version-control.git/9073/focus=9089
>
> Linus talks about "patch" in the paragraph second to the last one
> in the message; back then he was talking about "git-applymbox" but
> the same argument there applies to its newer incarnation "git-am".
>
> Side note #2. It would have been nice if "rebase" were also
> written in such a way that it can work in a dirty tree as long as
> local changes did not interfere with the operation, but it is a
> lot more involved.
>
> When I looked at the "am --abort" patch briefly, I had an impression (by
> reading its test case) that it correctly refrained from doing the
> destructive "reset --hard".
I guess instead of "git reset --hard" we can use here "git stash save
&& git stash apply --index" to save state (perhaps as "git stash save
--no-reset"), and either "git stash drop" at the the end, or
"git reset --hard && git stash pop --index" at '--abort'.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 21:52 ` Junio C Hamano
2008-07-19 22:39 ` Jakub Narebski
@ 2008-07-21 13:39 ` Olivier Marin
2008-07-23 0:16 ` Junio C Hamano
1 sibling, 1 reply; 37+ messages in thread
From: Olivier Marin @ 2008-07-21 13:39 UTC (permalink / raw)
To: Junio C Hamano
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Junio C Hamano a écrit :
>
> Anything that changes "am" to require a clean working tree will NEVER be
> accepted. I personally rely on the ability for it to run in a dirty tree,
> so does Linus.
>
> Side note. Anything that changes "merge" to require a clean
> working tree is also unacceptable. Cf.
>
> http://thread.gmane.org/gmane.comp.version-control.git/9073/focus=9089
>
> Linus talks about "patch" in the paragraph second to the last one
> in the message; back then he was talking about "git-applymbox" but
> the same argument there applies to its newer incarnation "git-am".
>
> Side note #2. It would have been nice if "rebase" were also
> written in such a way that it can work in a dirty tree as long as
> local changes did not interfere with the operation, but it is a
> lot more involved.
Thanks for the explanation and the really interesting pointer.
The last thing that still annoy me is the --skip that refuse to skip in 3-way
merge. Perhaps we can use the "git read-tree --reset -u" thing for skip too.
So, what about the following patch?
-- >8 --
From: Olivier Marin <dkr@freesurf.fr>
git am --skip: clean the index while preserving local changes
In 3-way merge, "am" will let the index with unmerged path waiting
for us to resolve conflicts and continue. But if we want to --skip
instead, "am" refuses to continue because of the dirty index.
With this patch, "am" will clean the index without touching files
locally modified, before continue.
Signed-off-by: Olivier Marin <dkr@freesurf.fr>
---
git-am.sh | 12 +++++++++---
t/t4151-am-abort.sh | 11 +++++++++--
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 60aaa4a..864c77e 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -202,8 +202,15 @@ then
die "previous rebase directory $dotest still exists but mbox given."
resume=yes
- case "$abort" in
- t)
+ case "$skip,$abort" in
+ t,)
+ git rerere clear
+ git read-tree --reset -u HEAD HEAD
+ orig_head=$(cat "$GIT_DIR/ORIG_HEAD")
+ git reset HEAD
+ git update-ref ORIG_HEAD $orig_head
+ ;;
+ ,t)
git rerere clear
git read-tree --reset -u HEAD ORIG_HEAD
git reset ORIG_HEAD
@@ -297,7 +304,6 @@ last=`cat "$dotest/last"`
this=`cat "$dotest/next"`
if test "$skip" = t
then
- git rerere clear
this=`expr "$this" + 1`
resume=
fi
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index dda7e2c..249093b 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -14,7 +14,7 @@ test_expect_success setup '
git add file-1 file-2 &&
git commit -m initial &&
git tag initial &&
- for i in 2 3 4 5
+ for i in 2 3 4 5 6
do
echo $i >>file-1 &&
test_tick &&
@@ -32,7 +32,7 @@ do
git reset --hard initial &&
cp file-2-expect file-2 &&
- test_must_fail git am$with3 000[124]-*.patch &&
+ test_must_fail git am$with3 000[1245]-*.patch &&
git log --pretty=tformat:%s >actual &&
for i in 3 2 initial
do
@@ -41,6 +41,13 @@ do
test_cmp expect actual
'
+ test_expect_success "am$with3 --skip continue after failed am$with3" '
+ test_must_fail git-am$with3 --skip >output &&
+ test "$(grep "^Applying" output)" = "Applying 6" &&
+ test_cmp file-2-expect file-2 &&
+ test ! -f .git/rr-cache/MERGE_RR
+ '
+
test_expect_success "am --abort goes back after failed am$with3" '
git-am --abort &&
git rev-parse HEAD >actual &&
--
1.5.6.4.570.g052e.dirty
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-19 22:18 ` Junio C Hamano
2008-07-19 22:27 ` Junio C Hamano
@ 2008-07-22 23:47 ` Stephan Beyer
2008-07-23 0:48 ` Junio C Hamano
1 sibling, 1 reply; 37+ messages in thread
From: Stephan Beyer @ 2008-07-22 23:47 UTC (permalink / raw)
To: Junio C Hamano
Cc: Olivier Marin, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Hi,
Junio C Hamano wrote:
> Olivier Marin <dkr+ml.git@free.fr> writes:
> > @@ -203,9 +204,10 @@ then
> >
> > case "$abort" in
> > t)
> > - rm -fr "$dotest" &&
> > + git rerere clear &&
> > git read-tree -m -u ORIG_HEAD &&
[...]
> diff --git a/git-am.sh b/git-am.sh
> index a44bd7a..5cbf8f4 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -203,9 +203,9 @@ then
>
> case "$abort" in
> t)
> - rm -fr "$dotest" &&
> - git read-tree -m -u ORIG_HEAD &&
> - git reset ORIG_HEAD && :
> + git rerere clear
> + git read-tree --reset -u HEAD ORIG_HEAD
Perhaps I am confused, but ...
Why is there "HEAD" and "ORIG_HEAD" and not only "ORIG_HEAD"?
Regards.
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH] am --abort: Add to bash-completion and mention in git-rerere documentation
2008-07-19 18:40 ` Olivier Marin
2008-07-19 22:18 ` Junio C Hamano
@ 2008-07-23 0:10 ` Stephan Beyer
1 sibling, 0 replies; 37+ messages in thread
From: Stephan Beyer @ 2008-07-23 0:10 UTC (permalink / raw)
To: Olivier Marin
Cc: Junio C Hamano, Theodore Tso, Nanako Shiraishi, git,
Stephan Beyer
The git-rerere documentation talks about commands that invoke
"git rerere clear" automatically. git am --abort is added and
a typo is fixed additionally.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
Documentation/git-rerere.txt | 2 +-
contrib/completion/git-completion.bash | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt
index beebd53..89f321b 100644
--- a/Documentation/git-rerere.txt
+++ b/Documentation/git-rerere.txt
@@ -37,7 +37,7 @@ its working state.
'clear'::
This resets the metadata used by rerere if a merge resolution is to be
-is aborted. Calling 'git-am --skip' or 'git-rebase [--skip|--abort]'
+aborted. Calling 'git-am [--skip|--abort]' or 'git-rebase [--skip|--abort]'
will automatically invoke this command.
'diff'::
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 2edb341..8fc9145 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -489,7 +489,7 @@ _git_am ()
{
local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
if [ -d "$dir"/rebase-apply ]; then
- __gitcomp "--skip --resolved"
+ __gitcomp "--skip --resolved --abort"
return
fi
case "$cur" in
--
1.5.6.4.459.gfa44d
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-21 13:39 ` Olivier Marin
@ 2008-07-23 0:16 ` Junio C Hamano
2008-07-23 12:24 ` Olivier Marin
0 siblings, 1 reply; 37+ messages in thread
From: Junio C Hamano @ 2008-07-23 0:16 UTC (permalink / raw)
To: Olivier Marin
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Olivier Marin <dkr+ml.git@free.fr> writes:
> The last thing that still annoy me is the --skip that refuse to skip in 3-way
> merge. Perhaps we can use the "git read-tree --reset -u" thing for skip too.
Hmm...
We traditionally left that as something the user deliberately should do to
signal --skip that the user knows he is dropping that change (by the way,
so did "git-rebase"). But with fb6e4e1 (Do git reset --hard HEAD when
using git rebase --skip, 2007-11-08), we run the reset upon rebase --skip,
so it probably is a good idea to match it here as well.
> diff --git a/git-am.sh b/git-am.sh
> index 60aaa4a..864c77e 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -202,8 +202,15 @@ then
> die "previous rebase directory $dotest still exists but mbox given."
> resume=yes
>
> - case "$abort" in
> - t)
> + case "$skip,$abort" in
> + t,)
> + git rerere clear
> + git read-tree --reset -u HEAD HEAD
> + orig_head=$(cat "$GIT_DIR/ORIG_HEAD")
> + git reset HEAD
> + git update-ref ORIG_HEAD $orig_head
> + ;;
Sorry, I do not quite understand what this reset after the read-tree dance
is trying to do; you have already reset the index to the tree in HEAD when
you cleared the change involved in the patch application with that
two-tree form of read-tree.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-22 23:47 ` Stephan Beyer
@ 2008-07-23 0:48 ` Junio C Hamano
2008-07-23 1:13 ` Stephan Beyer
0 siblings, 1 reply; 37+ messages in thread
From: Junio C Hamano @ 2008-07-23 0:48 UTC (permalink / raw)
To: Stephan Beyer
Cc: Olivier Marin, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Stephan Beyer <s-beyer@gmx.net> writes:
> Hi,
>
> Junio C Hamano wrote:
>> Olivier Marin <dkr+ml.git@free.fr> writes:
>> > @@ -203,9 +204,10 @@ then
>> >
>> > case "$abort" in
>> > t)
>> > - rm -fr "$dotest" &&
>> > + git rerere clear &&
>> > git read-tree -m -u ORIG_HEAD &&
> [...]
>> diff --git a/git-am.sh b/git-am.sh
>> index a44bd7a..5cbf8f4 100755
>> --- a/git-am.sh
>> +++ b/git-am.sh
>> @@ -203,9 +203,9 @@ then
>>
>> case "$abort" in
>> t)
>> - rm -fr "$dotest" &&
>> - git read-tree -m -u ORIG_HEAD &&
>> - git reset ORIG_HEAD && :
>> + git rerere clear
>> + git read-tree --reset -u HEAD ORIG_HEAD
>
> Perhaps I am confused, but ...
> Why is there "HEAD" and "ORIG_HEAD" and not only "ORIG_HEAD"?
Just being a bit defensive -- in this case I think it might be Ok to say
"read-tree --reset -u ORIG_HEAD", but I haven't checked in a conflicted
case.
If some path was added between ORIG_HEAD (that is where we started from)
and HEAD (that is where we are and we decide we do not want it), and that
path is conflicted in the index, a single tree form "read-tree --reset -u
HEAD" would leave it behind in the working tree, wouldn't it?
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 0:48 ` Junio C Hamano
@ 2008-07-23 1:13 ` Stephan Beyer
2008-07-23 14:54 ` Olivier Marin
2008-07-23 20:40 ` Junio C Hamano
0 siblings, 2 replies; 37+ messages in thread
From: Stephan Beyer @ 2008-07-23 1:13 UTC (permalink / raw)
To: Junio C Hamano
Cc: Olivier Marin, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Hi,
Junio C Hamano wrote:
> Stephan Beyer <s-beyer@gmx.net> writes:
> > Junio C Hamano wrote:
> >> Olivier Marin <dkr+ml.git@free.fr> writes:
> >> > @@ -203,9 +204,10 @@ then
> >> >
> >> > case "$abort" in
> >> > t)
> >> > - rm -fr "$dotest" &&
> >> > + git rerere clear &&
> >> > git read-tree -m -u ORIG_HEAD &&
> > [...]
> >> diff --git a/git-am.sh b/git-am.sh
> >> index a44bd7a..5cbf8f4 100755
> >> --- a/git-am.sh
> >> +++ b/git-am.sh
> >> @@ -203,9 +203,9 @@ then
> >>
> >> case "$abort" in
> >> t)
> >> - rm -fr "$dotest" &&
> >> - git read-tree -m -u ORIG_HEAD &&
> >> - git reset ORIG_HEAD && :
> >> + git rerere clear
> >> + git read-tree --reset -u HEAD ORIG_HEAD
> >
> > Perhaps I am confused, but ...
> > Why is there "HEAD" and "ORIG_HEAD" and not only "ORIG_HEAD"?
>
> Just being a bit defensive -- in this case I think it might be Ok to say
> "read-tree --reset -u ORIG_HEAD", but I haven't checked in a conflicted
> case.
Well, the test suite fails:
* FAIL 4: am --abort goes back after failed am
git-am --abort &&
git rev-parse HEAD >actual &&
git rev-parse initial >expect &&
test_cmp expect actual &&
here> test_cmp file-2-expect file-2 &&
... git diff-index --exit-code --cached HEAD &&
test ! -f .git/rr-cache/MERGE_RR
* FAIL 7: am --abort goes back after failed am -3
git-am --abort &&
git rev-parse HEAD >actual &&
git rev-parse initial >expect &&
test_cmp expect actual &&
and here> test_cmp file-2-expect file-2 &&
git diff-index --exit-code --cached HEAD &&
test ! -f .git/rr-cache/MERGE_RR
So no reason to be defensive ;)
> If some path was added between ORIG_HEAD (that is where we started from)
> and HEAD (that is where we are and we decide we do not want it), and that
> path is conflicted in the index, a single tree form "read-tree --reset -u
> HEAD" would leave it behind in the working tree, wouldn't it?
Seems so.
The reason of my question was that I *blindly* incorporated the change into
sequencer to make it able to work on a dirty working tree and thus to be
able to migrate am onto it without losing the ability to apply patches
on a dirty working tree....
All am tests applied afterwards, but the sequencer and the rebase-i
test suite failed in a place where I didn't expect it. I *then* had
a deeper look at the read-tree line and I was wondering what the "HEAD"
should achieve.
I removed it and all tests passed. (I didn't have t4151 in my branch
at that point.)
Now, because t4151 does not pass, I am wondering what's the best thing
I could do...
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 0:16 ` Junio C Hamano
@ 2008-07-23 12:24 ` Olivier Marin
2008-07-23 18:31 ` Junio C Hamano
0 siblings, 1 reply; 37+ messages in thread
From: Olivier Marin @ 2008-07-23 12:24 UTC (permalink / raw)
To: Junio C Hamano
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Junio C Hamano a écrit :
>
>> diff --git a/git-am.sh b/git-am.sh
>> index 60aaa4a..864c77e 100755
>> --- a/git-am.sh
>> +++ b/git-am.sh
>> @@ -202,8 +202,15 @@ then
>> die "previous rebase directory $dotest still exists but mbox given."
>> resume=yes
>>
>> - case "$abort" in
>> - t)
>> + case "$skip,$abort" in
>> + t,)
>> + git rerere clear
>> + git read-tree --reset -u HEAD HEAD
>> + orig_head=$(cat "$GIT_DIR/ORIG_HEAD")
>> + git reset HEAD
>> + git update-ref ORIG_HEAD $orig_head
>> + ;;
>
> Sorry, I do not quite understand what this reset after the read-tree dance
> is trying to do; you have already reset the index to the tree in HEAD when
> you cleared the change involved in the patch application with that
> two-tree form of read-tree.
I add reset to unstage paths with no conflict that are left behind. Perhaps
read-tree can clear those paths as well but I do not know how, the man page
is hard to follow.
--
Olivier.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 1:13 ` Stephan Beyer
@ 2008-07-23 14:54 ` Olivier Marin
2008-07-23 16:47 ` Stephan Beyer
2008-07-23 20:40 ` Junio C Hamano
1 sibling, 1 reply; 37+ messages in thread
From: Olivier Marin @ 2008-07-23 14:54 UTC (permalink / raw)
To: Stephan Beyer
Cc: Junio C Hamano, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Stephan Beyer a écrit :
>
>>> Perhaps I am confused, but ...
I can understand. ;-)
>>> Why is there "HEAD" and "ORIG_HEAD" and not only "ORIG_HEAD"?
>> Just being a bit defensive -- in this case I think it might be Ok to say
>> "read-tree --reset -u ORIG_HEAD", but I haven't checked in a conflicted
>> case.
git read-tree --reset -u ORIG_HEAD clears local changes which is not good.
> Well, the test suite fails:
> * FAIL 4: am --abort goes back after failed am
>
> git-am --abort &&
> git rev-parse HEAD >actual &&
> git rev-parse initial >expect &&
> test_cmp expect actual &&
> here> test_cmp file-2-expect file-2 &&
Local changes have been lost.
> The reason of my question was that I *blindly* incorporated the change into
> sequencer to make it able to work on a dirty working tree and thus to be
> able to migrate am onto it without losing the ability to apply patches
> on a dirty working tree....
Are you talking about your seq-proto-dev3 branch?
> All am tests applied afterwards, but the sequencer and the rebase-i
> test suite failed in a place where I didn't expect it. I *then* had
> a deeper look at the read-tree line and I was wondering what the "HEAD"
> should achieve.
> I removed it and all tests passed. (I didn't have t4151 in my branch
> at that point.)
>
> Now, because t4151 does not pass, I am wondering what's the best thing
> I could do...
I looked at your code. You use reset_almost_hard() instead of "reset --hard",
it's fine but you does not update require_clean_work_tree() to be less
restrictive and let the sequencer work with local modifications. Those two
lines must be removed, I think:
git update-index --ignore-submodules --refresh &&
git diff-files --quiet --ignore-submodules &&
Try that with the original read-tree line and t4151 should pass.
Ah, you should change "Applying 6" with "Applying \"6\"" in t4151-am-abort.sh
too.
Olivier.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 14:54 ` Olivier Marin
@ 2008-07-23 16:47 ` Stephan Beyer
0 siblings, 0 replies; 37+ messages in thread
From: Stephan Beyer @ 2008-07-23 16:47 UTC (permalink / raw)
To: Olivier Marin
Cc: Junio C Hamano, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Hi,
Olivier Marin wrote:
> > The reason of my question was that I *blindly* incorporated the change into
> > sequencer to make it able to work on a dirty working tree and thus to be
> > able to migrate am onto it without losing the ability to apply patches
> > on a dirty working tree....
>
> Are you talking about your seq-proto-dev3 branch?
Right, and your suggested changes are right, too, and I've incorporated
them yesterday (with an --allow-dirty option) but I hadn't commited them...
(Hence, not pushed.)
> > Now, because t4151 does not pass, I am wondering what's the best thing
> > I could do...
Well, that was solved...
The problem was that the additional "HEAD" (that made t4151 work), resulted
in untracked files in some test cases of sequencer and rebase-i. Those made
merges fail, because these merges would overwrite these files. So the
merges failed, and the test cases failed.
I've solved this with the trick that the "HEAD" argument is only added if
--allow-dirty is set (and git-am uses --allow-dirty of course).
This is perhaps not the cleanest way but seemed to be far more better
than forcing overwrites on merges (checkouts, etc.).
> Ah, you should change "Applying 6" with "Applying \"6\"" in t4151-am-abort.sh
> too.
I btw wondered if the quotes are useful in original am.
Well, I've just sent a patch adding a colon (instead of quotes). Let's
see ;)
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 12:24 ` Olivier Marin
@ 2008-07-23 18:31 ` Junio C Hamano
2008-07-24 12:44 ` Olivier Marin
0 siblings, 1 reply; 37+ messages in thread
From: Junio C Hamano @ 2008-07-23 18:31 UTC (permalink / raw)
To: Olivier Marin
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Olivier Marin <dkr+ml.git@free.fr> writes:
> Junio C Hamano a écrit :
>>> diff --git a/git-am.sh b/git-am.sh
>> ...
>>> @@ -202,8 +202,15 @@ then
>> ...
>>> + case "$skip,$abort" in
>>> + t,)
>>> + git rerere clear
>>> + git read-tree --reset -u HEAD HEAD
>>> + orig_head=$(cat "$GIT_DIR/ORIG_HEAD")
>>> + git reset HEAD
>>> + git update-ref ORIG_HEAD $orig_head
>>> + ;;
>> ...
> I add reset to unstage paths with no conflict that are left behind.
Does removing the last three lines (1) change the behaviour? (2) break any test?
If the answers are "Yes and No", we would need a few more tests in the
testsuite.
If the answers are "No and naturally no", then let's remove the last three
lines in the hunk.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 1:13 ` Stephan Beyer
2008-07-23 14:54 ` Olivier Marin
@ 2008-07-23 20:40 ` Junio C Hamano
1 sibling, 0 replies; 37+ messages in thread
From: Junio C Hamano @ 2008-07-23 20:40 UTC (permalink / raw)
To: Stephan Beyer
Cc: Olivier Marin, Theodore Tso, Nanako Shiraishi,
Johannes Schindelin, René Scharfe, Joe Fiorini, git,
Jari Aalto
Stephan Beyer <s-beyer@gmx.net> writes:
>> Just being a bit defensive -- in this case I think it might be Ok to say
>> "read-tree --reset -u ORIG_HEAD", but I haven't checked in a conflicted
>> case.
>
> Well, the test suite fails:
> ...
> So no reason to be defensive ;)
Ok, so it is not just being defensive but actually is necessary.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
2008-07-23 18:31 ` Junio C Hamano
@ 2008-07-24 12:44 ` Olivier Marin
0 siblings, 0 replies; 37+ messages in thread
From: Olivier Marin @ 2008-07-24 12:44 UTC (permalink / raw)
To: Junio C Hamano
Cc: Theodore Tso, Nanako Shiraishi, Johannes Schindelin,
René Scharfe, Stephan Beyer, Joe Fiorini, git, Jari Aalto
Junio C Hamano a écrit :
> Olivier Marin <dkr+ml.git@free.fr> writes:
>
>> Junio C Hamano a écrit :
>>>> diff --git a/git-am.sh b/git-am.sh
>>> ...
>>>> @@ -202,8 +202,15 @@ then
>>> ...
>>>> + case "$skip,$abort" in
>>>> + t,)
>>>> + git rerere clear
>>>> + git read-tree --reset -u HEAD HEAD
>>>> + orig_head=$(cat "$GIT_DIR/ORIG_HEAD")
>>>> + git reset HEAD
>>>> + git update-ref ORIG_HEAD $orig_head
>>>> + ;;
>>> ...
>> I add reset to unstage paths with no conflict that are left behind.
>
> Does removing the last three lines (1) change the behaviour? (2) break any test?
>
> If the answers are "Yes and No", we would need a few more tests in the
> testsuite.
The answers are "Yes and No" and test case update follow.
-- >8 --
From: Olivier Marin <dkr@freesurf.fr>
[PATCH] update test case to protect am --skip behaviour
Signed-off-by: Olivier Marin <dkr@freesurf.fr>
---
t/t4151-am-abort.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index f45ab0a..7d86cdf 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -17,6 +17,8 @@ test_expect_success setup '
for i in 2 3 4 5 6
do
echo $i >>file-1 &&
+ echo $i >otherfile-$i &&
+ git add otherfile-$i &&
test_tick &&
git commit -a -m $i || break
done &&
--
1.6.0.rc0.44.gd618.dirty
^ permalink raw reply related [flat|nested] 37+ messages in thread
end of thread, other threads:[~2008-07-24 12:45 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15 21:08 Git rebase failure: .dotest overwritten Joe Fiorini
2008-07-15 21:22 ` Stephan Beyer
2008-07-15 21:48 ` René Scharfe
2008-07-16 0:47 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Johannes Schindelin
2008-07-16 0:57 ` Linus Torvalds
2008-07-16 1:10 ` Junio C Hamano
2008-07-16 1:15 ` Johannes Schindelin
2008-07-16 1:19 ` Junio C Hamano
2008-07-16 1:33 ` [PATCH for master] " Johannes Schindelin
2008-07-16 1:52 ` [PATCH] " Linus Torvalds
2008-07-16 2:30 ` Johannes Schindelin
2008-07-16 3:05 ` Junio C Hamano
2008-07-16 21:27 ` Petr Baudis
2008-07-16 21:44 ` Junio C Hamano
2008-07-16 1:26 ` Theodore Tso
2008-07-16 1:47 ` Stephan Beyer
2008-07-16 19:18 ` Junio C Hamano
2008-07-19 18:40 ` Olivier Marin
2008-07-19 22:18 ` Junio C Hamano
2008-07-19 22:27 ` Junio C Hamano
2008-07-22 23:47 ` Stephan Beyer
2008-07-23 0:48 ` Junio C Hamano
2008-07-23 1:13 ` Stephan Beyer
2008-07-23 14:54 ` Olivier Marin
2008-07-23 16:47 ` Stephan Beyer
2008-07-23 20:40 ` Junio C Hamano
2008-07-23 0:10 ` [PATCH] am --abort: Add to bash-completion and mention in git-rerere documentation Stephan Beyer
2008-07-19 19:49 ` [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge" Olivier Marin
2008-07-19 19:59 ` Stephan Beyer
2008-07-19 20:25 ` Olivier Marin
2008-07-19 21:52 ` Junio C Hamano
2008-07-19 22:39 ` Jakub Narebski
2008-07-21 13:39 ` Olivier Marin
2008-07-23 0:16 ` Junio C Hamano
2008-07-23 12:24 ` Olivier Marin
2008-07-23 18:31 ` Junio C Hamano
2008-07-24 12:44 ` Olivier Marin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).