Stream: ideas

Topic: Consolidating .gitignore files


view this post on Zulip Brian Teague (Jan 06 2024 at 18:27):

I merged all the gitignore files to a single file at the root of the directory.
The changes include ignoring all files without extensions by default (binary files)
Then explicitly adding back files with extension, directories, and the few files that do not have extensions like Dockerfile, AUTHORS, etc.

I found a command that will manually delete all files from the git repo that are supposed to be ignored
git rm --cached git ls-files -i -c --exclude-from=.gitignore

Here is the full list of files that show up to be deleted.

Please confirm which of these files need to be manually kept and which ones are okay to delete:

AUTHORS
Earthfile
LEGAL_DETAILS
LICENSE
dep5 (.reuse)
NotARocFile (crates/cli/tests/fixtures/format/formated_directory)
dynhost_benchmarks_elf64 (crates/linker)
dynhost_benchmarks_windows.exe (crates/linker)
LICENSE-APACHE (crates/vendor/morphic_lib)
LICENSE-MIT (crates/vendor/morphic_lib)
LICENSE (crates/vendor/pretty)
Dockerfile (docker/*)
Cargo.lock (examples/glue/rust-platform)
rocLovesRust (examples/glue/rust-platform)
config (examples/glue/rust-platform/.cargo)
rust-toolchain (nightly_benches)

view this post on Zulip Brendan Hansknecht (Jan 06 2024 at 18:28):

I think all but rocLovesRust should be kept.

view this post on Zulip Anton (Jan 06 2024 at 18:28):

rust-toolchain should be renamed to rust-toolchain.toml

view this post on Zulip Brendan Hansknecht (Jan 06 2024 at 18:29):

Though not 100% sure about:

And this is probably fine either way:

view this post on Zulip Anton (Jan 06 2024 at 18:29):

I'm unsure about these:

dep5 (.reuse)
NotARocFile (crates/cli/tests/fixtures/format/formated_directory)
dynhost_benchmarks_elf64 (crates/linker)
dynhost_benchmarks_windows.exe (crates/linker)
rocLovesRust (examples/glue/rust-platform)
config (examples/glue/rust-platform/.cargo)

view this post on Zulip Brian Teague (Jan 06 2024 at 18:30):

Both of those are binary files, but not sure if they get created at build time / downloaded from website?

If they are created at build time, then they probably should be ignored.

view this post on Zulip Brendan Hansknecht (Jan 06 2024 at 18:31):

@Folkert de Vries

Are these specially crafted linker test files?

view this post on Zulip Folkert de Vries (Jan 06 2024 at 18:32):

yes they are used to test parts of the linker code

view this post on Zulip Brendan Hansknecht (Jan 06 2024 at 18:34):

Cool, so it should be.

Keep:

AUTHORS
Earthfile
LEGAL_DETAILS
LICENSE
dep5 (.reuse)
NotARocFile (crates/cli/tests/fixtures/format/formated_directory)
dynhost_benchmarks_elf64 (crates/linker)
dynhost_benchmarks_windows.exe (crates/linker)
LICENSE-APACHE (crates/vendor/morphic_lib)
LICENSE-MIT (crates/vendor/morphic_lib)
LICENSE (crates/vendor/pretty)
Dockerfile (docker/*)
config (examples/glue/rust-platform/.cargo)
rust-toolchain (nightly_benches)

Remove:

rocLovesRust (examples/glue/rust-platform)

Probably can remove:

Cargo.lock (examples/glue/rust-platform)

view this post on Zulip Brian Teague (Jan 06 2024 at 19:01):

I missed a few gitignore files. I'm going to delete those. Run a full build and test suite to see what tries to get added (add those to the root gitignore) and rerun git rm --cached git ls-files -i -c --exclude-from=.gitignore to make sure nothing is getting deleted that isn't supposed to be deleted.

view this post on Zulip Brian Teague (Jan 06 2024 at 19:22):

Okay, ran a build and test. No new files are being added. No new files are being deleted except for the one mentioned earlier. Add toml extension to the two files. All gitignore files are being deleted except the root.

Please review the PR when ready.

view this post on Zulip Anton (Jan 08 2024 at 10:11):

Thanks @Brian Teague! I'll try to review it today


Last updated: Jun 16 2026 at 16:19 UTC