Skip to content

Commit

Permalink
%Z returns the modified date, %Y returns the changed date
Browse files Browse the repository at this point in the history
The OSX version of stat uses %m to return the 'modified' date since
epoch. The GNU version of stat doesn't have the %m format code.

%Z which was being used in @hallzy's fix returns the 'changed' date
since epoch, which only changes when you modify the metadata on a file.
This meant that when we `touch $dot_git/.lastupdatetime` the 'changed'
date doesn't change.

I've switched to the %Y flag which returns the 'modified' time. This is
the time that is changed when `touch` modifies the file.
  • Loading branch information
michaeldfallen committed Oct 16, 2015
1 parent 3aec962 commit 532d760
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion radar-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ record_timestamp() {

timestamp() {
if is_repo; then
printf '%s' "$($(stat_type) -c%Z "$(dot_git)/lastupdatetime" 2>/dev/null || printf '%s' "0")"
printf '%s' "$($(stat_type) -c%Y "$(dot_git)/lastupdatetime" 2>/dev/null || printf '%s' "0")"
fi
}

Expand Down

0 comments on commit 532d760

Please sign in to comment.