rebase -i: ignore patches that are already in the upstream
[gitweb.git] / git-rebase--interactive.sh
index 061cd0a69e22a51a73488b89ffb99a934fd58ce1..d3addd4290cc202b8c5d0e41d4aa7acd4d2ac0a4 100755 (executable)
@@ -463,8 +463,9 @@ do
 #
 EOF
                git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
-                       --abbrev=7 --reverse $UPSTREAM..$HEAD | \
-                       sed "s/^/pick /" >> "$TODO"
+                       --abbrev=7 --reverse --left-right --cherry-pick \
+                       $UPSTREAM...$HEAD | \
+                       sed -n "s/^>/pick /p" >> "$TODO"
 
                test -z "$(grep -ve '^$' -e '^#' < $TODO)" &&
                        die_abort "Nothing to do"