Replies: 2 comments 5 replies
|
|
4 replies
|
For the "is this tracked already" part, cza() {
local managed; managed=$(chezmoi managed --path-style=absolute)
for f in "$@"; do
f=$(readlink -f "$f")
if grep -qxF "$f" <<<"$managed"; then
chezmoi diff "$f"
read -rp "re-add $f? [y/N] " a && [[ $a == [yY] ]] && chezmoi re-add "$f"
else
chezmoi add "$f"
fi
done
}Templates are out of scope for both on purpose. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm coming from the symlink-managed dotfile managers, and the issue I have with chezmoi is not having clear understanding of which files are already managed. Oftentimes come across a file I can't recall having already tracked, so run
chezmoi add <file>on it, which simply re-adds inbetween modifications to the file.Could there be an option for
addor perhaps a new command likeadd-or-promptthat adds a non-tracked file, and prompts whether changes for already-tracked file should be updated in the chezmoi git index?All reactions