3 ms·
Branch is ref. Chain of commits is distance between two commits/refs/their first common commit (branch point). If people working on the repo branch off main bra
by mirekrusin 4y ago
Branch is ref. Chain of commits is distance between two commits/refs/their first common commit (branch point). If people working on the repo branch off main branch 99% of time, its meaning is quite straight forward. If they branch of a branch, it's also obvious what it is. As branching point is always defined so is equivalence between those two.
What's the point in arguing about it? It's a bit like arguing if `Line = { a: Point, b: Point }` is a line or two points.
- voxic11 4y agoThere is no need for a "branch point" you can create multiple "branches" that are just references to different points on the same linear sequence of commits.
- yamtaddle 4y agoYou can have branches that are and have always been entirely disconnected from one another, for that matter. With completely different content, but still in the same repository.
- jononor 4y agoQuite rare in practice though. Only case I have had that is gh-pages branch in a GitHub project repository, which contained only generated artifacts (generated by code in master). Which I believe there are better ways to do now. At least with Gitlab one instead uses a "pages" CI job, triggered from master, and the artifact it produces is the contents that will be hosted.
- seba_dos1 4y agopristine-tar branches used for Debian packaging are another common example.
- mirekrusin 4y agoYes, their branching point is initial empty content.
- mirekrusin 4y agoYes, it's basically labeled commit. But when you talk about what it means, you do it in relation to some other labeled commit which will always have common branching point. Edge cases may mean it's empty content (disconnected branches) or commit itself is branching point (you're not behind, just purely ahead) or your branching point is your immediate parent (commit delta itself). It's a DAG with optionally labelled vertices (content is cyclic of course, commit history is acyclic). It's all potato potato.