changelog.tcl 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env tclsh
  2. if {[llength $::argv] != 2 && [llength $::argv] != 3} {
  3. puts "Usage: $::argv0 <branch> <version> \[<num-commits>\]"
  4. exit 1
  5. }
  6. set branch [lindex $::argv 0]
  7. set ver [lindex $::argv 1]
  8. if {[llength $::argv] == 3} {
  9. set count [lindex ::$argv 2]
  10. } else {
  11. set count 100
  12. }
  13. set template {
  14. ================================================================================
  15. Redis %ver% Released %date%
  16. ================================================================================
  17. Upgrade urgency <URGENCY>: <DESCRIPTION>
  18. }
  19. set template [string trim $template]
  20. append template "\n\n"
  21. set date [clock format [clock seconds]]
  22. set template [string map [list %ver% $ver %date% $date] $template]
  23. append template [exec git log $branch~$count..$branch "--format=format:%an in commit %h:%n %s" --shortstat]
  24. #Older, more verbose version.
  25. #
  26. #append template [exec git log $branch~30..$branch "--format=format:+-------------------------------------------------------------------------------%n| %s%n| By %an, %ai%n+--------------------------------------------------------------------------------%nhttps://github.com/antirez/redis/commit/%H%n%n%b" --stat]
  27. puts $template