git-ftp
git-ftp copied to clipboard
Replace ignore glob paths with gitignore mechanics
Enhancement
Hey there, first of all thank you all for your work in this project.
Skimming your code in filter_ignore_files() I wondered if instead of grepping you could use git to list files that would be ignored using .git-ftp-ignore .
Consider the following command, this prints out all the files that git would ignore following the rules in .git-ftp-ignore
git ls-files --ignored --cached --exclude-from='.git-ftp-ignore'
I'm not a bash expert, nor git to be honest, but wouldn't it be more convenient to use git to do the ignore path logics and just filter out duplicates with the full list of files with something like uniq?
Just throwing ideas around, I'm really not an expert in bashisms and the like.
I got a bit baffled that my .git-ftp-ignore was ineffective until I RTM and found glob paths are used. Also not able to revert negated paths is quite inconvenient!
Thank you for your time, if the above it's not clear or if I can help with something let me know!
Updated with --cached to comply with https://github.com/git/git/commit/b338e9f668737e08201c990450b8c3d744f63162.
HeyHo, thanks for this suggestion.
It sounds 100& logically to me and I wonder why we didn’t thought about this. I’ll do some testing on this topic as soon as I get some some free time.
Thanks again :)