summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-01-21 17:54:30 -0800
committerJunio C Hamano <gitster@pobox.com>2023-01-21 17:54:30 -0800
commita75aada385d663fe4451d0f91aab3aa07c0d85e6 (patch)
tree5ac7a0bf8355168914ff02768c14974e7fbff526
parent635978b311f6f7a8658016e600a28eb8740b062d (diff)
downloadgit-htmldocs-a75aada385d663fe4451d0f91aab3aa07c0d85e6.tar.gz
Autogenerated HTML docs for v2.39.1-308-g56c8f
-rw-r--r--RelNotes/2.40.0.txt12
-rw-r--r--diff-generate-patch.txt1
-rw-r--r--diff-options.txt8
-rw-r--r--git-bisect-lk2009.html6
-rw-r--r--git-bisect-lk2009.txt4
-rw-r--r--git-checkout.html8
-rw-r--r--git-checkout.txt6
-rw-r--r--git-cherry-pick.html4
-rw-r--r--git-cherry-pick.txt2
-rw-r--r--git-diff-files.html5
-rw-r--r--git-diff-index.html5
-rw-r--r--git-diff-tree.html5
-rw-r--r--git-diff.html5
-rw-r--r--git-fetch.html10
-rw-r--r--git-fetch.txt8
-rw-r--r--git-log.html5
-rw-r--r--git-merge.html5
-rw-r--r--git-merge.txt3
-rw-r--r--git-rebase.html14
-rw-r--r--git-rebase.txt7
-rw-r--r--git-reset.html5
-rw-r--r--git-reset.txt3
-rw-r--r--git-rev-parse.html3
-rw-r--r--git-show.html5
-rw-r--r--githooks.html13
-rw-r--r--githooks.txt12
-rw-r--r--gitrevisions.html3
-rw-r--r--howto/coordinate-embargoed-releases.html2
-rw-r--r--howto/keep-canonical-history-correct.html2
-rw-r--r--howto/maintain-git.html2
-rw-r--r--howto/new-command.html2
-rw-r--r--howto/rebase-from-internal-branch.html2
-rw-r--r--howto/rebuild-from-update-hook.html2
-rw-r--r--howto/recover-corrupted-blob-object.html2
-rw-r--r--howto/recover-corrupted-object-harder.html2
-rw-r--r--howto/revert-a-faulty-merge.html2
-rw-r--r--howto/revert-branch-rebase.html2
-rw-r--r--howto/separating-topic-branches.html2
-rw-r--r--howto/setup-git-server-over-http.html2
-rw-r--r--howto/update-hook-example.html2
-rw-r--r--howto/use-git-daemon.html2
-rw-r--r--howto/using-merge-subtree.html2
-rw-r--r--howto/using-signed-tag-in-pull-request.html2
-rw-r--r--revisions.txt3
44 files changed, 138 insertions, 64 deletions
diff --git a/RelNotes/2.40.0.txt b/RelNotes/2.40.0.txt
index 07ae9f20c..629d3c698 100644
--- a/RelNotes/2.40.0.txt
+++ b/RelNotes/2.40.0.txt
@@ -144,6 +144,12 @@ Fixes since v2.39
* Deal with a few deprecation warning from cURL library.
(merge 6c065f72b8 jk/curl-avoid-deprecated-api later to maint).
+ * Doc update for environment variables set when hooks are invoked.
+ (merge 772f8ff826 es/hooks-and-local-env later to maint).
+
+ * Document ORIG_HEAD a bit more.
+ (merge f1c9243fc5 pb/doc-orig-head later to maint).
+
* Other code cleanup, docfix, build fix, etc.
(merge 77e04b2ed4 rs/t4205-do-not-exit-in-test-script later to maint).
(merge faebba436e rs/plug-pattern-list-leak-in-lof later to maint).
@@ -165,3 +171,9 @@ Fixes since v2.39
(merge 27875aeec9 km/doc-branch-start-point later to maint).
(merge 35c194dc57 es/t1509-root-fixes later to maint).
(merge 7b341645e3 pw/ci-print-failure-name-fix later to maint).
+ (merge bcb71d45bf jx/t1301-updates later to maint).
+ (merge ebdc46c242 jc/doc-diff-patch.txt later to maint).
+ (merge a87a20cbb4 ar/test-cleanup later to maint).
+ (merge f5156f1885 ar/bisect-doc-update later to maint).
+ (merge fca2d86c97 jk/interop-error later to maint).
+ (merge cf4936ed74 tl/ls-tree-code-clean-up later to maint).
diff --git a/diff-generate-patch.txt b/diff-generate-patch.txt
index c78063d4f..546adf79e 100644
--- a/diff-generate-patch.txt
+++ b/diff-generate-patch.txt
@@ -1,3 +1,4 @@
+[[generate_patch_text_with_p]]
Generating patch text with -p
-----------------------------
diff --git a/diff-options.txt b/diff-options.txt
index 3674ac48e..7d73e976d 100644
--- a/diff-options.txt
+++ b/diff-options.txt
@@ -22,7 +22,13 @@ ifndef::git-format-patch[]
-p::
-u::
--patch::
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+ifdef::git-log[]
+<<generate_patch_text_with_p, "Generating patch text with -p">>).
+endif::git-log[]
+ifndef::git-log[]
+"Generating patch text with -p").
+endif::git-log[]
ifdef::git-diff[]
This is the default.
endif::git-diff[]
diff --git a/git-bisect-lk2009.html b/git-bisect-lk2009.html
index 546f4b4e8..f0a831673 100644
--- a/git-bisect-lk2009.html
+++ b/git-bisect-lk2009.html
@@ -1932,12 +1932,12 @@ author to given a talk and for publishing this paper.</p></div>
<div class="ulist"><ul>
<li>
<p>
-<a id="1"></a>[1] <a href="https://www.nist.gov/sites/default/files/documents/director/planning/report02-3.pdf"><em>The Economic Impacts of Inadequate Infratructure for Software Testing</em>. Nist Planning Report 02-3</a>, see Executive Summary and Chapter 8.
+<a id="1"></a>[1] <a href="https://web.archive.org/web/20091206032101/http://www.nist.gov/public_affairs/releases/n02-10.htm"><em>Software Errors Cost U.S. Economy $59.5 Billion Annually</em>. Nist News Release.</a> See also <a href="https://www.nist.gov/system/files/documents/director/planning/report02-3.pdf"><em>The Economic Impacts of Inadequate Infratructure for Software Testing</em>. Nist Planning Report 02-3</a>, Executive Summary and Chapter 8.
</p>
</li>
<li>
<p>
-<a id="2"></a>[2] <a href="http://www.oracle.com/technetwork/java/codeconvtoc-136057.html"><em>Code Conventions for the Java Programming Language</em>. Sun Microsystems.</a>
+<a id="2"></a>[2] <a href="https://www.oracle.com/java/technologies/javase/codeconventions-introduction.html"><em>Code Conventions for the Java Programming Language: 1. Introduction</em>. Sun Microsystems.</a>
</p>
</li>
<li>
@@ -1983,7 +1983,7 @@ author to given a talk and for publishing this paper.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2020-10-19 05:46:42 JST
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-bisect-lk2009.txt b/git-bisect-lk2009.txt
index f3d9566c8..0bc165788 100644
--- a/git-bisect-lk2009.txt
+++ b/git-bisect-lk2009.txt
@@ -1347,8 +1347,8 @@ author to given a talk and for publishing this paper.
References
----------
-- [[[1]]] https://www.nist.gov/sites/default/files/documents/director/planning/report02-3.pdf['The Economic Impacts of Inadequate Infratructure for Software Testing'. Nist Planning Report 02-3], see Executive Summary and Chapter 8.
-- [[[2]]] http://www.oracle.com/technetwork/java/codeconvtoc-136057.html['Code Conventions for the Java Programming Language'. Sun Microsystems.]
+- [[[1]]] https://web.archive.org/web/20091206032101/http://www.nist.gov/public_affairs/releases/n02-10.htm['Software Errors Cost U.S. Economy $59.5 Billion Annually'. Nist News Release.] See also https://www.nist.gov/system/files/documents/director/planning/report02-3.pdf['The Economic Impacts of Inadequate Infratructure for Software Testing'. Nist Planning Report 02-3], Executive Summary and Chapter 8.
+- [[[2]]] https://www.oracle.com/java/technologies/javase/codeconventions-introduction.html['Code Conventions for the Java Programming Language: 1. Introduction'. Sun Microsystems.]
- [[[3]]] https://en.wikipedia.org/wiki/Software_maintenance['Software maintenance'. Wikipedia.]
- [[[4]]] https://lore.kernel.org/git/7vps5xsbwp.fsf_-_@assigned-by-dhcp.cox.net/[Junio C Hamano. 'Automated bisect success story'.]
- [[[5]]] https://lwn.net/Articles/317154/[Christian Couder. 'Fully automated bisecting with "git bisect run"'. LWN.net.]
diff --git a/git-checkout.html b/git-checkout.html
index 397de991f..2134d807f 100644
--- a/git-checkout.html
+++ b/git-checkout.html
@@ -1388,9 +1388,9 @@ before that happens. If we have not yet moved away from commit <code>f</code>,
any of these will create a reference to it:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>$ git checkout -b foo <b>&lt;1&gt;</b>
-$ git branch foo <b>&lt;2&gt;</b>
-$ git tag foo <b>&lt;3&gt;</b></code></pre>
+<pre><code>$ git checkout -b foo # or "git switch -c foo" <b>&lt;1&gt;</b>
+$ git branch foo <b>&lt;2&gt;</b>
+$ git tag foo <b>&lt;3&gt;</b></code></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1633,7 +1633,7 @@ checkout.thresholdForParallelism
<div id="footer">
<div id="footer-text">
Last updated
- 2022-09-14 13:23:11 PDT
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-checkout.txt b/git-checkout.txt
index 4cb9d555b..9f116acdb 100644
--- a/git-checkout.txt
+++ b/git-checkout.txt
@@ -477,9 +477,9 @@ before that happens. If we have not yet moved away from commit `f`,
any of these will create a reference to it:
------------
-$ git checkout -b foo <1>
-$ git branch foo <2>
-$ git tag foo <3>
+$ git checkout -b foo # or "git switch -c foo" <1>
+$ git branch foo <2>
+$ git tag foo <3>
------------
<1> creates a new branch `foo`, which refers to commit `f`, and then
diff --git a/git-cherry-pick.html b/git-cherry-pick.html
index 2fbd7af8a..353bbfb4f 100644
--- a/git-cherry-pick.html
+++ b/git-cherry-pick.html
@@ -1166,7 +1166,7 @@ again, this time exercising more care about matching up context lines.</p></div>
<div class="content">
<pre><code>$ git cherry-pick topic^ <b>&lt;1&gt;</b>
$ git diff <b>&lt;2&gt;</b>
-$ git reset --merge ORIG_HEAD <b>&lt;3&gt;</b>
+$ git cherry-pick --abort <b>&lt;3&gt;</b>
$ git cherry-pick -Xpatience topic^ <b>&lt;4&gt;</b></code></pre>
</div></div>
<div class="colist arabic"><ol>
@@ -1217,7 +1217,7 @@ try to apply the change introduced by <code>topic^</code> again,
<div id="footer">
<div id="footer-text">
Last updated
- 2022-08-18 14:11:07 PDT
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-cherry-pick.txt b/git-cherry-pick.txt
index 1e8ac9df6..fdcad3d20 100644
--- a/git-cherry-pick.txt
+++ b/git-cherry-pick.txt
@@ -219,7 +219,7 @@ again, this time exercising more care about matching up context lines.
------------
$ git cherry-pick topic^ <1>
$ git diff <2>
-$ git reset --merge ORIG_HEAD <3>
+$ git cherry-pick --abort <3>
$ git cherry-pick -Xpatience topic^ <4>
------------
<1> apply the change that would be shown by `git show topic^`.
diff --git a/git-diff-files.html b/git-diff-files.html
index f26773dc2..1ab44ae19 100644
--- a/git-diff-files.html
+++ b/git-diff-files.html
@@ -778,7 +778,8 @@ same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
</dt>
<dd>
<p>
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+"Generating patch text with -p").
</p>
</dd>
<dt class="hdlist1">
@@ -2337,7 +2338,7 @@ all parents.</p></div>
</div>
</div>
<div class="sect1">
-<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
+<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
<div class="sectionbody">
<div class="paragraph"><p>Running
<a href="git-diff.html">git-diff(1)</a>,
diff --git a/git-diff-index.html b/git-diff-index.html
index 8f20f8bb9..ead7f0e9f 100644
--- a/git-diff-index.html
+++ b/git-diff-index.html
@@ -779,7 +779,8 @@ files are compared.</p></div>
</dt>
<dd>
<p>
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+"Generating patch text with -p").
</p>
</dd>
<dt class="hdlist1">
@@ -2331,7 +2332,7 @@ all parents.</p></div>
</div>
</div>
<div class="sect1">
-<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
+<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
<div class="sectionbody">
<div class="paragraph"><p>Running
<a href="git-diff.html">git-diff(1)</a>,
diff --git a/git-diff-tree.html b/git-diff-tree.html
index 99ebe987c..84dfb2579 100644
--- a/git-diff-tree.html
+++ b/git-diff-tree.html
@@ -780,7 +780,8 @@ git-diff-tree(1) Manual Page
</dt>
<dd>
<p>
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+"Generating patch text with -p").
</p>
</dd>
<dt class="hdlist1">
@@ -3608,7 +3609,7 @@ all parents.</p></div>
</div>
</div>
<div class="sect1">
-<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
+<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
<div class="sectionbody">
<div class="paragraph"><p>Running
<a href="git-diff.html">git-diff(1)</a>,
diff --git a/git-diff.html b/git-diff.html
index 9a8fe99b5..433a7935a 100644
--- a/git-diff.html
+++ b/git-diff.html
@@ -911,7 +911,8 @@ and the range notations (<code>&lt;commit&gt;..&lt;commit&gt;</code> and
</dt>
<dd>
<p>
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+"Generating patch text with -p").
This is the default.
</p>
</dd>
@@ -2469,7 +2470,7 @@ all parents.</p></div>
</div>
</div>
<div class="sect1">
-<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
+<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
<div class="sectionbody">
<div class="paragraph"><p>Running
<a href="git-diff.html">git-diff(1)</a>,
diff --git a/git-fetch.html b/git-fetch.html
index e4fc99601..5764582e4 100644
--- a/git-fetch.html
+++ b/git-fetch.html
@@ -1914,10 +1914,10 @@ Update the remote-tracking branches:
<div class="content">
<pre><code>$ git fetch origin</code></pre>
</div></div>
-<div class="paragraph"><p>The above command copies all branches from the remote refs/heads/
-namespace and stores them to the local refs/remotes/origin/ namespace,
-unless the branch.&lt;name&gt;.fetch option is used to specify a non-default
-refspec.</p></div>
+<div class="paragraph"><p>The above command copies all branches from the remote <code>refs/heads/</code>
+namespace and stores them to the local <code>refs/remotes/origin/</code> namespace,
+unless the <code>remote.&lt;repository&gt;.fetch</code> option is used to specify a
+non-default refspec.</p></div>
</li>
<li>
<p>
@@ -2184,7 +2184,7 @@ submodule update</code>. This is expected to be fixed in a future Git version.</
<div id="footer">
<div id="footer-text">
Last updated
- 2022-09-14 13:23:11 PDT
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-fetch.txt b/git-fetch.txt
index 63d9569e1..fba66f146 100644
--- a/git-fetch.txt
+++ b/git-fetch.txt
@@ -251,10 +251,10 @@ EXAMPLES
$ git fetch origin
------------------------------------------------
+
-The above command copies all branches from the remote refs/heads/
-namespace and stores them to the local refs/remotes/origin/ namespace,
-unless the branch.<name>.fetch option is used to specify a non-default
-refspec.
+The above command copies all branches from the remote `refs/heads/`
+namespace and stores them to the local `refs/remotes/origin/` namespace,
+unless the `remote.<repository>.fetch` option is used to specify a
+non-default refspec.
* Using refspecs explicitly:
+
diff --git a/git-log.html b/git-log.html
index c545a12b5..a966c588a 100644
--- a/git-log.html
+++ b/git-log.html
@@ -3498,7 +3498,8 @@ the default format.</p></div>
</dt>
<dd>
<p>
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+<a href="#generate_patch_text_with_p">"Generating patch text with -p"</a>).
</p>
</dd>
<dt class="hdlist1">
@@ -4894,7 +4895,7 @@ matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<
</div>
</div>
<div class="sect1">
-<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
+<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
<div class="sectionbody">
<div class="paragraph"><p>Running
<a href="git-diff.html">git-diff(1)</a>,
diff --git a/git-merge.html b/git-merge.html
index ef87f6c59..434551199 100644
--- a/git-merge.html
+++ b/git-merge.html
@@ -779,7 +779,8 @@ from one branch into another.</p></div>
<code>topic</code> branch since it diverged from <code>master</code> (i.e., <code>E</code>) until
its current commit (<code>C</code>) on top of <code>master</code>, and record the result
in a new commit along with the names of the two parent commits and
-a log message from the user describing the changes.</p></div>
+a log message from the user describing the changes. Before the operation,
+<code>ORIG_HEAD</code> is set to the tip of the current branch (<code>C</code>).</p></div>
<div class="listingblock">
<div class="content">
<pre><code> A---B---C topic
@@ -2326,7 +2327,7 @@ merge.&lt;driver&gt;.recursive
<div id="footer">
<div id="footer-text">
Last updated
- 2022-09-14 13:23:11 PDT
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-merge.txt b/git-merge.txt
index 2d6a1391c..0aeff572a 100644
--- a/git-merge.txt
+++ b/git-merge.txt
@@ -37,7 +37,8 @@ Then "`git merge topic`" will replay the changes made on the
`topic` branch since it diverged from `master` (i.e., `E`) until
its current commit (`C`) on top of `master`, and record the result
in a new commit along with the names of the two parent commits and
-a log message from the user describing the changes.
+a log message from the user describing the changes. Before the operation,
+`ORIG_HEAD` is set to the tip of the current branch (`C`).
------------
A---B---C topic
diff --git a/git-rebase.html b/git-rebase.html
index ef0720da0..21b0c0c95 100644
--- a/git-rebase.html
+++ b/git-rebase.html
@@ -779,6 +779,18 @@ description on <code>--fork-point</code> below); or by <code>git log HEAD</code>
<code>--onto</code> option was supplied. This has the exact same effect as
<code>git reset --hard &lt;upstream&gt;</code> (or <code>&lt;newbase&gt;</code>). <code>ORIG_HEAD</code> is set
to point at the tip of the branch before the reset.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content"><code>ORIG_HEAD</code> is not guaranteed to still point to the previous branch tip
+at the end of the rebase if other commands that write that pseudo-ref
+(e.g. <code>git reset</code>) are used during the rebase. The previous branch tip,
+however, is accessible using the reflog of the current branch
+(i.e. <code>@{1}</code>, see <a href="gitrevisions.html">gitrevisions(7)</a>).</td>
+</tr></table>
+</div>
<div class="paragraph"><p>The commits that were previously saved into the temporary area are
then reapplied to the current branch, one by one, in order. Note that
any commits in <code>HEAD</code> which introduce the same textual changes as a commit
@@ -2765,7 +2777,7 @@ sequence.editor
<div id="footer">
<div id="footer-text">
Last updated
- 2022-11-04 21:49:36 PDT
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-rebase.txt b/git-rebase.txt
index f9675bd24..d811c1cf4 100644
--- a/git-rebase.txt
+++ b/git-rebase.txt
@@ -38,6 +38,13 @@ The current branch is reset to `<upstream>` or `<newbase>` if the
`git reset --hard <upstream>` (or `<newbase>`). `ORIG_HEAD` is set
to point at the tip of the branch before the reset.
+[NOTE]
+`ORIG_HEAD` is not guaranteed to still point to the previous branch tip
+at the end of the rebase if other commands that write that pseudo-ref
+(e.g. `git reset`) are used during the rebase. The previous branch tip,
+however, is accessible using the reflog of the current branch
+(i.e. `@{1}`, see linkgit:gitrevisions[7]).
+
The commits that were previously saved into the temporary area are
then reapplied to the current branch, one by one, in order. Note that
any commits in `HEAD` which introduce the same textual changes as a commit
diff --git a/git-reset.html b/git-reset.html
index 1b555866b..0dfcc3530 100644
--- a/git-reset.html
+++ b/git-reset.html
@@ -807,7 +807,8 @@ section of <a href="git-add.html">git-add(1)</a> to learn how to operate the <co
<p>
This form resets the current branch head to <code>&lt;commit&gt;</code> and
possibly updates the index (resetting it to the tree of <code>&lt;commit&gt;</code>) and
- the working tree depending on <code>&lt;mode&gt;</code>. If <code>&lt;mode&gt;</code> is omitted,
+ the working tree depending on <code>&lt;mode&gt;</code>. Before the operation, <code>ORIG_HEAD</code>
+ is set to the tip of the current branch. If <code>&lt;mode&gt;</code> is omitted,
defaults to <code>--mixed</code>. The <code>&lt;mode&gt;</code> must be one of the following:
</p>
<div class="openblock">
@@ -1506,7 +1507,7 @@ entries:</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2022-04-04 11:19:32 PDT
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/git-reset.txt b/git-reset.txt
index 01cb4c9b9..79ad5643e 100644
--- a/git-reset.txt
+++ b/git-reset.txt
@@ -49,7 +49,8 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
'git reset' [<mode>] [<commit>]::
This form resets the current branch head to `<commit>` and
possibly updates the index (resetting it to the tree of `<commit>`) and
- the working tree depending on `<mode>`. If `<mode>` is omitted,
+ the working tree depending on `<mode>`. Before the operation, `ORIG_HEAD`
+ is set to the tip of the current branch. If `<mode>` is omitted,
defaults to `--mixed`. The `<mode>` must be one of the following:
+
--
diff --git a/git-rev-parse.html b/git-rev-parse.html
index 37e2c9ffa..b2a4ddfad 100644
--- a/git-rev-parse.html
+++ b/git-rev-parse.html
@@ -1399,7 +1399,8 @@ otherwise, <em>refs/remotes/&lt;refname&gt;/HEAD</em> if it exists.
<code>FETCH_HEAD</code> records the branch which you fetched from a remote repository
with your last <code>git fetch</code> invocation.
<code>ORIG_HEAD</code> is created by commands that move your <code>HEAD</code> in a drastic
-way, to record the position of the <code>HEAD</code> before their operation, so that
+way (<code>git am</code>, <code>git merge</code>, <code>git rebase</code>, <code>git reset</code>),
+to record the position of the <code>HEAD</code> before their operation, so that
you can easily change the tip of the branch back to the state before you ran
them.
<code>MERGE_HEAD</code> records the commit(s) which you are merging into your branch
diff --git a/git-show.html b/git-show.html
index e58cf6f28..25038a1fd 100644
--- a/git-show.html
+++ b/git-show.html
@@ -1952,7 +1952,8 @@ diff output.</p></div>
</dt>
<dd>
<p>
- Generate patch (see section on generating patches).
+ Generate patch (see section titled
+<a href="#generate_patch_text_with_p">"Generating patch text with -p"</a>).
</p>
</dd>
<dt class="hdlist1">
@@ -3348,7 +3349,7 @@ matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<
</div>
</div>
<div class="sect1">
-<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
+<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
<div class="sectionbody">
<div class="paragraph"><p>Running
<a href="git-diff.html">git-diff(1)</a>,
diff --git a/githooks.html b/githooks.html
index ab7e1fb15..06e09a6a4 100644
--- a/githooks.html
+++ b/githooks.html
@@ -765,6 +765,17 @@ $GIT_DIR in a bare repository or the root of the working tree in a non-bare
repository. An exception are hooks triggered during a push (<em>pre-receive</em>,
<em>update</em>, <em>post-receive</em>, <em>post-update</em>, <em>push-to-checkout</em>) which are always
executed in $GIT_DIR.</p></div>
+<div class="paragraph"><p>Environment variables, such as <code>GIT_DIR</code>, <code>GIT_WORK_TREE</code>, etc., are exported
+so that Git commands run by the hook can correctly locate the repository. If
+your hook needs to invoke Git commands in a foreign repository or in a
+different working tree of the same repository, then it should clear these
+environment variables so they do not interfere with Git operations at the
+foreign location. For example:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>local_desc=$(git describe)
+foreign_desc=$(unset $(git rev-parse --local-env-vars); git -C ../foreign-repo describe)</code></pre>
+</div></div>
<div class="paragraph"><p>Hooks can get their arguments via the environment, command-line
arguments, and stdin. See the documentation for each hook below for
details.</p></div>
@@ -1383,7 +1394,7 @@ running passing "1", "1" should not be possible.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2022-02-16 17:29:08 PST
+ 2023-01-21 17:52:14 PST
</div>
</div>
</body>
diff --git a/githooks.txt b/githooks.txt
index a16e62bc8..62908602e 100644
--- a/githooks.txt
+++ b/githooks.txt
@@ -27,6 +27,18 @@ repository. An exception are hooks triggered during a push ('pre-receive',
'update', 'post-receive', 'post-update', 'push-to-checkout') which are always
executed in $GIT_DIR.
+Environment variables, such as `GIT_DIR`, `GIT_WORK_TREE`, etc., are exported
+so that Git commands run by the hook can correctly locate the repository. If
+your hook needs to invoke Git commands in a foreign repository or in a
+different working tree of the same repository, then it should clear these
+environment variables so they do not interfere with Git operations at the
+foreign location. For example:
+
+------------
+local_desc=$(git describe)
+foreign_desc=$(unset $(git rev-parse --local-env-vars); git -C ../foreign-repo describe)
+------------
+
Hooks can get their arguments via the environment, command-line
arguments, and stdin. See the documentation for each hook below for
details.
diff --git a/gitrevisions.html b/gitrevisions.html
index ff806000d..737eda12b 100644
--- a/gitrevisions.html
+++ b/gitrevisions.html
@@ -854,7 +854,8 @@ otherwise, <em>refs/remotes/&lt;refname&gt;/HEAD</em> if it exists.
<code>FETCH_HEAD</code> records the branch which you fetched from a remote repository
with your last <code>git fetch</code> invocation.
<code>ORIG_HEAD</code> is created by commands that move your <code>HEAD</code> in a drastic
-way, to record the position of the <code>HEAD</code> before their operation, so that
+way (<code>git am</code>, <code>git merge</code>, <code>git rebase</code>, <code>git reset</code>),
+to record the position of the <code>HEAD</code> before their operation, so that
you can easily change the tip of the branch back to the state before you ran
them.
<code>MERGE_HEAD</code> records the commit(s) which you are merging into your branch
diff --git a/howto/coordinate-embargoed-releases.html b/howto/coordinate-embargoed-releases.html
index e15e8e30c..6098ef20e 100644
--- a/howto/coordinate-embargoed-releases.html
+++ b/howto/coordinate-embargoed-releases.html
@@ -1038,7 +1038,7 @@ Thanks,
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:12 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/keep-canonical-history-correct.html b/howto/keep-canonical-history-correct.html
index 749359af7..7112a41b8 100644
--- a/howto/keep-canonical-history-correct.html
+++ b/howto/keep-canonical-history-correct.html
@@ -938,7 +938,7 @@ tip of your <em>master</em> again and redo the two merges:</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/maintain-git.html b/howto/maintain-git.html
index 901dc1d48..10227b5dd 100644
--- a/howto/maintain-git.html
+++ b/howto/maintain-git.html
@@ -1478,7 +1478,7 @@ $ git update-ref -d $mf/ai/topic</code></pre>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/new-command.html b/howto/new-command.html
index 3d7c1a346..6327495d1 100644
--- a/howto/new-command.html
+++ b/howto/new-command.html
@@ -863,7 +863,7 @@ letter [PATCH 0/n].
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:09 PST
+ 2023-01-21 17:52:48 PST
</div>
</div>
</body>
diff --git a/howto/rebase-from-internal-branch.html b/howto/rebase-from-internal-branch.html
index 560f6f26b..034403e3b 100644
--- a/howto/rebase-from-internal-branch.html
+++ b/howto/rebase-from-internal-branch.html
@@ -895,7 +895,7 @@ the #1' commit.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/rebuild-from-update-hook.html b/howto/rebuild-from-update-hook.html
index 2e7961b9b..36cca9822 100644
--- a/howto/rebuild-from-update-hook.html
+++ b/howto/rebuild-from-update-hook.html
@@ -847,7 +847,7 @@ This is still crude and does not protect against simultaneous
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/recover-corrupted-blob-object.html b/howto/recover-corrupted-blob-object.html
index b91368b3d..0ec0ffa85 100644
--- a/howto/recover-corrupted-blob-object.html
+++ b/howto/recover-corrupted-blob-object.html
@@ -880,7 +880,7 @@ thing.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/recover-corrupted-object-harder.html b/howto/recover-corrupted-object-harder.html
index bbea93867..acc6c1dd2 100644
--- a/howto/recover-corrupted-object-harder.html
+++ b/howto/recover-corrupted-object-harder.html
@@ -1189,7 +1189,7 @@ int main(int argc, char **argv)
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/revert-a-faulty-merge.html b/howto/revert-a-faulty-merge.html
index 8da085925..4079223b0 100644
--- a/howto/revert-a-faulty-merge.html
+++ b/howto/revert-a-faulty-merge.html
@@ -1025,7 +1025,7 @@ P---o---o---M---x---x---W---x---M2
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:11 PST
+ 2023-01-21 17:52:50 PST
</div>
</div>
</body>
diff --git a/howto/revert-branch-rebase.html b/howto/revert-branch-rebase.html
index 80517501f..7eebbc377 100644
--- a/howto/revert-branch-rebase.html
+++ b/howto/revert-branch-rebase.html
@@ -907,7 +907,7 @@ Committed merge 7fb9b7262a1d1e0a47bbfdcbbcf50ce0635d3f8f
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:09 PST
+ 2023-01-21 17:52:48 PST
</div>
</div>
</body>
diff --git a/howto/separating-topic-branches.html b/howto/separating-topic-branches.html
index 1b543971f..1be87e2c5 100644
--- a/howto/separating-topic-branches.html
+++ b/howto/separating-topic-branches.html
@@ -841,7 +841,7 @@ o---o"master"</code></pre>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:10 PST
+ 2023-01-21 17:52:49 PST
</div>
</div>
</body>
diff --git a/howto/setup-git-server-over-http.html b/howto/setup-git-server-over-http.html
index d20f34207..c5055b808 100644
--- a/howto/setup-git-server-over-http.html
+++ b/howto/setup-git-server-over-http.html
@@ -1071,7 +1071,7 @@ help diagnosing the problem, but removes security checks.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:10 PST
+ 2023-01-21 17:52:49 PST
</div>
</div>
</body>
diff --git a/howto/update-hook-example.html b/howto/update-hook-example.html
index c3987b933..cf5a8dfc9 100644
--- a/howto/update-hook-example.html
+++ b/howto/update-hook-example.html
@@ -930,7 +930,7 @@ that JC can make non-fast-forward pushes on it.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:10 PST
+ 2023-01-21 17:52:49 PST
</div>
</div>
</body>
diff --git a/howto/use-git-daemon.html b/howto/use-git-daemon.html
index 2e10a2409..201654b04 100644
--- a/howto/use-git-daemon.html
+++ b/howto/use-git-daemon.html
@@ -791,7 +791,7 @@ a good practice to put the paths after a "--" separator.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:10 PST
+ 2023-01-21 17:52:49 PST
</div>
</div>
</body>
diff --git a/howto/using-merge-subtree.html b/howto/using-merge-subtree.html
index fab47e614..665ff19d1 100644
--- a/howto/using-merge-subtree.html
+++ b/howto/using-merge-subtree.html
@@ -848,7 +848,7 @@ Please note that if the other project merges from you, then it will
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:09 PST
+ 2023-01-21 17:52:48 PST
</div>
</div>
</body>
diff --git a/howto/using-signed-tag-in-pull-request.html b/howto/using-signed-tag-in-pull-request.html
index 2081ade85..1570a705e 100644
--- a/howto/using-signed-tag-in-pull-request.html
+++ b/howto/using-signed-tag-in-pull-request.html
@@ -952,7 +952,7 @@ as part of the merge commit.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-01-20 16:00:10 PST
+ 2023-01-21 17:52:49 PST
</div>
</div>
</body>
diff --git a/revisions.txt b/revisions.txt
index 0d2e55d78..9aa58052b 100644
--- a/revisions.txt
+++ b/revisions.txt
@@ -49,7 +49,8 @@ characters and to avoid word splitting.
`FETCH_HEAD` records the branch which you fetched from a remote repository
with your last `git fetch` invocation.
`ORIG_HEAD` is created by commands that move your `HEAD` in a drastic
-way, to record the position of the `HEAD` before their operation, so that
+way (`git am`, `git merge`, `git rebase`, `git reset`),
+to record the position of the `HEAD` before their operation, so that
you can easily change the tip of the branch back to the state before you ran
them.
`MERGE_HEAD` records the commit(s) which you are merging into your branch