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
Is your feature request related to a problem? Please describe.
I use .gitignore to ignore everything in my home except for a few config paths. Combined with showUntrackedFiles, this reminds me of untracked new config files that I should add to the repo, and I can simply do yadm add . to stage all of them.
However, the files symlinked from alternatives / generated by templates via yadm alt often shows up as untracked as well, since they are often exempt by .gitignore as other regular files in the same directory. Obviously I do not want to commit those into the repo, hence I can't simply yadm add . anymore since it will add those generated files as well.
Describe the solution you'd like
I believe it is more natural to ignore the symlinked files by default when yadm add, or auto-generates a ignore list when yadm alt is run.
Describe alternatives you've considered
My solution to this is to add a pre_add hook, which ignores the generated files by adding it to a custom .altignore file:
#!/bin/bash# pre_add: ignore symlinked alternative filesecho"### This file is auto-generated by \`$0\`" \
>"$YADM_HOOK_WORK/.altignore"
git ls-files \
| grep '##' \
| sed 's/##.*$//g'\
| sed 's|^\.config/yadm/alt/||' \
| sort | uniq \
>>"$YADM_HOOK_WORK/.altignore"
git config --local core.excludesfile "$YADM_HOOK_WORK/.altignore"
However, I believe this behavior should be default and can be built into yadm alt nicely.
P. S. I found that there is already an auto-exclude feature for encrypted files; we could simply adapt this to also exclude generated files.
bryango
changed the title
Ignore files symlinked from alternatives / generated by templates
[Feature] Ignore files symlinked from alt / generated by templates
Jul 1, 2020
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.
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.
Is your feature request related to a problem? Please describe.
I use
.gitignore
to ignore everything in my home except for a few config paths. Combined withshowUntrackedFiles
, this reminds me of untracked new config files that I should add to the repo, and I can simply doyadm add .
to stage all of them.However, the files symlinked from alternatives / generated by templates via
yadm alt
often shows up as untracked as well, since they are often exempt by.gitignore
as other regular files in the same directory. Obviously I do not want to commit those into the repo, hence I can't simplyyadm add .
anymore since it will add those generated files as well.Describe the solution you'd like
I believe it is more natural to ignore the symlinked files by default when
yadm add
, or auto-generates a ignore list whenyadm alt
is run.Describe alternatives you've considered
My solution to this is to add a
pre_add
hook, which ignores the generated files by adding it to a custom.altignore
file:However, I believe this behavior should be default and can be built into
yadm alt
nicely.P. S. I found that there is already an auto-exclude feature for encrypted files; we could simply adapt this to also exclude generated files.
https://github.com/TheLocehiliosan/yadm/blob/dd86c8a691deed7fb438b7ef07179040b0f05026/yadm#L1258-L1270
The text was updated successfully, but these errors were encountered: