X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2Fmake_dot_patch.pl;h=b50fd85a48cd86eb9025f3f4ad51dc4ae6c3159f;hb=338584c0b1c948a967b5e2ecbb69c512410589e4;hp=4cc7f84ff4fdeac86e00a11259fadee0edcc1a06;hpb=b20f263759e67c18c512f1ae5e4c7157c7ec76b1;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/make_dot_patch.pl b/Porting/make_dot_patch.pl index 4cc7f84..b50fd85 100755 --- a/Porting/make_dot_patch.pl +++ b/Porting/make_dot_patch.pl @@ -20,33 +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 $target= shift || 'HEAD'; -chomp(my ($git_dir, $is_bare, $sha1)=`git rev-parse --git-dir --is-bare-repository $target`); -die "Not in a git repository!" if !$git_dir; -$is_bare= "" if $is_bare and $is_bare eq 'false'; -my @branches=( - 'blead', - 'maint-5.10', - 'maint-5.8', - 'maint-5.8-dor', - 'maint-5.6', - 'maint-5.005', - 'maint-5.004', -); -my $reftype= $is_bare ? "heads" : "remotes/origin"; -my $branch; -foreach my $name (@branches) { - my $cmd= "git name-rev --name-only --refs=refs/$reftype/$name $sha1"; - chomp($branch= `$cmd`); - last if $branch ne 'undefined'; -} -$branch ||= "error"; -$branch =~ s!^\Q$reftype\E/!!; -$branch =~ s![~^].*\z!!; -my $tstamp= isotime(`git log -1 --pretty="format:%ct" $sha1`); -chomp(my $describe= `git describe`); -print join(" ", $branch, $tstamp, $sha1, $describe) . "\n";