Thread (11 messages) flat view 11 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH v2 4/8] contrib: cc-cmd: add option to show commits

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:56:54
Subsystem: the rest · Maintainer: Linus Torvalds

Instead of showing the authors and signers, show the commits themselves.

Signed-off-by: Felipe Contreras <redacted>
---
 contrib/cc-cmd/git-cc-cmd | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/contrib/cc-cmd/git-cc-cmd b/contrib/cc-cmd/git-cc-cmd
index e36b1bf..f13ed8f 100755
--- a/contrib/cc-cmd/git-cc-cmd
+++ b/contrib/cc-cmd/git-cc-cmd
@@ -4,6 +4,7 @@ require 'optparse'
 
 $since = '3-years-ago'
 $min_percent = 5
+$show_commits = false
 
 begin
   OptionParser.new do |opts|
@@ -16,6 +17,9 @@ begin
     opts.on('-d', '--since DATE', 'How far back to search for relevant commits') do |v|
       $since = v
     end
+    opts.on('-c', '--commits[=FORMAT]', [:raw], 'List commits instead of persons') do |v|
+      $show_commits = v || true
+    end
   end.parse!
 rescue OptionParser::InvalidOption
 end
@@ -136,6 +140,15 @@ commits = Commits.new
 commits.from_patches(ARGV)
 commits.import
 
+if $show_commits
+  if $show_commits == :raw
+    puts commits.items.keys
+  else
+    system(*['git', 'log', '--oneline', '--no-walk'] + commits.items.keys)
+  end
+  exit 0
+end
+
 # hash of hashes
 persons = Hash.new { |hash, key| hash[key] = {} }
 
-- 
1.8.2.1.790.g4588561
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help