Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cherry is built-in, do not ship git-cherry.sh

Noticed by Rene; Makefile now has another maintainer's check
target to catch this kind of mistakes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information...
commit c74390e4a1d78e718de72e5615b7352aeec03979 1 parent 82cc8d8
authored November 05, 2006
5  Makefile
@@ -932,3 +932,8 @@ check-docs::
932 932
 		*) echo "no link: $$v";; \
933 933
 		esac ; \
934 934
 	done | sort
  935
+
  936
+### Make sure built-ins do not have dups and listed in git.c
  937
+#
  938
+check-builtins::
  939
+	./check-builtins.sh
34  check-builtins.sh
... ...
@@ -0,0 +1,34 @@
  1
+#!/bin/sh
  2
+
  3
+{
  4
+	cat <<\EOF
  5
+sayIt:
  6
+	$(foreach b,$(BUILT_INS),echo XXX $b YYY;)
  7
+EOF
  8
+	cat Makefile
  9
+} |
  10
+make -f - sayIt 2>/dev/null |
  11
+sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p' |
  12
+sort |
  13
+{
  14
+    bad=0
  15
+    while read builtin
  16
+    do
  17
+	base=`expr "$builtin" : 'git-\(.*\)'`
  18
+	x=`sed -ne 's/.*{ "'$base'", \(cmd_[^, ]*\).*/'$base'	\1/p' git.c`
  19
+	if test -z "$x"
  20
+	then
  21
+		echo "$base is builtin but not listed in git.c command list"
  22
+		bad=1
  23
+	fi
  24
+	for sfx in sh perl py
  25
+	do
  26
+		if test -f "$builtin.$sfx"
  27
+		then
  28
+			echo "$base is builtin but $builtin.$sfx still exists"
  29
+			bad=1
  30
+		fi
  31
+	done
  32
+    done
  33
+    exit $bad
  34
+}
91  git-cherry.sh
... ...
@@ -1,91 +0,0 @@
1  
-#!/bin/sh
2  
-#
3  
-# Copyright (c) 2005 Junio C Hamano.
4  
-#
5  
-
6  
-USAGE='[-v] <upstream> [<head>] [<limit>]'
7  
-LONG_USAGE='             __*__*__*__*__> <upstream>
8  
-            /
9  
-  fork-point
10  
-            \__+__+__+__+__+__+__+__> <head>
11  
-
12  
-Each commit between the fork-point (or <limit> if given) and <head> is
13  
-examined, and compared against the change each commit between the
14  
-fork-point and <upstream> introduces.  If the change seems to be in
15  
-the upstream, it is shown on the standard output with prefix "-".
16  
-Otherwise it is shown with prefix "+".'
17  
-. git-sh-setup
18  
-
19  
-case "$1" in -v) verbose=t; shift ;; esac 
20  
-
21  
-case "$#,$1" in
22  
-1,*..*)
23  
-    upstream=$(expr "z$1" : 'z\(.*\)\.\.') ours=$(expr "z$1" : '.*\.\.\(.*\)$')
24  
-    set x "$upstream" "$ours"
25  
-    shift ;;
26  
-esac
27  
-
28  
-case "$#" in
29  
-1) upstream=`git-rev-parse --verify "$1"` &&
30  
-   ours=`git-rev-parse --verify HEAD` || exit
31  
-   limit="$upstream"
32  
-   ;;
33  
-2) upstream=`git-rev-parse --verify "$1"` &&
34  
-   ours=`git-rev-parse --verify "$2"` || exit
35  
-   limit="$upstream"
36  
-   ;;
37  
-3) upstream=`git-rev-parse --verify "$1"` &&
38  
-   ours=`git-rev-parse --verify "$2"` &&
39  
-   limit=`git-rev-parse --verify "$3"` || exit
40  
-   ;;
41  
-*) usage ;;
42  
-esac
43  
-
44  
-# Note that these list commits in reverse order;
45  
-# not that the order in inup matters...
46  
-inup=`git-rev-list ^$ours $upstream` &&
47  
-ours=`git-rev-list $ours ^$limit` || exit
48  
-
49  
-tmp=.cherry-tmp$$
50  
-patch=$tmp-patch
51  
-mkdir $patch
52  
-trap "rm -rf $tmp-*" 0 1 2 3 15
53  
-
54  
-for c in $inup
55  
-do
56  
-	git-diff-tree -p $c
57  
-done | git-patch-id |
58  
-while read id name
59  
-do
60  
-	echo $name >>$patch/$id
61  
-done
62  
-
63  
-LF='
64  
-'
65  
-
66  
-O=
67  
-for c in $ours
68  
-do
69  
-	set x `git-diff-tree -p $c | git-patch-id`
70  
-	if test "$2" != ""
71  
-	then
72  
-		if test -f "$patch/$2"
73  
-		then
74  
-			sign=-
75  
-		else
76  
-			sign=+
77  
-		fi
78  
-		case "$verbose" in
79  
-		t)
80  
-			c=$(git-rev-list --pretty=oneline --max-count=1 $c)
81  
-		esac
82  
-		case "$O" in
83  
-		'')	O="$sign $c" ;;
84  
-		*)	O="$sign $c$LF$O" ;;
85  
-		esac
86  
-	fi
87  
-done
88  
-case "$O" in
89  
-'') ;;
90  
-*)  echo "$O" ;;
91  
-esac

0 notes on commit c74390e

Please sign in to comment.
Something went wrong with that request. Please try again.