-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get commit author date, rather than committer date #1542
Comments
@garyking To get the author's information or the committer's information, simply use As to your issue about amending, how would you get the original, pre-amended commit's date information from the CLI |
Thanks, that method worked. I can't find the method in the docs though. And, I mean the original creation date of the commit. That's the "author date" I assume. While the "committer date" is basically the last time the commit was touched. |
Pedantically speaking, "the last time the commit was touched" and "the original creation date of the commit" are the same, as a touched commit is an entirely new commit. The idea carries semantic value though, and you are exactly correct in that author date is meant to provide that information. When a commit is rebased or otherwise recreated, the new commit takes the "source" commit's author info as its own. In the case of a new from scratch commit, that's the same as the commiter info, obviously. Amend may be a bit different, since it's intent may be to make bigger changes, but I don't actually know. I'd assume it's the same way, since it's semantic intent is still to "change" a commit, rather than create a new commit, regardless of what actually happens under the covers I'll make an issue in the docs repo that author info is seemingly missing. |
When I amend a commit, its date in the
.date()
method gets updated. Please give us an option to also retrieve the original, author date for a commit, too.It seems like
git log
actually defaults to showing the author date too, rather than the committer date.The text was updated successfully, but these errors were encountered: