You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a few external git repositories added as submodules in my dotfiles (for example, https://github.com/tmux-plugins/tpm). This generally works acceptably well, except when it doesn't 😉 The issue I'm running up against right now is that there are many shell scripts in that repo that are all committed as executable. The submodule gets added to my source directory just fine, but when chezmoi apply processes them, the executable bit of course gets lost (since chezmoi uses the executable_ attr instead). Not only that, but at least one of the scripts is called run_tests, which gets interpreted as a script to be run at apply time.
What have you tried so far?
In this case, I can fix the run_tests issue by just adding that file to .chezmoiignore, but the executable bits issue is much more complicated. I could use my own run_after_ script to fix up the exec bit, but then future calls to chezmoi apply complain (correctly) that the files have been modified since the last time they were written by apply.
Additional context
Am I going about this completely the wrong way? Would it be better to manage these modules completely outside of chezmoi? I guess I could probably put together a run_after_ script that does the cloning, but git submodule add feels easier. On the other hand, I suppose (without having investigated at all) that chezmoi might not even know that a given file is in a submodule, so maybe it couldn't treat it differently even if that seemed like a good idea. What do you think?
The text was updated successfully, but these errors were encountered:
I woke up this morning and had a bit of an epiphany: I am going about this the wrong way. Logically these external packages aren't really "submodules" at all. I replaced them with a simple run_once_after_ script that does a git clone and things are working much better now. Also, I had another look through the already-filed issues and it looks like this might tie into #662 as well.
What exactly are you trying to do?
I've got a few external git repositories added as submodules in my dotfiles (for example, https://github.com/tmux-plugins/tpm). This generally works acceptably well, except when it doesn't 😉 The issue I'm running up against right now is that there are many shell scripts in that repo that are all committed as executable. The submodule gets added to my source directory just fine, but when
chezmoi apply
processes them, the executable bit of course gets lost (since chezmoi uses theexecutable_
attr instead). Not only that, but at least one of the scripts is calledrun_tests
, which gets interpreted as a script to be run at apply time.What have you tried so far?
In this case, I can fix the
run_tests
issue by just adding that file to.chezmoiignore
, but the executable bits issue is much more complicated. I could use my ownrun_after_
script to fix up the exec bit, but then future calls tochezmoi apply
complain (correctly) that the files have been modified since the last time they were written byapply
.Additional context
Am I going about this completely the wrong way? Would it be better to manage these modules completely outside of
chezmoi
? I guess I could probably put together arun_after_
script that does the cloning, butgit submodule add
feels easier. On the other hand, I suppose (without having investigated at all) thatchezmoi
might not even know that a given file is in a submodule, so maybe it couldn't treat it differently even if that seemed like a good idea. What do you think?The text was updated successfully, but these errors were encountered: