Skip to content

Fix shadow rendering for .git materialization - #114

Merged
geekgonecrazy merged 2 commits into
devfrom
chore/git-shadow-troubleshooting
Jul 15, 2026
Merged

geekgonecrazy merged 2 commits into
devfrom
chore/git-shadow-troubleshooting

Conversation

@leefaus

@leefaus leefaus commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces support for bootstrapping Atomic into an existing Git checkout using the new --into-existing option for the clone command. It ensures that Atomic can be initialized in a Git working tree without overwriting Git-managed files, validates the target directory, and adjusts materialization logic to respect Git's ownership of the worktree. Additionally, it improves repository handling to never move or touch .git directories during view switches, and it adds comprehensive tests for the new behavior.

New --into-existing clone mode:

  • Adds a --into-existing flag to the Clone command, allowing users to bootstrap Atomic into an existing Git working tree without materializing Atomic content over Git-managed files. This includes validation to ensure the target is a non-bare Git repository at its worktree root and not already an Atomic repository. [1] [2]
  • Updates materialization logic so that, when --into-existing is used, Atomic does not overwrite the working copy and instead prompts the user to run atomic git import --incremental as the next step. [1] [2]

Repository and view switch improvements:

  • Updates repository switching logic to never move or touch .git directories during view switches, ensuring Git administrative data is always preserved and managed by Git, not Atomic. [1] [2]

Testing and validation:

  • Adds new tests for the --into-existing option, including validation of acceptable and unacceptable target directories, and updates builder tests to cover the new flag. [1] [2] [3]

Shell test enhancements:

  • Adds a new shell test section to verify that, after importing all local Git branches, Atomic does not overwrite the Git-managed working copy and that switching views does not disturb Git administrative state or leave the worktree in an inconsistent state.

Output and user guidance:

  • Improves CLI output to inform users when the working copy is being preserved because of --into-existing, and provides hints for next steps. [1] [2]

These changes ensure a safe and user-friendly integration between Atomic and existing Git repositories, preventing accidental overwrites and clarifying user workflows.

@geekgonecrazy
geekgonecrazy merged commit 4fadaba into dev Jul 15, 2026
8 checks passed
@geekgonecrazy
geekgonecrazy deleted the chore/git-shadow-troubleshooting branch July 15, 2026 22:26
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 this pull request may close these issues.

3 participants