Repository navigation
init: add missing ignore lines to an existing .gitignore (closes #6158) - #6423
Merged
Merged
Conversation
The preset appended only the layers line to an existing .gitignore, so bazel-*, target/ and the other IGNORE_LINES stayed untracked. The preset now appends every IGNORE_LINES entry that no line covers (an equal line after dropping leading and trailing slashes, or a listed ancestor directory) and writes the full set when the file is missing. The scaffold no longer writes .gitignore, so the preset is the only writer. The .gitignore write no longer waits for the import block to be added. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #6158. Implements PR D of the plan on #6141.
preset.rs: an existing.gitignoregets everyIGNORE_LINESentry that no line covers. A line covers an entry when it is equal after dropping leading and trailing/, or when it names an ancestor directory (.dx/covers/.dx/bazelrc/). A missing.gitignoregets the whole set..gitignorewrite no longer waits for the import block. Before, a workspace that already imported the layers, or had a symlinked.bazelrc, never got the new lines.scaffold.rs: removes the.gitignoreentry, so the preset is the only writer.docs/cli/commands/init.mdrow for.gitignore.Line references in the issue were from an older main. Current code is
preset.rsignore_with_missingandignores, notLAYERS_IGNORE/COVERING_LINES.Tests
tools/dx check --apply //cli/adopt/...: passed.tools/dx test //cli/adopt:dx_adopt_test: 308 passed, 1 failed. The failure isoverrides::tests::table_matches_the_repo_module_bazel(gcc_toolchain patch order). This file is not touched by this PR.tools/dx test //cli/cli/tests/adopt:adopt_test: 3 passed, 1 failed. The failure isupgrade_moves_an_older_pin_to_this_dx. It also fails on basef394118d3(checked with the change stashed).target_only_gitignore_gains_every_other_line,an_equal_or_ancestor_line_ignores_the_entry, and the rewrittenwiring_appends_the_missing_ignore_lines.Not run:
//cli/cli:dx_cli_test(init unit tests incli/cli). No nested-Bazel or*_consumer_testtargets were run; CI runs those.Remaining
IGNORE_LINESstill lists language-specific entries (node_modules/,__pycache__/,*.pyc,.gradle/). The owner preference is nothing language-specific in init, so this may need a decision.🤖 Generated with Claude Code
Assisted by Claude.