hound
hound copied to clipboard
Added "none" type VCS for indexing local directories
This addresses #134. Please go easy on me, this is the first Go I've ever written and it may well be the worst you've ever seen. :smiley:
I used the git VCS driver as inspiration and basically cut it done to nothing. I figured this approach was better than special-casing file://
URLs as it a) has one less special case subverting the driver architecture and b) still allows for the scenario wherein a user wants to specify a file://
URL pointing to a git repo.
I am happy to make any changes as you see fit.
:+1:
Strangely, I was just discussing this idea on Friday and proposed a similar solution. That said, I think there are a few high-level things we should reconsider:
- We don't actually gain anything by copying the file contents into the vcs directory. I was thinking maybe we could restructure the vcs driver to return the directory that should be used for reindexing. That way this vcs driver could return the direct path to the local directory.
- By default, it seems like the none-type vcs should not do polling. Since we know the user is likely to be mutating the local directory, we should require the user to request the update with the new push updates mechanism. (Note that there isn't a great way to trigger this right now, but we could fix that).
- I've been trying to think of the right name for this vcs driver. 'none' doesn't properly convey what is going on. local? raw? Maybe it does, thoughts? @jklein
Yeah I agree with the first two comments from @kellegous, and naming wise I sort of like "file" or "local". It doesn't matter a whole lot though since it should be clear from the documentation.
Thanks to everyone who has responded so quickly with useful feedback. @kellegous I agree with your first and second points entirely. I didn't make those changes myself because a) it's not my place to make large changes without consulting you first and b) I wouldn't have been up to the task anyway. :smile:
Regarding naming, "none" is a bit poor. "File" sounds good. "Local" might be a bit misleading as you can have a local git repo.
Hi, do you plan on implementing the changes/features mentioned by @kellegous anytime soon? I would do it myself, but I'm not really familiar with Go. Especially 1. would be really nice.
Hi @danielcb, sorry I didn't respond sooner. I'm not sure if your comments were addressed to me, but if they were: I'm not really up to the task of implementing those changes, which is why I haven't done it. If it was one of the other guys, don't mind me.. :)
Ping?