]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Documentation/git-update-ref.txt: remove safety paragraphs
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Mon, 21 Oct 2024 20:47:25 +0000 (22:47 +0200)
committerTaylor Blau <me@ttaylorr.com>
Mon, 21 Oct 2024 20:49:31 +0000 (16:49 -0400)
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>
Documentation/git-update-ref.txt

index a2bee2ea24a74e1e19b49b9010570e8db3d3dd84..1a0aec041ea972270fe1cdd6674e598b3e5926fa 100644 (file)
@@ -40,21 +40,6 @@ somewhere else with a regular filename).
 If --no-deref is given, <ref> itself is overwritten, rather than
 the result of following the symbolic pointers.
 
-In general, using
-
-       git update-ref HEAD "$head"
-
-should be a _lot_ safer than doing
-
-       echo "$head" > "$GIT_DIR/HEAD"
-
-both from a symlink following standpoint *and* an error checking
-standpoint.  The "refs/" rule for symlinks means that symlinks
-that point to "outside" the tree are safe: they'll be followed
-for reading but not for writing (so we'll never write through a
-ref symlink to some other tree, if you have copied a whole
-archive by creating a symlink tree).
-
 With `-d`, it deletes the named <ref> after verifying that it
 still contains <old-oid>.