Thread (42 messages) flat view 42 messages, 2 authors, 2016-06-15
STALE3748d

Revision v5 of 2 in this series.

Revisions (2)
  1. v4 [diff vs current]
  2. v5 current

[PATCH v5 29/36] rebase: cherry-pick: automatically commit stage

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:39
Subsystem: the rest · Maintainer: Linus Torvalds

When there's changes in the staging area. Just like the other rebase
modes.

Signed-off-by: Felipe Contreras <redacted>
---
 git-rebase--cherrypick.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh
index be17ec4..241cda7 100644
--- a/git-rebase--cherrypick.sh
+++ b/git-rebase--cherrypick.sh
@@ -8,6 +8,12 @@ export GIT_CHERRY_PICK_HELP
 
 case "$action" in
 continue)
+	# do we have anything to commit?
+	if ! git diff-index --cached --quiet HEAD --
+	then
+		git commit --no-verify -e ||
+			die "Could not commit staged changes."
+	fi
 	git cherry-pick --continue &&
 	move_to_original_branch
 	return
-- 
1.8.3.698.g079b096
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help