summaryrefslogtreecommitdiff
path: root/Porting/make_dot_patch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Porting/make_dot_patch.pl')
-rwxr-xr-xPorting/make_dot_patch.pl31
1 files changed, 3 insertions, 28 deletions
diff --git a/Porting/make_dot_patch.pl b/Porting/make_dot_patch.pl
index 4cc7f84ff4..b50fd85a48 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";