From: keni Date: Wed, 1 Apr 2015 18:40:48 +0000 (-0400) Subject: bug fixes for nhsub X-Git-Tag: NetHack-3.6.0_RC01~495 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32236f7985bebaa5cc696fe7a18af320d028a5c5;p=nethack bug fixes for nhsub --- diff --git a/DEVEL/hooksdir/nhsub b/DEVEL/hooksdir/nhsub index b8cdd9f67..5238f422a 100644 --- a/DEVEL/hooksdir/nhsub +++ b/DEVEL/hooksdir/nhsub @@ -1,6 +1,6 @@ #!/usr/bin/perl # nhsub -# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ +# $NHDT-Date: 1427913635 2015/04/01 18:40:35 $ # Note: was originally called nhdate; the rename is not reflected in the code. @@ -8,6 +8,10 @@ use strict; my %opt; #cmd v n f F (other single char, but we don't care) my $mode; # a c d f (add, commit, date, date -f) +if(length $ENV{GIT_PREFIX}){ + chdir($ENV{GIT_PREFIX}) or die "Can't chdir $ENV{GIT_PREFIX}: $!"; +} + #SO how do we know if a file has changed? #(git status: git status --porcelain --ignored -- FILES. #maybe + -z but it's a question of rename operations - probably doesn't @@ -70,7 +74,10 @@ my %codes = ( 'd??'=>0, 'c??'=>0, 'f!!'=>1, # !! ignored - 'a!!'=>0, 'd!!'=>0, 'c!!'=>0 + 'a!!'=>0, 'd!!'=>0, 'c!!'=>0, + + 'f@@'=>1, # @@ internal ignored + 'a@@'=>0, 'd@@'=>0, 'c@@'=>0 ); # OS hackery @@ -111,6 +118,9 @@ while(@rawlist){ closedir RDIR; } # ignore other file types + if(! -e $raw){ + print "warning: missing file $raw\n"; + } } # XXX could batch things up - later @@ -122,8 +132,8 @@ sub schedule_work { my $key = $mode . join('',(m/^(.)(.)/)); if(length $key == 1){ # Hack. An unmodified, tracked file produces no output from - # git status. Treat as ignored. - $key .= '!!'; + # git status. Treat as another version of 'ignored'. + $key .= '@@'; } $key =~ s/-/ /g; # for Keni's locally mod'ed git if(!exists $codes{$key}){