Skip to content
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

More efficient/reliable git blame... #6

Open
phallstrom opened this issue Apr 6, 2018 · 0 comments
Open

More efficient/reliable git blame... #6

phallstrom opened this issue Apr 6, 2018 · 0 comments

Comments

@phallstrom
Copy link
Contributor

cp.exec(`git blame --show-email HEAD~1 -- ${file}`, (error, stdout, stderr) => {

This should be more reliable and require less parsing.

  git blame --line-porcelain --follow -w HEAD~1 -- $1 2> /dev/null |\
    grep '^author-mail' |\
    sed 's/^author-mail <\(.*\)>.*/\1/' |\
    sort |\
    uniq -c |\

It outputs repeated blocks of text like this:

author Charley Smith
author-mail <[email protected]>
author-time 1455249233
author-tz -0700
committer Charley Smith
committer-mail <[email protected]>
committer-time 1455311326
committer-tz +0000
summary doc: xxxxxxxx
previous xxxxxxxx README.md
filename README.md
        # Quickstart to xxxxxx
xxxxxx 2 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant