diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | common.mk | 4 | ||||
-rwxr-xr-x | tool/change_maker.rb | 26 |
3 files changed, 35 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Mon May 24 12:52:44 2010 Nobuyoshi Nakada <[email protected]> + + * common.mk (change), tool/change_maker.rb: make a brief template + for ChangeLog. + Mon May 24 09:19:59 2010 NAKAMURA Usaku <[email protected]> * gc.c (gc_sweep): suppres a warning on VC. @@ -816,6 +816,9 @@ info-libruby_so: info-arch: @echo arch=$(arch) +change: + $(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log + help: PHONY @echo " Makefile of Ruby" @echo "" @@ -839,6 +842,7 @@ help: PHONY @echo " install: install all ruby distributions" @echo " install-nodoc: install without rdoc" @echo " clean: clean built objects" + @echo " change: make change log template" @echo " golf: for golfers" @echo "" @echo "see DeveloperHowto for more detail: " 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 |