Skip to content

Determine root of project by looking for .git (or others) #11

@rosstimson

Description

@rosstimson

I recently needed to add encoding comments in a project and remembered that I'd installed this gem. I tried running magic_encoding -h in ~/code and every ruby file in many different projects ended up with # -*- encoding : -h -*- prepended to the file. This has made a huge mess especially trying to work out if git status is showing me files that include changes I was working on or just file with this line added.

Obviously I can fix this but it was pretty annoying and could be a common mistake. I have seen other projects that try and detect the root of a project by looking for the directory that has .git/ (or other VCS files) rather than just recursively going through everything, perhaps this could be implement here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions