From: Sergey Matveev Date: Sat, 11 Nov 2023 20:00:49 +0000 (+0300) Subject: Fix whichdo regressions X-Git-Tag: v2.3.0^0 X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=commitdiff_plain;h=97df0eade82cee19a0d5ee9287188ef2fec62985 Fix whichdo regressions --- diff --git a/doc/news.texi b/doc/news.texi index 68442f0..ae1ca4a 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -2,6 +2,13 @@ @cindex news @unnumbered News +@anchor{Release 2_3_0} +@section Release 2.3.0 +@itemize +@item + Fix regressions in @command{redo-whichdo} happened after huge refactoring. +@end itemize + @anchor{Release 2_2_0} @section Release 2.2.0 @itemize diff --git a/main.go b/main.go index 03a73d4..d6ac0d3 100644 --- a/main.go +++ b/main.go @@ -394,7 +394,6 @@ func main() { if err != nil { break } - sort.Strings(dos) for _, do := range dos { fmt.Println(do) } diff --git a/t/goredo-whichdo-regression.t b/t/goredo-whichdo-regression.t new file mode 100755 index 0000000..81a51a9 --- /dev/null +++ b/t/goredo-whichdo-regression.t @@ -0,0 +1,21 @@ +#!/bin/sh + +testname=`basename "$0"` +test_description="Check that dependencies have correct relative path after cd" +. $SHARNESS_TEST_SRCDIR/sharness.sh +export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1 + +cat > our < their +test_expect_success expected "cmp --silent our their" + +test_done diff --git a/usage.go b/usage.go index 2803628..a091a92 100644 --- a/usage.go +++ b/usage.go @@ -24,7 +24,7 @@ import ( ) const ( - Version = "2.2.0" + Version = "2.3.0" Warranty = `Copyright (C) 2020-2023 Sergey Matveev This program is free software: you can redistribute it and/or modify diff --git a/whichdo.go b/whichdo.go index d74f2ef..4a22b10 100644 --- a/whichdo.go +++ b/whichdo.go @@ -44,10 +44,10 @@ func whichdo(tgt *Tgt) (dos []string, err error) { return } for _, ifcreate := range dep.ifcreates { - dos = append(dos, ifcreate.RelTo(tgtH)) + dos = append(dos, ifcreate.RelTo(Cwd)) } for _, ifchange := range dep.ifchanges { - dos = append(dos, ifchange.tgt.RelTo(tgtH)) + dos = append(dos, ifchange.tgt.RelTo(Cwd)) } } if doFile == "" {