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

[PATCH] Fixes git-cherry algorithmic flaws

From
IJIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Date
Aug 7, 2006, 10:30 UTC
Message-ID
<Pine.LNX.4.58.0608071328200.22971@kivilampi-30.cs.helsinki.fi>
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
Next: Petr Baudis
Message 1 of 7 in “Fixes git-cherry algorithmic flaws”
  1. Fixes git-cherry algorithmic flawsIlpo Järvinen, Aug 7, 2006
  2. Petr BaudisSep 24, 2006
  3. Junio C HamanoSep 24, 2006
  4. Petr BaudisSep 24, 2006
  5. Junio C HamanoSep 24, 2006
  6. Ilpo JärvinenSep 24, 2006
  7. Jakub NarebskiSep 24, 2006

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.