Skip to content

Instantly share code, notes, and snippets.

@chungy
Last active August 14, 2017 22:41
Show Gist options
  • Save chungy/195f53bfb9253584e596 to your computer and use it in GitHub Desktop.
Save chungy/195f53bfb9253584e596 to your computer and use it in GitHub Desktop.
#!/bin/sh -
if [ $# -eq 0 ]; then
git_commit_date="$(date -ud "@$(git show -q --format=%ct HEAD)" +%Y-%m-%dT%H:%M:%SZ)"
git_commit_email="$(git show -q --format=%ce HEAD)"
else
git_commit_date="$(date -ud "@$(git show -q --format=%ct "$1")" +%Y-%m-%dT%H:%M:%SZ)"
git_commit_email="$(git show -q --format=%ce "$1")"
fi
printf '%s!%s\n' "$git_commit_date" "$git_commit_email"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment