JamieMason / JamieMason/Perftacular-Backfill

Format git log as JSON

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
note
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Table 2-1 on http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History lists some of the options that --pretty=format takes.

```
%H Commit hash
%h Abbreviated commit hash
%T Tree hash
%t Abbreviated tree hash
%P Parent hashes
%p Abbreviated parent hashes
%an Author name
%ae Author e-mail
%ad Author date (format respects the --date= option)
%ar Author date, relative
%cn Committer name
%ce Committer email
%cd Committer date
%cr Committer date, relative
%s Subject
```

We can use this to extract git commit history in a JSON parseable format.

```
git log --pretty=format:'{"author date": "%ad","author e-mail": "%ae","author name": "%an","commit hash": "%H","committer date": "%cd","committer email": "%ce","committer name": "%cn","subject": "%s"}'
```

Which outputs eg.

```
{
"author date": "Tue May 7 13:42:17 2013 +0100",
"author e-mail": "me@mine.com",
"author name": "JamieMason",
"commit hash": "b151819d7e19b97b4d05c4c3aeec76a71054a8f2",
"committer date": "Tue May 7 13:42:17 2013 +0100",
"committer email": "me@mine.com",
"committer name": "JamieMason",
"subject": "various docs, notes, discussions"
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the project's history-replay entry point, which is not identified in the issue, and compare its behavior with the shown git log --pretty=format command. Determine where JSON output belongs; done means the replayed commit history can be emitted using the listed fields and parsed as JSON.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.