geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

77 lines
1.6 KiB

  1. #!/usr/bin/perl
  2. # git log --pretty=fuller --no-color --date=short --decorate=full
  3. my @mname = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  4. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
  5. sub nicedate {
  6. my ($date)=$_;
  7. if($date =~ /(\d\d\d\d)-(\d\d)-(\d\d)/) {
  8. return sprintf("%d %s %4d", $3, $mname[$2-1], $1);
  9. }
  10. return $date;
  11. }
  12. print
  13. ' Changelog for the libssh2 project. Generated with git2news.pl
  14. ';
  15. my $line;
  16. my $tag;
  17. while(<STDIN>) {
  18. my $l = $_;
  19. if($l =~/^commit ([[:xdigit:]]*) ?(.*)/) {
  20. $co = $1;
  21. my $ref = $2;
  22. if ($ref =~ /refs\/tags\/(libssh2-|VERSION\.)([0-9._]*)/) {
  23. $tag = $2;
  24. } else {
  25. $tag = '';
  26. }
  27. }
  28. elsif($l =~ /^Author: *(.*) +</) {
  29. $a = $1;
  30. }
  31. elsif($l =~ /^Commit: *(.*) +</) {
  32. $c = $1;
  33. }
  34. elsif($l =~ /^CommitDate: (.*)/) {
  35. $date = nicedate($1);
  36. }
  37. elsif($l =~ /^( )(.*)/) {
  38. my $extra;
  39. if ($tag) {
  40. # Version entries have a special format
  41. print "\nVersion " . $tag." ($date)\n";
  42. $oldc = "";
  43. $tag = "";
  44. }
  45. if($a ne $c) {
  46. $extra=sprintf("\n- [%s brought this change]\n\n ", $a);
  47. }
  48. else {
  49. $extra="\n- ";
  50. }
  51. if($co ne $oldco) {
  52. if($c ne $oldc) {
  53. print "\n$c ($date)$extra";
  54. }
  55. else {
  56. print "$extra";
  57. }
  58. $line =0;
  59. }
  60. $oldco = $co;
  61. $oldc = $c;
  62. $olddate = $date;
  63. if($line++) {
  64. print " ";
  65. }
  66. print $2."\n";
  67. }
  68. }