News for hackers. Stuff that matters.
Re:Oh shit, git (2016) by wishinghand on Tuesday May 14, 2019 @01:57AM (#19907100)
What's a DAG?
Re:Oh shit, git (2016) by masklinn on Tuesday May 14, 2019 @02:01AM (#19907126)
Directed Acyclic Graph.

Graph = graph, a structure composed of a set of objects (nodes or vertices) with links between them (edges).

Directed = the edges have an orientation / a direction.

Acyclic = there's no cycle, you can't come back to a node (in a directed graph you have to follow edge direction).

In Git, the commit objects are nodes, the "parent" link(s) is a directed edge, and because commit objects are immutable you can't create a commit which refers to one of its "descendants" and thus the graph is acyclic.

Re:Oh shit, git (2016) by yaseer on Tuesday May 14, 2019 @01:59AM (#19907111)
Re:Oh shit, git (2016) by rich-tea on Tuesday May 14, 2019 @02:32AM (#19907269)
Unfortunately this article, like almost all others, is still wrong because it looks like commits get mutated when you rebase and the old commits disappear.

It is very important to understand that commits (in fact, all blobs) are immutable in git. You can only make new things. You can't modify old things. Git doesn't delete anything for a while either.

Re:Oh shit, git (2016) by kccqzy on Tuesday May 14, 2019 @01:58AM (#19907106)
Directed acyclic graph. Basically each git commit points to zero or more parent commits (usually one, zero for root commits, more than one for merge commits) and that forms a DAG.