thoughtbot / rcm

rc file (dotfile) management
https://thoughtbot.github.io/rcm/rcm.7.html
BSD 3-Clause "New" or "Revised" License
3.12k stars 136 forks source link

Allow dotfiles from different directories to be merged #166

Closed geoffharcourt closed 8 years ago

geoffharcourt commented 8 years ago

We have some files in our dotfiles that don't have the capability to source local versions, so you either need to pick the group version or override it with your personal version. (Examples of this in https://github.com/thoughtbot/dotfiles would be .ctags and .agignore. I've been unsuccessful convincing ag's maintainer to allow sourcing of a second .agignore, but since I've already found two common examples in our dotfiles this seems to be a common problem.

One way to pull these preferences together would be to concatenate the contents of the files from multiple directories and then to write the aggregated file to the correct location.

mike-burns commented 8 years ago

Interesting idea. We could only support using cat(1) to merge them for now, unless you want to get fancy.

This means that the resulting file will not be a symlink? How will changes propagate? How will this file be maintained? How should rcdn(1) handle this file?

I think you'll want to look in rcup.in's handle_file function when you start your patch.

geoffharcourt commented 8 years ago

I think the file would have to be not a symlink, and would have to be rewritten every time rcup(1) was run. At the moment I have no idea how we would handle this with rcdn(1).

Thanks for the direction. The problem this idea solves has been somewhat frustrating lately with respect to ctags and the_silver_searcher config.

geoffharcourt commented 8 years ago

I've been thinking more about how to implement this. The most compelling current case is to merge ctags files from different dotfiles repositories. At the moment, you're stuck with your own or the team's ctags configuration.

infokiller commented 8 years ago

The same problem exists with i3, and there's probably other programs. It would be great to have this feature implemented even in a basic experimental version using cat and overwriting the files. Later it can be improved.

infokiller commented 8 years ago

@geoffharcourt is this feature now supported?

geoffharcourt commented 8 years ago

@infokiller, no. I don't anticipate having time in the medium-term to write a PR to implement this functionality, and did not want to leave a dangling issue open, as there doesn't seem to be a widely-felt need to have this feature. If you do want to tackle this, please re-open with a PR. (I would gladly use it!)