logoalt Hacker News

zahlmanyesterday at 8:11 PM1 replyview on HN

Oh, man, I'd forgotten about these negated .gitignore patterns entirely. It actually hadn't occurred to me that they could override the behaviour of ignoring empty directories.

This is potentially actually useful for me, because I have a project with test data that consists of miniature filesystem sub-trees — that should include empty directories to ensure edge cases are covered. I've been zipping them up and having the test harness unpack them in the test environment, but that's an unnecessary extra point of failure (and it stuffs undiffable binary files into the commit history).

Edit: Ah, no, if this doesn't work from the project-global .gitignore (specifying a folder to keep, even though it's empty and doesn't even have its own .gitignore) then it doesn't solve the problem. :(


Replies

ivan_gammelyesterday at 10:07 PM

Why not having a txt file with indented tree, a bootstrap function that parses the file and creates the tree and a test for that function?

You will have proper diff for the tree this way.

show 1 reply