Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use commit author info instead of committer info [CH-1282] #500

Merged
merged 2 commits into from
Jan 17, 2022

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Jan 14, 2022

This updates the log format to yield the author info, which is more correct for merge commits.

@ghengeveld ghengeveld changed the title Use commit author info instead of committer info Use commit author info instead of committer info [CH-1282] Jan 14, 2022
@linear
Copy link

linear bot commented Jan 14, 2022

CH-1282 Record commit author info

Merge commits created by GitHub have committerName: "GitHub" and committerEmail: "noreply@github.com" which is quite useless. These originate from the --format we pass when pulling up commit info in the CLI. For example:

git --no-pager log -n 1 --format="%H ## %ct ## %ce ## %cn"
55df0c1b10d868924362b89f467502d6e47dc641 ## 1639695874 ## noreply@github.com ## GitHub

Compare that to this slightly different format:

git --no-pager log -n 1 --format="%H ## %at ## %ae ## %an"
55df0c1b10d868924362b89f467502d6e47dc641 ## 1639695874 ## john@chromatic.com ## John Hobbs

We could either change our format to use %at %ae and %an, or extend the format to include these as separate fields and record them separately as authoredAt, authorName and authorEmail. In that case we could use and parse this format:

git --no-pager log -n 1 --format="%H %at%n%cn <%ce>%n%an <%ae>"
55df0c1b10d868924362b89f467502d6e47dc641 1639695874
GitHub <noreply@github.com>
John Hobbs <john@chromatic.com>

@ghengeveld ghengeveld requested a review from tmeasday January 14, 2022 13:20
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghengeveld ghengeveld merged commit af84e6c into main Jan 17, 2022
@ghengeveld ghengeveld deleted the author-info branch January 17, 2022 21:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants