X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=02acfa7fac5be920236d18cc4fdd51f101be3901;hp=f582be0e8ee39cd1a0e00275ec6c78d76c2100c3;hb=7cf634614b9a4ee18a70030e3b340dccd470f908;hpb=2c84b46d621bb5908bbfc64b9fcb12c30ab6b4a2 diff --git a/dgit b/dgit index f582be0e..02acfa7f 100755 --- a/dgit +++ b/dgit @@ -36,6 +36,7 @@ our $sign = 1; our $dryrun = 0; our $changesfile; our $new_package = 0; +our $ignoredirty = 0; our $existing_package = 'dpkg'; our $cleanmode = 'dpkg-source'; @@ -763,6 +764,7 @@ sub pull () { } sub check_not_dirty () { + return if $ignoredirty; my @cmd = (@git, qw(diff --quiet HEAD)); printcmd(\*DEBUG,"+",@cmd) if $debug>0; $!=0; $?=0; system @cmd; @@ -984,7 +986,10 @@ sub cmd_push { git_fetch_us(); } if (fetch_from_archive()) { - is_fast_fwd(lrref(), 'HEAD') or die; + is_fast_fwd(lrref(), 'HEAD') or + fail "dgit push: HEAD is not a descendant". + " of the archive's version.\n". + "$us: To overwrite it, use git-merge -s ours ".lrref()."."; } else { $new_package or fail "package appears to be new in this suite;". @@ -1190,6 +1195,8 @@ sub parseopts () { $cleanmode = $1; } elsif (m/^--clean=(.*)$/s) { badusage "unknown cleaning mode \`$1'"; + } elsif (m/^--ignore-dirty$/s) { + $ignoredirty = 1; } else { badusage "unknown long option \`$_'"; }