Skip to content
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
This repository was archived by the owner on Dec 2, 2026. It is now read-only.

Get commit author date, rather than committer date #1542

Closed

Description

@garyking

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.

Activity

  1. rcjsuen commented on Aug 29, 2018

    @rcjsuen
    Member

    @garyking To get the author's information or the committer's information, simply use commit.author().when() or commit.committer().when().

    As to your issue about amending, how would you get the original, pre-amended commit's date information from the CLI git?

  2. garyking commented on Aug 29, 2018

    @garyking
    Author

    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.

  3. maxkorp commented on Aug 29, 2018

    @maxkorp
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions