[前][次][番号順一覧][スレッド一覧]

ruby-changes:55930

From: Nobuyoshi <ko1@a...>
Date: Fri, 31 May 2019 10:56:23 +0900 (JST)
Subject: [ruby-changes:55930] Nobuyoshi Nakada: d180e40570 (trunk): Add --limit option and default it to 20

https://git.ruby-lang.org/ruby.git/commit/?id=d180e40570

From d180e405703b36c3f3a84334779c56bf9a3ea6a8 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 31 May 2019 02:52:41 +0900
Subject: Add --limit option and default it to 20


diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index 1e2a6fc..8a72bd3 100755
--- a/tool/file2lastrev.rb
+++ b/tool/file2lastrev.rb
@@ -19,6 +19,7 @@ def self.output=(output) https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L19
   @output = output
 end
 @suppress_not_found = false
+@limit = 20
 
 format = '%Y-%m-%dT%H:%M:%S%z'
 srcdir = nil
@@ -39,6 +40,9 @@ parser = OptionParser.new {|opts| https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L40
     self.output = :modified
     format = fmt if fmt
   end
+  opts.on("--limit=NUM", "limit branch name length (#@limit)", Integer) do |n|
+    @limit = n
+  end
   opts.on("-q", "--suppress_not_found") do
     @suppress_not_found = true
   end
@@ -60,7 +64,7 @@ vcs = nil https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L64
         ("#define RUBY_FULL_REVISION #{last.inspect}" unless short == last),
         if branch
           e = '..'
-          limit = 16
+          limit = @limit
           name = branch.sub(/\A(.{#{limit-e.size}}).{#{e.size+1},}/o) {$1+e}
           "#define RUBY_BRANCH_NAME #{name.dump}"
         end,
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]