Skip to content

Instantly share code, notes, and snippets.

@basti1253
Created November 27, 2014 20:29
Show Gist options
  • Save basti1253/fab7bad1868cb1974e26 to your computer and use it in GitHub Desktop.
Save basti1253/fab7bad1868cb1974e26 to your computer and use it in GitHub Desktop.
git - show date list by author
#!/usr/bin/env bash
git log --author="AUTHOR NAME" --pretty=format:"%ad" --date=short | sort | uniq | xargs ./sortDates
#!/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