Add an introductory comment.
[git-dm.git] / findoldfiles
blob493d5d3e9e592457642cc8bbb27ef347f10f645f
1 #!/usr/bin/python
3 # Another quick hack of a script to find files unchanged
4 # since a given commit.
6 # This code is part of the LWN git data miner.
8 # Copyright 2007-11 Eklektix, Inc.
9 # Copyright 2007-11 Jonathan Corbet <corbet@lwn.net>
11 # This file may be distributed under the terms of the GNU General
12 # Public License, version 2.
14 import sys, os
16 OriginalSin = '1da177e4c3f41524e886b7f1b8a0c1fc7321cac2'
18 def CheckFile(file):
19 git = os.popen('git log --pretty=oneline -1 ' + file, 'r')
20 line = git.readline()
21 if line.startswith(OriginalSin):
22 print file
23 git.close()
25 # Here we just plow through all the files.
27 if len(sys.argv) != 2:
28 sys.stderr.write('Usage: findoldfiles directory\n')
29 sys.exit(1)
31 os.chdir(sys.argv[1])
32 files = os.popen('/usr/bin/find . -type f', 'r')
33 for file in files.readlines():
34 if file.find('.git/') < 0:
35 CheckFile(file[:-1])