our $we_are_responder;
our $initiator_tempdir;
our $patches_applied_dirtily = 00;
+our $tagformat_want;
our $tagformat;
our $tagformatfn;
#
# > param head HEAD
# > param csuite SUITE
+# > param tagformat old|new
#
# > previously REFNAME=OBJNAME # if --deliberately-not-fast-forward
# # goes into tag, for replay prevention
sub select_tagformat () {
# sets $tagformatfn
- return if $tagformatfn && !$tagformat;
- die 'bug' if $tagformatfn && $tagformat;
- # ... $tagformat assigned after previous select_tagformat
+ return if $tagformatfn && !$tagformat_want;
+ die 'bug' if $tagformatfn && $tagformat_want;
+ # ... $tagformat_want assigned after previous select_tagformat
my (@supported) = split /\,/, access_cfg('dgit-tag-format');
printdebug "select_tagformat supported @supported\n";
- $tagformat //= [ $supported[0], "distro access configuration", 0 ];
- printdebug "select_tagformat specified @$tagformat\n";
+ $tagformat_want //= [ $supported[0], "distro access configuration", 0 ];
+ printdebug "select_tagformat specified @$tagformat_want\n";
- my ($fmt,$why,$override) = @$tagformat;
+ my ($fmt,$why,$override) = @$tagformat_want;
fail "target distro supports tag formats @supported".
" but have to use $fmt ($why)"
unless $override
or grep { $_ eq $fmt } @supported;
- $tagformat = undef;
+ $tagformat_want = undef;
+ $tagformat = $fmt;
$tagformatfn = ${*::}{"debiantag_$fmt"};
fail "trying to use unknown tag format \`$fmt' ($why) !"
responder_send_file('changes',$changesfile);
responder_send_command("param head $head");
responder_send_command("param csuite $csuite");
+ responder_send_command("param tagformat $tagformat");
if (deliberately_not_fast_forward) {
git_for_each_ref(lrfetchrefs, sub {
if ($protovsn < 4) {
fail "rpush negotiated protocol version $protovsn".
" which supports old tag format only".
- " but trying to use new format (".$tagformat->[1].")"
- if $tagformat && $tagformat->[0] ne 'old';
- $tagformat = ['old', "rpush negotiated protocol $protovsn", 0];
+ " but trying to use new format (".$tagformat_want->[1].")"
+ if $tagformat_want && $tagformat_want->[0] ne 'old';
+ $tagformat_want = ['old', "rpush negotiated protocol $protovsn", 0];
}
select_tagformat();
}
my $head = $i_param{'head'};
die if $head =~ m/[^0-9a-f]/ || $head !~ m/^../;
+ select_tagformat();
+ if ($protovsn >= 4) {
+ my $p = $i_param{'tagformat'} // '<undef>';
+ $p eq $tagformat
+ or badproto \*RO, "tag format mismatch: $p vs. $tagformat";
+ }
+
die unless $i_param{'csuite'} =~ m/^$suite_re$/;
$csuite = $&;
push_parse_dsc $i_dscfn, 'remote dsc', $i_version;
die "$quilt_mode ?";
}
- my $time = time;
+ my $time = $ENV{'GIT_COMMITTER_DATE'} || time;
+ $time =~ s/\s.*//; # trim timezone from GIT_COMMITTER_DATE
my $ncommits = 3;
my $msg = cmdoutput @git, qw(log), "-n$ncommits";
} elsif (m/^--dgit-tag-format=(old|new)$/s) {
# undocumented, for testing
push @ropts, $_;
- $tagformat = [ $1, 'command line', 1 ];
+ $tagformat_want = [ $1, 'command line', 1 ];
# 1 menas overrides distro configuration
} elsif (m/^--always-split-source-build$/s) {
# undocumented, for testing