diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-11-15 18:31:11 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-11-15 18:31:11 +0000 |
commit | 4423ff8ec350aa17c19f63dd6d7f3efa42ddd856 (patch) | |
tree | 8228820e401e0e2c5f0ea9f4492884560123c575 /dgit | |
parent | 3f747fd7e5b6d982d0b8a46532149e20d600a6c7 (diff) |
Break out quiltify_dpkg_commit (nfc)
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -2039,23 +2039,16 @@ our $dscfn; our $fakeeditorenv = 'DGIT_FAKE_EDITOR_QUILT'; -sub quiltify ($$) { - my ($clogp,$headref) = @_; +sub quiltify_dpkg_commit ($$$$) { + my ($patchname,$title,$author,$msg) = @_; - my $author = getfield $clogp, 'Maintainer'; - my $time = time; - my $ncommits = 3; - my $patchname = "auto-$version-$headref-$time"; - my $msg = cmdoutput @git, qw(log), "-n$ncommits"; mkpath '.git/dgit'; my $descfn = ".git/dgit/quilt-description.tmp"; open O, '>', $descfn or die "$descfn: $!"; $msg =~ s/\n/\n /g; $msg =~ s/^\s+$/ ./mg; print O <<END or die $!; -Description: Automatically generated patch ($clogp->{Version}) - Last (up to) $ncommits git changes, FYI: - . +Description: $title $msg Author: $author @@ -2063,6 +2056,7 @@ Author: $author END close O or die $!; + { local $ENV{'EDITOR'} = cmdoutput qw(realpath --), $0; local $ENV{'VISUAL'} = $ENV{'EDITOR'}; @@ -2071,6 +2065,19 @@ END } } +sub quiltify ($$) { + my ($clogp,$headref) = @_; + + my $time = time; + my $ncommits = 3; + my $msg = cmdoutput @git, qw(log), "-n$ncommits"; + + quiltify_dpkg_commit "auto-$version-$headref-$time", + (getfield $clogp, 'Maintainer'), + "Automatically generated patch ($clogp->{Version})", + "Last (up to) $ncommits git changes, FYI:\n\n". $msg; +} + sub build_maybe_quilt_fixup () { my $format=get_source_format; return unless madformat $format; |