git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixes git-cherry algorithmic flaws
@ 2006-08-07 10:30 Ilpo Järvinen
  2006-09-24  0:00 ` Petr Baudis
  0 siblings, 1 reply; 7+ messages in thread
From: Ilpo Järvinen @ 2006-08-07 10:30 UTC (permalink / raw)
  To: git; +Cc: junkio

Old algorithm:
        - printed IDs of identical patches with minus (-) sign; they
	  should not be printed at all
        - did not print anything from the changes in the upstream

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 git-cherry.sh |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/git-cherry.sh b/git-cherry.sh
index f0e8831..fdf3de7 100755
--- a/git-cherry.sh
+++ b/git-cherry.sh
@@ -74,7 +74,8 @@ do
 	then
 		if test -f "$patch/$2"
 		then
-			sign=-
+			rm -rf "$patch/$2"
+			continue
 		else
 			sign=+
 		fi
@@ -88,6 +89,29 @@ do
 		esac
 	fi
 done
+
+for c in $inup
+do
+	set x `git-diff-tree -p $c | git-patch-id`
+	if test "$2" != ""
+	then
+		if test -f "$patch/$2"
+		then
+			sign=-
+		else
+			continue
+		fi
+		case "$verbose" in
+		t)
+			c=$(git-rev-list --pretty=oneline --max-count=1 $c)
+		esac
+		case "$O" in
+		'')	O="$sign $c" ;;
+		*)	O="$sign $c$LF$O" ;;
+		esac
+	fi
+done
+
 case "$O" in
 '') ;;
 *)  echo "$O" ;;
-- 
1.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-09-24 19:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07 10:30 [PATCH] Fixes git-cherry algorithmic flaws Ilpo Järvinen
2006-09-24  0:00 ` Petr Baudis
2006-09-24  1:49   ` Junio C Hamano
2006-09-24 11:17     ` Petr Baudis
2006-09-24 17:47       ` Junio C Hamano
2006-09-24 18:43         ` Ilpo Järvinen
2006-09-24 19:25           ` Jakub Narebski

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).