Skip to content
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

[Feature request?] Alternative files with submodules #78

Open
pschmitt opened this issue Jul 29, 2017 · 4 comments
Open

[Feature request?] Alternative files with submodules #78

pschmitt opened this issue Jul 29, 2017 · 4 comments

Comments

@pschmitt
Copy link

Hi,
I've been experimenting with yadm and was wondering whether I've been doing something wrong.

So I have most of my config files in their own repos and as such I added them as submodules.
But this way alternates files are not processed, right? Do I have to add them directly to the yadm repo?

@pschmitt
Copy link
Author

pschmitt commented Jul 29, 2017

So I went ahead and checked. In case someone was wondering the same: YES, you need to have yadm track your files directly for the alt feature to work.
In its current state it walks over all the tracked files, via git ls-files which does not list the files inside submodules.

To effectively list all the files one would need to append to the current list of files the ones obtained via git submodule foreach 'git ls-files | sed "s|^|$path/|"''. Then this should work with submodules. The only remaining catch would be that you'd need to the linked files to the submodules respective .gitignore, otherwise it may be messy when updating your config.

@TheLocehiliosan
Copy link
Member

@pschmitt Yes, your assessment of the current functionality is correct. I will consider including files from submodules for alternate file processing.

@tox2ik
Copy link

tox2ik commented May 21, 2020

@pschmitt Hi, I want alt-files to be supported in sub-modules as well. Your suggestion (git submodule foreach 'git ls-files | sed "s|^|$path/|"'') seems to do the trick. However, given some previous commits in the history, one goal fo the project seems to be bash-only, hence sed is an external tool and should not be used. Be that as it may...

I am having diffuclties understanding your point about .gitignore in submodules. Can you please elaborate on why not-considering submodule-.gitignore would pose problems? In general I don't see the issue.

It could be an issue if one uses "git add ." in the submodule, because the parent yadm project has created new symlinks. TBH, I don't think this is problematic enough to warrant any more complicated handling of submodules' .gitignore. My stance being; when you git add, you should be careful.

Please explain why the .gitignore file in submodules deserves any consideration by yadm.

@github-actions
Copy link

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants