Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ignore thinks file is a diff #370

Closed
mbunkus opened this Issue · 2 comments

3 participants

@mbunkus

magit next, revision b84af7c

Sometimes magit gets confused and thinks that point is on a diff instead of on a file. This happens to me when I want to ignore files (both with "i" and "I").

Steps to reproduce:

  1. Create an empty repository.
  2. Add a file, commit.
  3. Edit said file, do not stage yet.
  4. Put another file into the directory, but do not add it.
  5. Refresh magit's status buffer. It should show one changed file, one untracked. No diffs are shown, I haven't expanded anything.
  6. Move point to the changed file.
  7. Hit "i" or "I". magit errors with "Can't ignore a diff"
@pjweisberg

I suppose "Can't ignore a tracked file" would be a better message. (You can't, you know. Even if it's added to .gitignore manually, the fact that it's tracked overrides the ignore rule.)

@mbunkus

Good point -- I've actually stumbled over this myself. However, I've used "git rm said_file" afterwards. Maybe instead of showing a completely wrong error message something like "File is already under version control; remove and ignore? yes/no" would be appropriate.

@tarsius tarsius was assigned
@tarsius tarsius closed this in f52b309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.