Skip to content
  • Johannes Schindelin's avatar
    Add "--expire <time>" option to 'git prune' · f01913e4
    Johannes Schindelin authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Earlier, 'git prune' would prune all loose unreachable objects.
    This could be quite dangerous, as the objects could be used in
    an ongoing operation.
    
    This patch adds a mode to expire only loose, unreachable objects
    which are older than a certain time.  For example, by
    
    	git prune --expire 14.days
    
    you can prune only those objects which are loose, unreachable
    and older than 14 days (and thus probably outdated).
    
    The implementation uses st.st_mtime rather than st.st_ctime,
    because it can be tested better, using 'touch -d <time>' (and
    omitting the test when the platform does not support that
    command line switch).
    
    Signed-off-by: default avatarJohannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    f01913e4