git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Martin von Zweigbergk <martinvonz@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH 5/7] rebase -i: return control to the caller, for housekeeping
Date: Tue, 23 Apr 2013 19:32:02 +0530	[thread overview]
Message-ID: <1366725724-1016-6-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1366725724-1016-1-git-send-email-artagnon@gmail.com>

On a successful interactive rebase, git-rebase--interactive.sh
currently cleans up and exits on its own.  Instead of doing these
two things ourselves:

    rm -fr "$dotest"
    git gc --auto

let us return control to the caller (git-rebase.sh), to do the
needful.  The advantage of doing this is that the caller can implement
a generic cleanup routine (and possibly other things) independent of
specific rebases.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 git-rebase--interactive.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index cc3a9a7..9514e31 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -597,7 +597,7 @@ do_next () {
 		fi
 		;;
 	esac
-	test -s "$todo" && return
+	test -s "$todo" && return 1
 
 	comment_for_reflog finish &&
 	newhead=$(git rev-parse HEAD) &&
@@ -623,17 +623,15 @@ do_next () {
 		"$GIT_DIR"/hooks/post-rewrite rebase < "$rewritten_list"
 		true # we don't care if this hook failed
 	fi &&
-	rm -rf "$state_dir" &&
-	git gc --auto &&
 	warn "Successfully rebased and updated $head_name."
 
-	exit
+	return 0
 }
 
 do_rest () {
 	while :
 	do
-		do_next
+		do_next && break
 	done
 }
 
@@ -799,12 +797,12 @@ first and then run 'git rebase --continue' again."
 	record_in_rewritten "$(cat "$state_dir"/stopped-sha)"
 
 	require_clean_work_tree "rebase"
-	do_rest
+	do_rest && return 0
 	;;
 skip)
 	git rerere clear
 
-	do_rest
+	do_rest && return 0
 	;;
 edit-todo)
 	git stripspace --strip-comments <"$todo" >"$todo".new
-- 
1.8.2.1.578.ga933817

  parent reply	other threads:[~2013-04-23 14:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 14:01 [PATCH 0/7] Introduce rebase.autostash Ramkumar Ramachandra
2013-04-23 14:01 ` [PATCH 1/7] am: suppress error output from a conditional Ramkumar Ramachandra
2013-04-23 14:38   ` Martin von Zweigbergk
2013-04-23 16:29     ` Junio C Hamano
2013-04-23 16:31     ` Ramkumar Ramachandra
2013-04-23 17:29       ` Junio C Hamano
2013-04-23 17:31         ` Ramkumar Ramachandra
2013-04-23 14:01 ` [PATCH 2/7] rebase -i: don't error out if $state_dir already exists Ramkumar Ramachandra
2013-04-23 14:45   ` Martin von Zweigbergk
2013-04-23 16:35   ` Junio C Hamano
2013-04-23 16:38     ` Ramkumar Ramachandra
2013-04-23 14:02 ` [PATCH 3/7] am: tighten a conditional that checks for $dotest Ramkumar Ramachandra
2013-04-23 16:45   ` Junio C Hamano
2013-04-23 14:02 ` [PATCH 4/7] am: don't do housekeeping when rebasing Ramkumar Ramachandra
2013-04-23 16:51   ` Junio C Hamano
2013-04-23 14:02 ` Ramkumar Ramachandra [this message]
2013-04-23 16:51   ` [PATCH 5/7] rebase -i: return control to the caller, for housekeeping Martin von Zweigbergk
2013-04-25 14:30     ` Ramkumar Ramachandra
2013-04-23 16:57   ` Junio C Hamano
2013-04-23 14:02 ` [PATCH 6/7] sh-setup: introduce require_clean_work_tree --quiet Ramkumar Ramachandra
2013-04-23 17:00   ` Junio C Hamano
2013-04-23 14:02 ` [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash Ramkumar Ramachandra
2013-04-23 17:07   ` Junio C Hamano
2013-04-23 17:34     ` Junio C Hamano
2013-04-23 17:37       ` Ramkumar Ramachandra
2013-04-23 22:45   ` Phil Hord
2013-04-24  8:27     ` Ramkumar Ramachandra
2013-04-24 17:52     ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366725724-1016-6-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=martinvonz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).