Comment 4 for bug 1096491

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Hi Tamas,

I just tried to reproduce what you mentioned in Ubuntu Kinetic (22.10) and I got the same results as you did. After going through etckeeper manpage, I see this is the expected behavior:

       unclean
              This returns true if the directory contains uncommitted changes.

In short, if you have uncommited changes it returns true (0) and if there is no uncommited change it returns false (returned 1 during my test):

root@etckeeper-test:/etc# git status
On branch master
nothing to commit, working tree clean
root@etckeeper-test:/etc# touch a
root@etckeeper-test:/etc# git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
 a

nothing added to commit but untracked files present (use "git add" to track)
root@etckeeper-test:/etc# etckeeper unclean
root@etckeeper-test:/etc# echo $?
0
root@etckeeper-test:/etc# rm a
root@etckeeper-test:/etc# git status
On branch master
nothing to commit, working tree clean
root@etckeeper-test:/etc# etckeeper unclean
root@etckeeper-test:/etc# echo $?
1

So I believe this is not a bug at all but expected behavior. Therefore, marking this bug as Invalid.