-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agnostic #115
Agnostic #115
Conversation
One major caveat is that I'd rather not recursively search folders for .config. If we can figure out a clean way to do so, I'd be all for it, but currently it expects to be used from the root of the tracked folder. |
I don't think recursing up the directory tree is much of a problem -- even an incredibly deep directory structure will be less than dozens of directories. I'm going to try this out. |
Cool. Also, I should note that I don't have ronn, and so didn't regen the updated man page. |
On 03/06/2014 11:20 PM, Andrew Schwartzmeyer wrote:
I tried out the changes and they clearly work in the normal scenarios. Also, I modified the code to look up the directory tree for the config file. I then set up a 30 level deep directory structure and ran vcsh with and Climbing the tree appears to add roughly 0.01 seconds per invocation on Test Case I have a ronn-capable system around so I regenerated the man page. I will create another pull request for these changes. Note that they Dewey |
Merging in recursive search for configuration file.
Using this function to recurse up the directory tree looking for the configuration file. Renamed to test_dir_upwards() because the function is just testing with [ $1 $2 ]. Switched to $(execute) from `execute` as the latter is preferred. Tested, this works well.
There's just one issue left with recursion: since we stop at |
@dmsasser Nice work by the way :) |
Thanks On March 13, 2014 2:04:50 AM EDT, Andrew Schwartzmeyer [email protected] wrote:
Dewey |
What can I do to help make this ready for merge? |
Likewise! I think these are good improvements. They've been roughly tested too. Should we even worry about parsing |
Hi, at the moment, you can't do much as it hinges on me :( I am horribly behind on my FLOSS fronts due to real life and thus didn't have time to really review, yet ... I had hoped to do this over the weekend, but... Anyway, I will try to review in the coming days. Sorry & thanks, |
@RichiH Any chance you'll have us on the docket soon? |
Bump :) |
PS: @andschwa If you could rebase on current master, that would be appreciated. If not, that's fine, too. |
Notes to self:
Else, it looks good for inclusion and we still have 24 hours :p I put everything into https://github.com/RichiH/vcsh/tree/feature/agnostic to have a well-defined place to work on. Anyone submitting patches, please do it there. PS: I may force-push that branch to get rid of |
Wouldn't it be better to use |
As per #115 (comment) : Is where a good name? Maybe use base instead? Rationale being that base is already used internally in $VCSH_BASE.
I think the correct answer might involve repo-specific configurations; which are now in master. |
I think the central question is whether those repos should be central, i.e. in $HOME, or decentral, i.e. stored in the other bases. Central repos allow for one common namespace (thus avoiding confusion). Decentral ones allow you to, e.g., put things onto a USB thumb drive. A third option is to default to central, but to allow decentral ones as an option. That would need |
Aw man! Deadline passed yesterday, and I'm just getting back to you, my bad :/ It's been a while since I looked at this code, but IIRC correctly, what I didn't like was that with this feature, we started treating ~ as a special case, whereas really, if this is done correctly, any vcsh conf in ~ would be read by the recursive search (and if you're in ~, it would just look once). I think we should take the ideas and work here and refactor the vcsh core to use it, rather than thinking of folder agnosticism as a separate feature from version control system for ~. Heck, it'd become vcsa (version control system for anywhere). I would definitely advocate for decentralized repos across the board. Perhaps rather than storing all our stuff in |
@RichiH What are your thoughts on decentralizing the whole thing? In the end I think it would come out much neater. |
Anyone still working on this? I would love to be able to track /etc files! |
@bertenvdb IIRC it's working, just not merged, give it a try and let me know! |
Edit: It seems my poor understanding of git(hub) was the problem . Now I'm using version 1.20141025 and so far everything works as expected. Great work, |
@bertenvdb were you able to apply this patch and use the agnostic features? Just curious. |
If ya'll want to take this ever, feel free, but I am clearly never getting back to it 🤣 |
I'm re-opening this PR as #283 because I think the work deserves further review. At least until we decide on some resolution to #110 (whether that is rejecting the feature or implementing something) this seems like at least one reasonable approach. @andschwa no worries at all if you aren't interested in being involved in that process, feel free to unsubscribe from notifications to this PR and anything else that generates noise in your notifications. |
It'd be awesome if it ever gets merged, good luck @alerque! |
As per PR #114, this adds the
vcsh setup
andvcsh where
commands, with necessary documentation. It also enables the sourcing of./.config/vcsh/config
, whichvcsh setup
will automatically create with the$VCSH_BASE
and$XDG_CONFIG_HOME
variables set to$(pwd)
and$(pwd)/.config
respectively, thus enable "agnostic" use ofvcsh
from the folders with the a./.config/vcsh/config
file.It's a work in progress, and probably needs more testing, but I think it's a good way to go about doing this.