Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previously ignored files should not become tracked on checkout #5596

Open
martinvonz opened this issue Feb 5, 2025 · 2 comments
Open

Previously ignored files should not become tracked on checkout #5596

martinvonz opened this issue Feb 5, 2025 · 2 comments

Comments

@martinvonz
Copy link
Member

Description

When updating from a commit where some files are ignored to a commit where they are not ignored (typically an older version), the ignored files will be picked up by subsequent snapshotting. That's rarely what one wants, and it's especially problematic if the ignored files are many (e.g. target/ in Rust projects).

Steps to Reproduce the Problem

cd $(mktemp -d)
jj git init
jj new
echo ignored > .gitignore
touch ignored
jj edit @-
jj status

Actual Behavior

The ignored file is tracked.

Expected Behavior

The ignored file does not get tracked. Perhaps jj status reports that it's in some kind of intermediate state.

We could implement it by having the WorkingCopy keep track of this type of file. Files would enter this state when updating the working copy and the ignored paths change. They would exit it when they're either either deleted or properly ignored again.

This idea was originally suggested by @ony.

Specifications

  • Platform: All
  • Version: 0.25.0 (and probably all before it)
@yuja
Copy link
Contributor

yuja commented Feb 6, 2025

Duplicates of #3204?

Files would enter this state when updating the working copy and the ignored paths change. They would exit it when they're either either deleted or properly ignored again.

fwiw, git submodule directories are processed in a similar manner. They're marked as submodule (= ignored) internally.

@martinvonz
Copy link
Member Author

Duplicates of #3204?

Ah, that's the issue I was looking for! I spend at least 5 minutes searching for it (e.g. "tracked ignored" doesn't work). I guess I'll mark that one as duplicate instead so it will be easier to find the issue (i.e. this one) next time.

@martinvonz martinvonz marked this as a duplicate of #3204 Feb 6, 2025
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

No branches or pull requests

2 participants