summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-11-01 12:53:30 -0400
committerTaylor Blau <me@ttaylorr.com>2024-11-01 12:53:30 -0400
commit6d81fe64dd646654bdb84fa5832c717954bf1696 (patch)
tree34e2a96f6730b632ccab93f0d185210470fa1f1a
parentaebc4bd8ced7442ddccb9ab48e744872a903aa36 (diff)
parent18b0b6c690e80dedbc482025f72f62d381f6fd51 (diff)
Merge branch 'kh/update-ref'
Documentation updates to 'git-update-ref(1)'. * kh/update-ref: Documentation: mutually link update-ref and symbolic-ref Documentation/git-update-ref.txt: discuss symbolic refs Documentation/git-update-ref.txt: remove confusing paragraph Documentation/git-update-ref.txt: demote symlink to last section Documentation/git-update-ref.txt: remove safety paragraphs Documentation/git-update-ref.txt: drop “flag”
-rw-r--r--Documentation/git-symbolic-ref.txt4
-rw-r--r--Documentation/git-update-ref.txt48
2 files changed, 25 insertions, 27 deletions
diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt
index 761b154bcb..33ca381fde 100644
--- a/Documentation/git-symbolic-ref.txt
+++ b/Documentation/git-symbolic-ref.txt
@@ -73,6 +73,10 @@ default.
symbolic ref were printed correctly, with status 1 if the requested
name is not a symbolic ref, or 128 if another error occurs.
+SEE ALSO
+--------
+linkgit:git-update-ref[1]
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt
index afcf33cf60..8a4281cde9 100644
--- a/Documentation/git-update-ref.txt
+++ b/Documentation/git-update-ref.txt
@@ -25,37 +25,16 @@ value is <old-oid>. You can specify 40 "0" or an empty string
as <old-oid> to make sure that the ref you are creating does
not exist.
-It also allows a "ref" file to be a symbolic pointer to another
-ref file by starting with the four-byte header sequence of
-"ref:".
-
-More importantly, it allows the update of a ref file to follow
-these symbolic pointers, whether they are symlinks or these
-"regular file symbolic refs". It follows *real* symlinks only
-if they start with "refs/": otherwise it will just try to read
-them and update them as a regular file (i.e. it will allow the
-filesystem to follow them, but will overwrite such a symlink to
-somewhere else with a regular filename).
+The final arguments are object names; this command without any options
+does not support updating a symbolic ref to point to another ref (see
+linkgit:git-symbolic-ref[1]). But `git update-ref --stdin` does have
+the `symref-*` commands so that regular refs and symbolic refs can be
+committed in the same transaction.
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` flag, it deletes the named <ref> after verifying it
+With `-d`, it deletes the named <ref> after verifying that it
still contains <old-oid>.
With `--stdin`, update-ref reads instructions from standard input and
@@ -200,6 +179,21 @@ An update will fail (without changing <ref>) if the current user is
unable to create a new log file, append to the existing log file
or does not have committer information available.
+NOTES
+-----
+
+Symbolic refs were initially implemented using symbolic links. This is
+now deprecated since not all filesystems support symbolic links.
+
+This command follows *real* symlinks only if they start with "refs/":
+otherwise it will just try to read them and update them as a regular
+file (i.e. it will allow the filesystem to follow them, but will
+overwrite such a symlink to somewhere else with a regular filename).
+
+SEE ALSO
+--------
+linkgit:git-symbolic-ref[1]
+
GIT
---
Part of the linkgit:git[1] suite