Sublime-Executor
Sublime-Executor copied to clipboard
Use Git-native gitignore handling
Closes #1
This PR makes some changes to how executables are discovered:
- all workspace folders get processed one after the other. For each folder:
- if
gitexecutable is in$PATHAND if the current folder is [in] a repo:- use
git ls-filesto find all executables inside the repo
- use
- if current folder is not in a Git repo or there is no
git- use
os.walkand check every file for executability - directories named
.gitare always ignored
- use
- if
This adds some breaking changes, namely:
- if Git is not available,
.gitignoreis not taken into account any more- I believe this makes sense, as you wouldn't really work with a Git-powered repo without Git available
- the methods counting the executables are generator functions (may speed things up)
TODO:
- [x] update docs
It is absolutely possible to work with git without having git installed. Some GUI clients ship with their own version of git that isn’t exposed. Git might not be on a PATH from Sublime env but on a PATH with interactive REPL.
We might want to find untracked files too (user created a file but didn’t make a commit yet)
We can use git if present (with the change for untracked files) and fall back to current impl if not found.