File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ if [[ "${CONTINUE_FROM_DOTFILES:-false}" == false ]]; then
2929 if chezmoi --version & > /dev/null; then
3030 log_task " Updating dotfiles"
3131
32+ dotfiles_old_hash=" $( chezmoi git -- rev-parse HEAD 2> /dev/null || true) "
33+
3234 if chezmoi git -- status --porcelain | grep -q . ; then
3335 log_manual_action " Skipping chezmoi update as uncommitted changes were found"
3436 elif
@@ -43,6 +45,20 @@ if [[ "${CONTINUE_FROM_DOTFILES:-false}" == false ]]; then
4345 c chezmoi update --apply=false
4446 fi
4547
48+ dotfiles_new_hash=" $( chezmoi git -- rev-parse HEAD 2> /dev/null || true) "
49+ if [[ -n " ${dotfiles_old_hash} " && " ${dotfiles_old_hash} " != " ${dotfiles_new_hash} " ]]; then
50+ log_green " 📢 What's new?"
51+ echo >&2
52+ PAGER=" cat" chezmoi git -- log \
53+ --oneline \
54+ --no-decorate \
55+ --color=always \
56+ --format=" %C(yellow)%h%Creset %C(bold white)%s%Creset %C(dim)(%cr)%Creset" \
57+ " ${dotfiles_old_hash} ..${dotfiles_new_hash} " >&2
58+ echo >&2
59+ fi
60+ unset dotfiles_old_hash dotfiles_new_hash
61+
4662 # Apply changes to chezmoi config
4763 c chezmoi init --force
4864 # Apply the rest
You can’t perform that action at this time.
0 commit comments