forked from Perl/perl5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworking make_dot_patch.pl Remove make_snapshot.pl
- Loading branch information
1 parent
f96e212
commit 8d462f6
Showing
6 changed files
with
19 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
use POSIX qw(strftime); | ||
|
||
# This is a quickie script which I wrote to generate the .patch file for | ||
# an arbitrary commit. It takes on sha1 as an argument, or saving that | ||
# uses the sha1 associated to HEAD. | ||
# 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 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. | ||
# | ||
# This is more or less intended to be used as a utility to generated .patch | ||
# files for other processes, like gitweb and snapshots. | ||
# | ||
# The script assumes it is being run from a git WD. | ||
# | ||
# Yves | ||
# Generate .patch for later usage by smokers that are not synching via git | ||
|
||
use lib "Porting"; | ||
use GitUtils qw(gen_dot_patch); | ||
print gen_dot_patch(@ARGV), -t STDOUT ? "\n" : ""; | ||
# Format date | ||
sub iso_time_with_dot { | ||
return strftime "%Y-%m-%d.%H:%M:%S", gmtime(shift || time) | ||
} | ||
|
||
# Generate the content of .patch for HEAD | ||
chomp(my ($git_dir, $sha1) = `git rev-parse --git-dir HEAD`); | ||
die "Not in a git repository!" if !$git_dir; | ||
|
||
my $branch = `git rev-parse --abbrev-ref HEAD`; | ||
chomp $branch; | ||
|
||
my $tstamp = iso_time_with_dot(`git log -1 --pretty="format:%ct" HEAD`); | ||
my $describe= `git describe HEAD`; | ||
chomp $describe; | ||
my $dot_patch = join(" ", $branch, $tstamp, $sha1, $describe); | ||
|
||
print $dot_patch, -t STDOUT ? "\n" : ""; |
This file was deleted.
Oops, something went wrong.