[RFC/PATCH] dontdiff: generate from gitignore

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Randy Dunlap
Date: Friday, September 12, 2008 - 10:18 am

From: Randy Dunlap <randy.dunlap@oracle.com>

Generate the "dontdiff" file from the .gitignore files.
Save it in scripts/dontdiff.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Makefile           |   10 +++++++++-
 scripts/.gitignore |    1 +
 scripts/mkdontdiff |   23 +++++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)

--- linux-2.6.27-rc6-git2.orig/Makefile
+++ linux-2.6.27-rc6-git2/Makefile
@@ -398,7 +398,7 @@ endif
 no-dot-config-targets := clean mrproper distclean \
 			 cscope TAGS tags help %docs check% \
 			 include/linux/version.h headers_% \
-			 kernelrelease kernelversion
+			 kernelrelease kernelversion dontdiff
 
 config-targets := 0
 mixed-targets  := 0
@@ -1251,6 +1251,7 @@ help:
 	@echo  '  dir/            - Build all files in dir and below'
 	@echo  '  dir/file.[ois]  - Build specified target only'
 	@echo  '  dir/file.ko     - Build module including final link'
+	@echo  '  dontdiff        - Create a "dontdiff" file'
 	@echo  '  prepare         - Set up for building external modules'
 	@echo  '  tags/TAGS	  - Generate tags file for editors'
 	@echo  '  cscope	  - Generate cscope index'
@@ -1519,6 +1520,13 @@ endef
 tags: FORCE
 	$(call cmd,tags)
 
+quiet_cmd_dontdiff = MAKE    dontdiff
+      cmd_dontdiff = $(shell $(CONFIG_SHELL) \
+	                  $(srctree)/scripts/mkdontdiff $(srctree))
+
+dontdiff: FORCE
+	$(call cmd,dontdiff)
+
 
 # Scripts to check various things for consistency
 # ---------------------------------------------------------------------------
--- /dev/null
+++ linux-2.6.27-rc6-git2/scripts/mkdontdiff
@@ -0,0 +1,23 @@
+#! /bin/sh
+set -f
+
+TMPFILE=`mktemp ./.tmpdd.XXXXXX`
+srctree=$1
+DDFILE=$srctree/scripts/dontdiff
+
+find . -name .gitignore | xargs cat | grep -v '^[#!]' | grep -v '^[:space:]*$' | sort | uniq > $TMPFILE
+
+rm -f $DDFILE
+touch $DDFILE
+
+while read PATTERN ; do
+	if echo "$PATTERN" | grep -q '/' ; then
+		filename=`basename $PATTERN`
+	else
+		filename="$PATTERN"
+	fi
+
+	echo $filename >> $DDFILE
+done < $TMPFILE
+
+rm $TMPFILE
--- linux-2.6.27-rc6-git2.orig/scripts/.gitignore
+++ linux-2.6.27-rc6-git2/scripts/.gitignore
@@ -2,6 +2,7 @@
 # Generated files
 #
 conmakehash
+dontdiff
 kallsyms
 pnmtologo
 bin2c

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[path] don't diff generated firmware files, Arjan van de Ven, (Mon Sep 1, 3:09 pm)
Re: [path] don't diff generated firmware files, Alexey Dobriyan, (Mon Sep 1, 4:14 pm)
Re: [path] don't diff generated firmware files, Randy Dunlap, (Fri Sep 12, 10:17 am)
[PATCH] dontdiff: more updates to be closer to gitignore, Randy Dunlap, (Fri Sep 12, 10:17 am)
[RFC/PATCH] dontdiff: generate from gitignore, Randy Dunlap, (Fri Sep 12, 10:18 am)
Re: [RFC/PATCH] dontdiff: generate from gitignore, Linus Torvalds, (Fri Sep 12, 10:36 am)
Re: [RFC/PATCH] dontdiff: generate from gitignore, Randy Dunlap, (Fri Sep 12, 10:41 am)
Re: [RFC/PATCH] dontdiff: generate from gitignore, Kai Henningsen, (Fri Sep 12, 1:32 pm)