git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"

From
OMOlivier Marin <dkr+ml.git@free.fr>
Date
Jul 19, 2008, 18:40 UTC
Message-ID
<4882350B.6020003@free.fr>
In-Reply-To
<7viqv5r637.fsf@gitster.siamese.dyndns.org>
Junio C Hamano a écrit :
Show 9 quoted lines
> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 37 in “Git rebase failure: .dotest overwritten”
  1. Joe FioriniJul 15, 2008
  2. Stephan BeyerJul 15, 2008
  3. René ScharfeJul 15, 2008
  4. Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"Johannes Schindelin, Jul 16, 2008
  5. Linus TorvaldsJul 16, 2008
  6. Junio C HamanoJul 16, 2008
  7. Johannes SchindelinJul 16, 2008
  8. Junio C HamanoJul 16, 2008
  9. Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"Johannes Schindelin, Jul 16, 2008
  10. Linus TorvaldsJul 16, 2008
  11. Johannes SchindelinJul 16, 2008
  12. Junio C HamanoJul 16, 2008
  13. Petr BaudisJul 16, 2008
  14. Junio C HamanoJul 16, 2008
  15. Theodore TsoJul 16, 2008
  16. Stephan BeyerJul 16, 2008
  17. Junio C HamanoJul 16, 2008
  18. Olivier MarinJul 19, 2008
  19. Junio C HamanoJul 19, 2008
  20. Junio C HamanoJul 19, 2008
  21. Stephan BeyerJul 22, 2008
  22. Junio C HamanoJul 23, 2008
  23. Stephan BeyerJul 23, 2008
  24. Olivier MarinJul 23, 2008
  25. Stephan BeyerJul 23, 2008
  26. Junio C HamanoJul 23, 2008
  27. am --abort: Add to bash-completion and mention in git-rerere documentationStephan Beyer, Jul 23, 2008
  28. Olivier MarinJul 19, 2008
  29. Stephan BeyerJul 19, 2008
  30. Olivier MarinJul 19, 2008
  31. Junio C HamanoJul 19, 2008
  32. Jakub NarebskiJul 19, 2008
  33. Olivier MarinJul 21, 2008
  34. Junio C HamanoJul 23, 2008
  35. Olivier MarinJul 23, 2008
  36. Junio C HamanoJul 23, 2008
  37. Olivier MarinJul 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.