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

Support unignoring files/folders in .gitignore #3031

Closed
Brixy opened this issue Feb 12, 2024 · 2 comments · Fixed by #3071
Closed

Support unignoring files/folders in .gitignore #3031

Brixy opened this issue Feb 12, 2024 · 2 comments · Fixed by #3071
Labels
🐛bug Something isn't working

Comments

@Brixy
Copy link

Brixy commented Feb 12, 2024

Description

jj seems to ignore ! in .gitignore.

Steps to Reproduce the Problem

I have not tested it extensively, but this is a common use case for demonstration:

mkdir test
touch test/unignore_me
echo -e 'test/*\n!test/unignore_me' > .gitignore
git init
jj init --git-repo=.
jj commit -m 'Init'
jj st # The working copy is clean
git status # Unversioned files: test/

Also tested with test/** in .gitignore.

If it really is a jj issue it might be crucial. (I am pretty new to jj and have not followed all discussions. But I did search for similar issues.)

Expected Behavior

jj should add test/unignore_me in the initial revision -- like ‘pure’ git.

Actual Behavior

jj ignores test/unignore_me.

Specifications

  • Platform: Linux 6.7, wayland
  • Version: jj 0.13.0-5450e6c9bae40b941b05942bdd78a88e1b9093a6
@yuja
Copy link
Contributor

yuja commented Feb 12, 2024

Looks like a bug. visit_directory() first tests the directory "test/", and it doesn't match the negative pattern literally, the whole directory is ignored. #2499 might fix the issue, but I have no idea.

@yuja yuja added the 🐛bug Something isn't working label Feb 12, 2024
@daehyeok
Copy link
Contributor

daehyeok commented Feb 18, 2024

#3071 will fix it.
with jj 0.14.0

 //.../workspace/jj/issue_3031 ❯ git init
Initialized empty Git repository in /Users/daehyeok/workspace/jj/issue_3031/.git/
 //.../workspace/jj/issue_3031 ❯ jj init --git-repo=.
warning: `--git` and `--git-repo` are deprecated.
Use `jj git init` instead
Initialized repo in "."
 //.../workspace/jj/issue_3031 ❯ jj st
Working copy changes:
A .gitignore
Working copy : uqptwszk e79a4a6b (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)
 //.../workspace/jj/issue_3031 ❯

with PR.

 //.../workspace/jj/issue_3031 ❯ git init
Initialized empty Git repository in /Users/daehyeok/workspace/jj/issue_3031/.git/
 //.../workspace/jj/issue_3031 ❯ ../target/debug/jj init --git-repo=.
warning: `--git` and `--git-repo` are deprecated.
Use `jj git init` instead
Initialized repo in "."
 //.../workspace/jj/issue_3031 ❯ ../target/debug/jj st
Working copy changes:
A .gitignore
A test/unignore_me
Working copy : mrwntuvm ae763def (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants