Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gitignore updates when converting generated/normal folders are delayed #491

Closed
bojidar-bg opened this issue Mar 16, 2024 · 0 comments
Closed

Comments

@bojidar-bg
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant