diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-24 03:52:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-24 03:52:46 +0000 |
commit | e16c316b52948396eac43ee9d79383274c616256 (patch) | |
tree | 3052f7072253ca50dcea5a358638348080741b19 /tool | |
parent | ccba83feffcb68bd46e75efcadb931e5d23c6bae (diff) |
* common.mk (change), tool/change_maker.rb: make a brief template
for ChangeLog.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/change_maker.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tool/change_maker.rb b/tool/change_maker.rb new file mode 100755 index 0000000000..d039de9909 --- /dev/null +++ b/tool/change_maker.rb @@ -0,0 +1,26 @@ +#! ./miniruby + +if File.directory?(".svn") + cmd = "svn diff" +elsif File.directory?(".git") + cmd = "git diff" +else + abort "does not seem to be under a vcs" +end + +def diff2index(cmd, *argv) + path = nil + `#{cmd} #{argv.join(" ")}`.split(/\n/).each do |line| + case line + when /^Index: (\S*)/, /^diff --git [a-z]\/(\S*) [a-z]\/\1/ + path = $1 + when /^@@.*@@ +([A-Za-z_][A-Za-z_0-9 ]*[A-Za-z_0-9])/ + puts "* #{path} (#{$1}):" + end + end + !!path +end + +if !diff2index(cmd, ARGV) and /^git/ =~ cmd + diff2index(cmd, "--cached", ARGV) +end |