nunavut icon indicating copy to clipboard operation
nunavut copied to clipboard

Put .gitignore into generated root namespace directories automatically

Open pavel-kirienko opened this issue 3 years ago • 2 comments

I suggest that we provide an option that, when enabled, creates .gitignore (and possibly other VCS ignore files) inside every root namespace directory. The ignore file should contain a single * to ignore all generated files. Maybe this should be the default behavior.

pavel-kirienko avatar Nov 29 '21 19:11 pavel-kirienko

I'm dubious. This seems like something an IDE or build system to do.

thirtytwobits avatar Dec 14 '21 16:12 thirtytwobits

The build system -- sure; not sure about IDE (it shouldn't be involved in code generation, normally). But what about Python. Suppose you have a script that generates Python packages from DSDL namespaces and stores the results in-tree. This appears to be a common use case. I would like the generated files to be automatically excluded from version control. I could easily add the required behavior to PyUAVCAN:

    for p in pyuavcan.dsdl.compile_all([...]):
        (p.path / ".gitignore").write_text("*")

but then https://github.com/UAVCAN/pyuavcan/issues/110 would probably require this to be migrated to Nunavut, so it might be sensible to unify it across all target languages.

pavel-kirienko avatar Dec 15 '21 09:12 pavel-kirienko