Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CopyCommitReference: use authorTime of commits
As per documentation of 'git log': reference <abbrev-hash> (<title-line>, <short-author-date>) This format is used to refer to another commit in a commit message and is the same as --pretty='format:%C(auto)%h (%s, %ad)'. By default, the date is formatted with --date=short unless another --date option is explicitly specified. As with any format: with format placeholders, its output is not affected by other options like --decorate and --walk-reflogs. the format 'reference' specifically shows the "author date" of a commit, as opposed to "commit date".[1] By default 'git log' shows the author date, and that's why 'reference' format uses the author date as well. Function `commitReference` in CopyCommitReference.kt uses method getTimestamp of interface com.intellij.vcs.log.graph.GraphCommit via intrerface com.intellij.vcs.log.VcsCommitMetadata. All implementations of this interface use commit date for the timestamp, which means that the plugin can produce misleading dates in the references. Use method `getAuthorTime` of com.intellij.vcs.log.VcsShortCommitDetails to include the correct date in the references produced by the plugin. [1] These dates can be different, for example, if a commit is cherry-picked a week after it had been authored, i.e. created.
- Loading branch information