X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=Debian%2FDgit.pm;h=2bac4859f887ee5a17788755e00cfa5537503669;hb=11c8c965c3419fddf2444a7497b45b65f05d3db5;hp=960f505aa1579036d27f3d7374b18d74490f6e37;hpb=11feba1f44552f3232c52f4f2a55ff7f2f0c6175;p=dgit.git diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 960f505a..2bac4859 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -47,11 +47,11 @@ BEGIN { fail failmsg ensuredir must_getcwd executable_on_path waitstatusmsg failedcmd_waitstatus failedcmd_report_cmd failedcmd - runcmd cmdoutput cmdoutput_errok + runcmd shell_cmd cmdoutput cmdoutput_errok git_rev_parse git_cat_file git_get_ref git_get_symref git_for_each_ref git_for_each_tag_referring is_fast_fwd - git_check_unmodified + git_check_unmodified git_update_ref_cmd $package_re $component_re $deliberately_re $distro_re $versiontag_re $series_filename_re $extra_orig_namepart_re @@ -101,7 +101,9 @@ sub NOCOMMITCHECK () { return 0x8; } our $debugprefix; our $debuglevel = 0; -our $negate_harmful_gitattrs = "-text -eol -crlf -ident -filter"; +our $negate_harmful_gitattrs = + "-text -eol -crlf -ident -filter -working-tree-encoding"; + # ^ when updating this, alter the regexp in dgit:is_gitattrs_setup our $forkcheck_mainprocess; @@ -223,11 +225,11 @@ sub _us () { } sub failmsg { - my $s = "@_\n"; + my $s = "error: @_\n"; $s =~ s/\n\n$/\n/; my $prefix = _us().": "; $s =~ s/^/$prefix/gm; - return $s; + return "\n".$s; } sub fail { @@ -313,6 +315,11 @@ sub runcmd { failedcmd @_ if system @_; } +sub shell_cmd { + my ($first_shell, @cmd) = @_; + return qw(sh -ec), $first_shell.'; exec "$@"', 'x', @cmd; +} + sub cmdoutput_errok { confess Dumper(\@_)." ?" if grep { !defined } @_; debugcmd "|",@_; @@ -485,6 +492,13 @@ sub is_fast_fwd ($$) { } } +sub git_update_ref_cmd { + # returns qw(git update-ref), qw(-m), @_ + # except that message may be modified to honour GIT_REFLOG_ACTION + my $msg = shift @_; + return qw(git update-ref -m), $msg, @_; +} + sub changedir ($) { my ($newdir) = @_; printdebug "CD $newdir\n";