Documentation/git-update-ref.txt: remove safety paragraphs
Remove paragraphs which explain that using this command is safer than echoing the branch name into `HEAD`. Evoking the echo strategy is wrong now under the reftable backend since this file does not exist. And the ref file backend majority user base use porcelain commands to manage `HEAD` unless they are intentionally poking at the implementation. Maybe this warning was relevant for the usage patterns when it was added[1] but now it just takes up space. † 1: 129056370ab (Add missing documentation., 2005-10-04) Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Kristoffer Haugsbakk committed
Oct 21, 2024 at 22:47 UTC
744c282cd4f92a6c9942131189f2dc722e3a1a2a
1 file changed
-15
Documentation/git-update-ref.txt
-15
@@ -40,21 +40,6 @@ somewhere else with a regular filename).
40
If --no-deref is given, <ref> itself is overwritten, rather than
41
the result of following the symbolic pointers.
42
43
-In general, using
44
-
45
- git update-ref HEAD "$head"
46
-
47
-should be a _lot_ safer than doing
48
-
49
- echo "$head" > "$GIT_DIR/HEAD"
50
-
51
-both from a symlink following standpoint *and* an error checking
52
-standpoint. The "refs/" rule for symlinks means that symlinks
53
-that point to "outside" the tree are safe: they'll be followed
54
-for reading but not for writing (so we'll never write through a
55
-ref symlink to some other tree, if you have copied a whole
56
-archive by creating a symlink tree).
57
-
43
With `-d`, it deletes the named <ref> after verifying that it
44
still contains <old-oid>.
45