0

Is there an Mercurial extension that removes lines from .hgignore that aren't matching any files in the local repository.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
Kirill
  • 3,364
  • 2
  • 21
  • 36
  • Looks like and extremely edge case, usually you start with an empty file and add stuff to ignore over time. You could check `hg status -in` to see the currently ignored files and compare to hgignore file. – MGP Mar 11 '13 at 17:33

1 Answers1

2

There exists no extension or built in function that does this. You could jerry rig a script to do to find lines that are ignoring nothing without too much work, but consider that this is probably a bad idea.

Just because the .hgignore line isn't matching an files on your local repository doesn't mean it's not matching them on anyone else's repository. Within .hgignore files you'll often find patterns like .swp and .bak. You might not use vi (which creates .swp files) and you might not use an editor that creates '.bakfiles, but other do. Or perhaps your editor creates .swp files but you don't currently have any because you're not actively editing a file. Removing that line means you'd not be ignoring a .swp file next time you had one andhg addremove` would cause it to become tracked.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169