You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* wip
* allow printing of commits without parents
* Implement git log
* wip day 2
* Include SHA and use correct set of metadata to print commit messages
* Add documentation for `log`
* Implement gpgsig and remove newline character that is saved into the message
* Add newline before every commit is printed
* Remove redundant repository argument
`git log` will take a commit, and generate a list of commits starting from that commit all the way to the root commit.
4
+
5
+
## Command usage
6
+
-`git log [commit hash]`
7
+
8
+
## Implementation details
9
+
10
+
1. Starting from the given commit, find and parse the commit metadata in ./git/objects
11
+
2. Use the metadata to figure out the commit hash of its parent
12
+
3. Keep repeating this until no parent can be found
13
+
14
+
## An interesting tidbit about PGP signatures
15
+
16
+
When I commit locally, these commits do not have PGP signatures.
17
+
When I pull commits remotely (for example to merge with the main branch), these commits have PGP signatures.
18
+
At what point are PGP signatures added?
19
+
20
+
Turns out that Github signs commits made to the web interface ([source](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)) - all the commits created by merging in feature branches to `main` are signed. Commits that are created locally and pushed to the `main` branch are not signed.
21
+
22
+
## Future work
23
+
-[ ] Make the commit argument optional, by defaulting the commit argument to the HEAD argument.
24
+
-[ ] Pipe the output to programs like `less` for repositories with a large set of commits
0 commit comments