fluffgfx / dit Goto Github PK
View Code? Open in Web Editor NEW:file_folder: dotfile management that thinks it's git
Home Page: http://rubygems.org/gems/dit
License: MIT License
:file_folder: dotfile management that thinks it's git
Home Page: http://rubygems.org/gems/dit
License: MIT License
In addition to dotfiles themselves it's common to have folders that contain dotfile-like files. For example I have a .hammerspoon
directory with has lua files in it that I'd like to sync. Maybe .vim
too?
This almost works right now except it doesn't auto-create those directories so the symlink creation fails because it's trying to create the link in a folder that doesn't exist.
What do you think about making the following addition?
def self.symlink_list(list)
list.each do |f|
f.strip!
wd_f = File.absolute_path f
home_f = File.absolute_path(f).gsub(Dir.getwd, Dir.home)
+ home_dir_f = File.dirname(home_f)
+ FileUtils.mkdir_p(home_dir_f)
symlink wd_f, home_f
end
end
Alternatively, maybe it should symlink the folder itself? In that case you'd have to change how you get the file list using git ls-tree
.
I like this project a whole lot better than Dotbot, and have already switched to it. However, there is one thing I miss from Dotbot, and that is the cleanup of dead links. Before Dotbot starts it's symlinking, it removes all dead links and then checks all the existing links before it makes new symlinks for the dotfiles.
In other words, whereas the result from Dotbot's process is a correct set of symlinks for all dotfiles, the result from Dit's process could be dead links for files that used to exist but doesn't anymore, and a lot of "Failed to symlink" errors.
This is annoying and possibly a huge problem if you (like me) have sets of interdependent dotfiles for eg. zsh, vim or even tmux.
Hi,
I saw your project on onethingwell and now I'm wondering whether I correctly understand what it's supposed to do.
When you say "dotfile", you mean files like .bashrc .bash_aliases, .gdbinit in my home folder, right?
So I would put these files in a git repository somewhere, say ~/my_repos/my_dotfiles/ and then symlink to that. Instead of doing that manually, your project adjusts the links correctly when I pull new files I edited elsewhere?
Another question regarding the setup: where does dit init
need to be executed? I suppose in the new repo location because the home folder is easier to find.
So basically, it would then be
mkdir ~/my_repos/my_dotfiles/
cd ~/my_repos/my_dotfiles/
dit init
Can you comment on that?
Kind regards,
Matthias
I'm sure they shouldn't act differently, and I doubt whether just typing kommit
should even work anymore. Perhaps give a little deprecation notice for a few versions and then stop working completely...?
tom > ~/dev/schooling > brew install kommit master
==> Downloading https://homebrew.bintray.com/bottles/kommit-1.1.0.el_capitan.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/kommit-1.1.0.el_capitan.bottle.tar.gz
==> Pouring kommit-1.1.0.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/kommit/1.1.0: 4 files, 11.2K
tom > ~/dev/schooling > kommit master
Invalid usage...
usage: kommit [-m <msg> | -c | -e | -s | -i | -r | -h]
-m <msg> append message
-c check if hook installed ?
-e edit messages
-s show current message(s)
-i install kommit hook to .git/hooks/prepare-commit-msg
-r remove kommit hook, delete .git/hooks/prepare-commit-msg
-h print this message
tom > ~/dev/schooling > git kommit master
Alias tip: g kommit
Invalid usage...
usage: git-kommit [-m <msg> | -t <msg> | -c | -e | -s | -i | -r | -h]
-m <msg> append message
-t <msg> append message with timestamp
-c check if hook installed ?
-e edit messages
-s show current message(s)
-i install kommit hook to .git/hooks/prepare-commit-msg
-r remove kommit hook, delete .git/hooks/prepare-commit-msg
-h print this message
tom > ~/dev/schooling >
The .gitignore should be ignored, right?
This results in a bunch of Failed to symlink
errors. I have checks in place so it doesn't happen but it's clearly not working according, need to look into.
I'd understand why it'd be complicated and a dumb idea to ignore any files—and I'm totally happy to just remove the symlinked README.md when necessary. Just thought I'd mention it!
Really loving dit! Thanks for making it. 😁
I have some folders in my dotfiles, like .ssh, .tmux, .config and so on. Right now these are ignored, and I have to manually recreate them in $HOME, after which dit works fine. Except of course if there are subdirectories...
Would it be possible to simply create symlinks for the directories as well?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.