gittup/tup

.gitignore updates when converting generated/normal folders are delayed

bojidar-bg opened this issue ยท 0 comments

Thanks for explaining the .gitignore in Tupdefault trick to me; it actually works, but apparently I missed also adding it to my root Tupfile the first time I was testing it. ๐Ÿ˜… ๐ŸŽ‰

Either way, I managed to randomly stumble on an issue while doing that; Tup seemingly forgets to update the folder containing the .gitignore when a subfolder changes type from normal to generated or vice versa.

Example testcase:

#! /bin/sh -e

. ./tup.sh

cat > Tupfile <<HERE
.gitignore
: |> touch %o |> out/generated.txt
HERE
cat > Tupdefault <<HERE
.gitignore
HERE

update # state 1  -- out/ is a generated directory
gitignore_good out .gitignore
check_not_exist out/.gitignore

touch out/non-generated.txt
update # state 2  -- out/ is a normal directory
gitignore_bad out .gitignore ## <---- fails here!
gitignore_good generated.txt out/.gitignore

touch Tupfile ## or, touch random.txt
update
gitignore_bad out .gitignore ## but now it works!

rm out/non-generated.txt
update # back to state 1, however...
gitignore_good out .gitignore ## <<--- fails here!
check_not_exist out/.gitignore ## <<--- and this file hangs around forever until manually deleted

touch Tupfile ## or, touch random.txt
update
gitignore_good out .gitignore ## but now it works!

eotup