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

jj status stale cache of .gitignore #3336

Closed
prattmic opened this issue Mar 20, 2024 · 2 comments
Closed

jj status stale cache of .gitignore #3336

prattmic opened this issue Mar 20, 2024 · 2 comments

Comments

@prattmic
Copy link
Contributor

Description

It seems that if jj status sees a new directory, and then you add that directory to .gitignore, subsequent jj status still display the new directory.

Steps to Reproduce the Problem

$ jj git init
Initialized repo in "." 
$ jj st     
The working copy is clean                            
Working copy : ooxxnqmq c92b8794 (empty) (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)
$ echo "dir1" >> .gitignore
$ jj st
Working copy changes:    
A .gitignore
Working copy : ooxxnqmq 5b959ca8 (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)
$ mkdir dir1
$ touch dir1/file
$ jj st
Working copy changes:    
A .gitignore
Working copy : ooxxnqmq 5b959ca8 (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)

All working as expected until this point. The new directory is ignored. Now flip the order: add and see the new file before adding to .gitignore.

$ mkdir dir2
$ touch dir2/touch
$ jj st
Working copy changes:
A .gitignore
A dir2/file
Working copy : ooxxnqmq b72deba5 (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)
$ echo "dir2" >> .gitignore
$ jj st                  
Working copy changes:
A .gitignore
A dir2/file
Working copy : ooxxnqmq 324d3283 (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)

Expected Behavior

The last jj st should not display dir2/file.

Actual Behavior

The last jj st still displays dir2/file. Even jj commit commits the ignored file:

$ jj commit
Working copy now at: sxvyqstk 23454da1 (empty) (no description set)
Parent commit      : ooxxnqmq 7abb61df Adding files
$ jj show o
Commit ID: 7abb61dfde0717bc20f9c1c27e3b1acf4b1adacf
Change ID: ooxxnqmqkwuonlouovnuwzuzpzvnmsyp
Author: Michael Pratt <[email protected]> (2024-03-20 17:37:18.000 -04:00)
Committer: Michael Pratt <[email protected]> (2024-03-20 17:49:02.000 -04:00)

    Adding files

Added regular file .gitignore:
        1: dir1
        2: dir2
Added regular file dir2/touch:
    (empty)

Specifications

  • Platform: linux-amd64
  • Version: Internal pre-release version
@prattmic
Copy link
Contributor Author

Just to double-check that I'm not missing something silly about .gitignore file syntax, I tried this in a colocated repo, but as expected in the final state git status displays only the .gitignore file, not dir2.

@prattmic prattmic changed the title JJ status stale cache of .gitignore? jj status stale cache of .gitignore Mar 20, 2024
@prattmic
Copy link
Contributor Author

Duplicate of #3203

@prattmic prattmic closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
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

1 participant