Skip to content

Commit f42fa47

Browse files
dschogitster
authored andcommitted
technical/shallow: describe why shallow cannot use replace refs
It is tempting to do away with commit_graft altogether (in the long haul), now that grafts are deprecated. However, the shallow feature needs a couple of things that the replace refs cannot fulfill. Let's point that out in the documentation. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8d0d81a commit f42fa47

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Documentation/technical/shallow.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ Each line contains exactly one SHA-1. When read, a commit_graft
1717
will be constructed, which has nr_parent < 0 to make it easier
1818
to discern from user provided grafts.
1919

20+
Note that the shallow feature could not be changed easily to
21+
use replace refs: a commit containing a `mergetag` is not allowed
22+
to be replaced, not even by a root commit. Such a commit can be
23+
made shallow, though. Also, having a `shallow` file explicitly
24+
listing all the commits made shallow makes it a *lot* easier to
25+
do shallow-specific things such as to deepen the history.
26+
2027
Since fsck-objects relies on the library to read the objects,
2128
it honours shallow commits automatically.
2229

0 commit comments

Comments
 (0)