todo/Truly-quiet when there's nothing to commitetckeeperhttp://etckeeper.branchable.com/todo/Truly-quiet_when_there__39__s_nothing_to_commit/etckeeperikiwiki2021-10-17T13:52:28Zcomment 1http://etckeeper.branchable.com/todo/Truly-quiet_when_there__39__s_nothing_to_commit/comment_1_22aeb26fb522fb0806a2791970369080/joey2021-10-17T13:52:28Z2017-06-28T16:33:30Z
<p>That patch makes etckeeper only commit changes that have been
staged (eg added with <code>git add</code>). If a file has been changed,
but not staged, <code>git diff --cached</code> will ignore the change,
and it won't get committed. So the patch is broken.</p>
<p>On debian, a daily cron job uses <code>etckeeper unclean</code> to determine if there
are any changes in need of committing. That works with every VCS that
etckeeper supports, and my suggestion is that netbsd use the same
mechanism.</p>
comment 2http://etckeeper.branchable.com/todo/Truly-quiet_when_there__39__s_nothing_to_commit/comment_2_21482b7d984aabd310c09539f1dc8f0b/truist2021-10-17T13:52:28Z2017-06-29T16:17:33Z
Wow - I'm not sure how I missed that behavior. Sorry about that. And yes, it sounds like <code>etckeeper unclean</code> is a much better option.
comment 3http://etckeeper.branchable.com/todo/Truly-quiet_when_there__39__s_nothing_to_commit/comment_3_d88dfbf82994d484a50a8fb751fc4c83/truist2021-10-17T13:52:28Z2017-06-29T16:30:56Z
<p>I see why I used <code>--cached</code> - because <code>30git-add</code> runs before this script, so the files to be added are always already cached by the time this script runs. Doing the diff without <code>--cached</code> wouldn't work.</p>
<p>However, your solution is still better, in case users have customized the scripts.</p>