X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/031cefa092a35217a3ac4abe595ffb31b4d6ec81..790f2f66dd0f9e8678a5f5129f984aa0d5baf08c:/Porting/make_dot_patch.pl diff --git a/Porting/make_dot_patch.pl b/Porting/make_dot_patch.pl index cf545ac..71c4604 100755 --- a/Porting/make_dot_patch.pl +++ b/Porting/make_dot_patch.pl @@ -1,3 +1,4 @@ +#!/usr/bin/perl use strict; use warnings; @@ -7,7 +8,7 @@ use warnings; # It tries to find which of our primary branches the sha1 can be found on, # and then prints to standard out something similar to what our rsync feed # would produce for that situation. The main difference being, in that case -# we KNOW what branch we are on, and in this one we dont, and in that case +# we KNOW what branch we are on, and in this one we don't, and in that case # the $tstamp field holds the time the snapshot was generated (so that multiple # fetches will always have an increasing tstamp field), however in this case # we use the commit date of the sha1. @@ -19,28 +20,8 @@ use warnings; # # Yves -use POSIX qw(strftime); -sub isotime { strftime "%Y-%m-%d.%H:%M:%S",gmtime(shift||time) } +use lib "Porting"; +use GitUtils qw(gen_dot_patch); +print gen_dot_patch(@ARGV), -t STDOUT ? "\n" : ""; -my $sha1= shift || `git rev-parse HEAD`; -chomp($sha1); -my @branches=( - 'origin/blead', - 'origin/maint-5.10', - 'origin/maint-5.8', - 'origin/maint-5.8-dor', - 'origin/maint-5.6', - 'origin/maint-5.005', - 'origin/maint-5.004', -); -my $branch; -foreach my $b (@branches) { - $branch= $b and last - if `git log --pretty='format:%H' $b | grep $sha1`; -} - -$branch ||= "unknown-branch"; -my $tstamp= isotime(`git log -1 --pretty="format:%ct" $sha1`); -chomp(my $describe= `git describe`); -print join(" ", $branch, $tstamp, $sha1, $describe) . "\n";