[pass] list of passwords with its age

Simon Lackerbauer simon at lackerbauer.com
Fri May 20 11:57:15 CEST 2016


Why not use something independent of git, like

ls | while read filename
do
  echo -n "${filename}: "; expr $(expr $(date +%s) - $(date +%s -r
$filename)) / 86400
done

cheers,
Simon

On 05/20/2016 11:46 AM, Evgenii Sovetkin wrote:
> On 2016-05-20 11:33 AM, Grégoire Détrez wrote:
>> On Fri, May 20, 2016 at 10:45:46AM +0200, Evgenii Sovetkin wrote:
>>> I want to obtain a sorted list of my passwords together with its age
>>> (number of days since the last change).
>>>
>>> With git it seems the following loop will do part of the job:
>>>
>>> git ls-tree -r --name-only HEAD | while read filename
>>> do
>>>     echo "$(git log -1 --format="%ad" --date=relative -- $filename) $filename"
>>> done
>>>
>>> Unfortunately, if I rename a password (or even rerun git init) then it
>>> would seem that I have changed the passwords, though I have not...
>>>
>>> Is there a neater solution one have in mind? Is there a way in git to
>>> show time passed from the *significant* content change, not simply the
>>> latest commit?
>>
>> You could use use git-blame to get the last commit that changed the
>> first line of each file, something like:
>>
>>     git blame -L 1,1 $filename --porcelain | sed -n 's/^committer-time //p'
>>
>>
>>> 
> Thanks for the suggestion! It solves the problem with the renamed
> passwords, but it doesn't really work, with the reencrypted passwords
> (I rerun git-init recently).
> 
> One could avoid renamed files with git-log by using --follow
> parameter. Git-log would also deal with multiline passwords.
> 
> 
> 
> _______________________________________________
> Password-Store mailing list
> Password-Store at lists.zx2c4.com
> http://lists.zx2c4.com/mailman/listinfo/password-store
> 

-- 
www.lackerbauer.com
B0CB 1DB6 C2E5 8167 4CB4  2136 564A DEDA 01BD 6EFA


More information about the Password-Store mailing list