summaryrefslogtreecommitdiff
path: root/findoldfiles
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-02-17 08:29:40 -0700
committerJonathan Corbet <corbet@lwn.net>2010-02-17 08:29:40 -0700
commit49c689276d750dbc78fe7a5d0ff27e6d2278fcd4 (patch)
treee6d6c292d8578e56e9783afb1b7b077e6ce30540 /findoldfiles
parent2097993e3e247478a03db58ae9de00e8bc1c9e09 (diff)
Add findoldfiles
YA brutal hack; this one crawls the tree and prints out files which have not been touched since the original commit. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'findoldfiles')
-rwxr-xr-xfindoldfiles27
1 files changed, 27 insertions, 0 deletions
diff --git a/findoldfiles b/findoldfiles
new file mode 100755
index 0000000..fdf2ba1
--- /dev/null
+++ b/findoldfiles
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+#
+# Another quick hack of a script to find files unchanged
+# since a given commit.
+#
+import sys, os
+
+OriginalSin = '1da177e4c3f41524e886b7f1b8a0c1fc7321cac2'
+
+def CheckFile(file):
+ git = os.popen('git log --pretty=oneline -1 ' + file, 'r')
+ line = git.readline()
+ if line.startswith(OriginalSin):
+ print file
+ git.close()
+#
+# Here we just plow through all the files.
+#
+if len(sys.argv) != 2:
+ sys.stderr.write('Usage: findoldfiles directory\n')
+ sys.exit(1)
+
+os.chdir(sys.argv[1])
+files = os.popen('/usr/bin/find . -type f', 'r')
+for file in files.readlines():
+ if file.find('.git/') < 0:
+ CheckFile(file[:-1])