Created
November 27, 2014 20:29
-
-
Save basti1253/fab7bad1868cb1974e26 to your computer and use it in GitHub Desktop.
git - show date list by author
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git log --author="AUTHOR NAME" --pretty=format:"%ad" --date=short | sort | uniq | xargs ./sortDates | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$dates = ! empty($argv) && is_array($argv) ? $argv : []; | |
array_shift($dates); | |
foreach($dates as & $date ) { | |
$date = new \Datetime($date); | |
} | |
unset( $date ); | |
reset( $dates ); | |
usort( $dates, function($a, $b) { | |
return ($a < $b) ? -1 : 1; | |
}); | |
foreach($dates as $date ) { | |
echo $date->format("d.m.Y"), "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment