Hacker News new | ask | show | jobs
by WorldMaker 131 days ago
> The answer seems pretty obvious. Git just needs 2 separate mechanisms for these 2 different ideas. The obvious approach would be to leave commits as being atomic units of code change, and invent a new concept in git which represents a feature / feature branch. It would essentially just be a metadata object naming a set of commits, and it would have links to an issue tracker, CI results and code reviews.

git already has a tool for this called a "merge commit". A merge commit is mostly just a metadata object pointing to multiple previous commits. Sure, this forms a DAG rather than a line, but when all you want to see is a line just walk the graph in a specific pattern. In git that graph walking pattern is usually called `--first-parent`.

Mostly we just need UIs that stop trying to draw a "subway diagram" at all times and just does a `--first-parent` overview. It's strange to me how much work is being put into squashes and rebases and more just to avoid complicated "subway diagrams" when that often would be just fine with merge commits and adding `--first-parent` to your git log defaults and/or pick a UI tool that does that for you.