diff options
-rwxr-xr-x | git-deps | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -17,7 +17,7 @@ def abort(msg, exitcode=1): print >>sys.stderr, msg sys.exit(exitcode) -class DependencyListener: +class DependencyListener(object): """Class for listening to result events generated by DependencyDetector. Add an instance of this class to a DependencyDetector instance via DependencyDetector.add_listener(). @@ -54,12 +54,9 @@ class CLIDependencyListener(DependencyListener): dependent_sha = dependent.hex for dependency_sha in dependencies: - if self.options.log: - print() - if self.options.recurse: if self.options.log: - print("\n%s depends on:" % dependent_sha) + print("%s depends on:" % dependent_sha) else: print("%s %s" % (dependent_sha, dependency_sha)) else: @@ -67,7 +64,8 @@ class CLIDependencyListener(DependencyListener): print(dependency_sha) if self.options.log: - subprocess.call([ 'git', 'log', "%s^!" % dependency_sha ]) + cmd = [ 'git', '--no-pager', '-c', 'color.ui=always', 'log', '-n1', dependency_sha ] + print(subprocess.check_output(cmd)) # dependency = detector.get_commit(dependency_sha) # print(dependency.message + "\n") @@ -75,7 +73,7 @@ class CLIDependencyListener(DependencyListener): # print(" %s" % path) # print(" %s" % ", ".join(sorted(self.dependencies[dependency][path].keys()))) -class DependencyDetector: +class DependencyDetector(object): """Class for automatically detecting dependencies between git commits. A dependency is inferred by diffing the commit with each of its parents, and for each resulting hunk, performing a blame to see |