There are a number of git commands, such as git clone --depth 10 <repo>, that require the number of revisions [git help revisions] to be given.
What is the distinction between a commit and a revision (in git, rather than say svn)?
Or does it only show up in the plural when trying to count revisions/commits, e.g. that revisons must be counted by walking the DAG (directed acyclic graph) of commits and their parents, or some other careful distinction?
See “SPECIFYING REVISIONS” of git rev-parse:
So “revision” refers to the id you can use as a parameter to reference an object in git (usually a commit).
HEAD@{5 minutes ago}is a revision which reference the commit present 5 minutes ago.gitrevisionmentions:For instance, the following rev parameter doesn’t reference a commit:
A “commit” in Git generally designates a “commit object” (as described in
git commit-treefor instance):So:
In your case (
git clone)--depth <n>does:It is for all the commits accessible at that depth, up to
nrevisions per path in the DAG.Since the result can be more than
ncommits, the term revision is more adapted here in order to emphasize you don’t want justncommits, but any commits referenced by a max ofnrevisions accessible.However, in this context, revisions clearly reference only commits (as illustrated below) reachable (as you mentioned in “Is
git clone --depth 1(shallow clone) more useful than it makes out?“).The question is “reachable from what”?
You referenced this thread which included: