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

Global .gitignore not respected #87

Closed
arxanas opened this issue Feb 26, 2022 · 2 comments
Closed

Global .gitignore not respected #87

arxanas opened this issue Feb 26, 2022 · 2 comments

Comments

@arxanas
Copy link
Collaborator

arxanas commented Feb 26, 2022

Expected Behavior

jj status shows files which should be globally ignored:

$ jj status
...
A bin/.DS_Store
A tests/.DS_Store

Actual Behavior

jj status should respect global .gitignore file by default.

Steps to Reproduce the Problem

  1. git config --global core.excludesfile ~/.gitignore_global
  2. jj init --git-repo=.
  3. touch .DS_Store
  4. jj st

The same problem happens even if I create ~/.gitignore.

Specifications

  • Version: jj 0.2.0 @ aadab1982dd7deaca7c20ba9d4c5e908115d7ba0
  • Platform: macOS 11.6.4
@martinvonz
Copy link
Owner

martinvonz commented Feb 26, 2022

Git's config in general is ignored, so step 1 will have no effect. We should probably respect some of them to make transitioning easier.

~/.gitignore should be respected, however. If you edited it after the file had already been added to the working copy commit, try running jj untrack <paths>.

@martinvonz
Copy link
Owner

I just found realized that ~/.gitignore doesn't seem to be anywhere in Git's documentation of how ignores work, so I suspect I just hard-coded the location it happened to have on my system. Oops.

By the way, this bug is very closely related to #65, so I'll probably fix both at around the same time (but probably not the same commit).

martinvonz added a commit that referenced this issue Mar 11, 2022
#87)

I want to be able to reuse the code for chaining two `.gitignore`
files outside of `working_copy.rs`.
martinvonz added a commit that referenced this issue Mar 12, 2022
I'm about to make callers pass in "base" Git ignores when writing a
tree from the working copy. `edit_diff()` will then need to pass
that. It'll be easier to do that if we have a proxy on
`WorkspaceCommandHelper`.
martinvonz added a commit that referenced this issue Mar 12, 2022
#87)

I want to be able to reuse the code for chaining two `.gitignore`
files outside of `working_copy.rs`.
martinvonz added a commit that referenced this issue Mar 12, 2022
I'm about to make callers pass in "base" Git ignores when writing a
tree from the working copy. `edit_diff()` will then need to pass
that. It'll be easier to do that if we have a proxy on
`WorkspaceCommandHelper`.
martinvonz added a commit that referenced this issue Mar 12, 2022
The library crate shouldn't look up the user's `$HOME` directory
(maybe the library is used by a server process), so let's have the
caller pass it into the library crate instead.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
#87)

I want to be able to reuse the code for chaining two `.gitignore`
files outside of `working_copy.rs`.
martinvonz added a commit that referenced this issue Mar 12, 2022
I'm about to make callers pass in "base" Git ignores when writing a
tree from the working copy. `edit_diff()` will then need to pass
that. It'll be easier to do that if we have a proxy on
`WorkspaceCommandHelper`.
martinvonz added a commit that referenced this issue Mar 12, 2022
The library crate shouldn't look up the user's `$HOME` directory
(maybe the library is used by a server process), so let's have the
caller pass it into the library crate instead.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
#87)

I want to be able to reuse the code for chaining two `.gitignore`
files outside of `working_copy.rs`.
martinvonz added a commit that referenced this issue Mar 12, 2022
I'm about to make callers pass in "base" Git ignores when writing a
tree from the working copy. `edit_diff()` will then need to pass
that. It'll be easier to do that if we have a proxy on
`WorkspaceCommandHelper`.
martinvonz added a commit that referenced this issue Mar 12, 2022
The library crate shouldn't look up the user's `$HOME` directory
(maybe the library is used by a server process), so let's have the
caller pass it into the library crate instead.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
#87)

I want to be able to reuse the code for chaining two `.gitignore`
files outside of `working_copy.rs`.
martinvonz added a commit that referenced this issue Mar 12, 2022
I'm about to make callers pass in "base" Git ignores when writing a
tree from the working copy. `edit_diff()` will then need to pass
that. It'll be easier to do that if we have a proxy on
`WorkspaceCommandHelper`.
martinvonz added a commit that referenced this issue Mar 12, 2022
The library crate shouldn't look up the user's `$HOME` directory
(maybe the library is used by a server process), so let's have the
caller pass it into the library crate instead.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
It probably doesn't make sense to respect Git's `core.excludesFile`
config when not running in a Git-backed repo, but we also already
respect `.gitignore` files in the working copy regardless of backend,
so at least it's consistent with that. We can revisit it when the
native backend becomes a reasonable choice.

Closes #87.
martinvonz added a commit that referenced this issue Mar 12, 2022
#87)

I want to be able to reuse the code for chaining two `.gitignore`
files outside of `working_copy.rs`.
martinvonz added a commit that referenced this issue Mar 12, 2022
I'm about to make callers pass in "base" Git ignores when writing a
tree from the working copy. `edit_diff()` will then need to pass
that. It'll be easier to do that if we have a proxy on
`WorkspaceCommandHelper`.
martinvonz added a commit that referenced this issue Mar 12, 2022
The library crate shouldn't look up the user's `$HOME` directory
(maybe the library is used by a server process), so let's have the
caller pass it into the library crate instead.
martinvonz added a commit that referenced this issue Mar 1, 2023
Issues #65 and #87 were both fixed almost a year ago.
martinvonz added a commit that referenced this issue Mar 2, 2023
Issues #65 and #87 were both fixed almost a year ago.
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