DEV Community

Discussion on: The "linear git commit history with signing in GitHub-UI"-workaround

Collapse
 
ericherman profile image
Eric Herman • Edited

I too would rather avoid complicated graphs in my git histories. However, I see value in the merge commits as they very clearly show the "two brains" principle, and retain context for sets of commits.

Here is a sample for the Standard for Public Code:

$ git log --pretty=format:'%h %s [%an]' --graph
*   6355a43 Merge pull request #988 from publiccodenet/ignore-bundle-config-dir [Jan Ainali]
|\  
| * 4c6d876 ignore `.bundle/` directory [Eric Herman]
|/  
*   ec97922 Merge pull request #987 from publiccodenet/mdl-0.13-ignore-table [Jan Ainali]
|\  
| * 50a975d Ignore mdl 0.13 table strictness [Eric Herman]
|/  
*   e4e4e18 Merge pull request #984 from publiccodenet/update-roadmap [Eric Herman]
|\  
| * 1fb60f5 Add multiple versions to roadmap [Ainali]
| * f9c4e3d Remove physical checklist from roadmap [Ainali]
| * 1fa252d Remove certification badges from roadmap [Ainali]
|/  
*   101dd8c Merge pull request #982 from publiccodenet/machine-readable-20230919T142903Z [Jan Ainali]
Enter fullscreen mode Exit fullscreen mode

In the above, it can easily be seen that for each contribution one person created a change and another person reviewed and merged it.

Also the logical grouping of sets of commits are retained, as in the case of the 3 roadmap related commits by Ainali.

While not perfectly linear (as long as there is a rebase before merge) the commit history remains easy to understand and remains linear from a git bisect perspective.