summaryrefslogtreecommitdiffstats
path: root/git-interpret-trailers.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-15 16:04:43 -0700
committerJunio C Hamano <gitster@pobox.com>2023-05-15 16:04:43 -0700
commitd37473e2a262d1f0e9c59977086e3cc740b6278f (patch)
tree701a49546edd05ea1c7f8e594a495647ac8ef6be /git-interpret-trailers.html
parentd155f614392834fc25b1a475aa3fa83c543b7538 (diff)
downloadgit-htmldocs-d37473e2a262d1f0e9c59977086e3cc740b6278f.tar.gz
Autogenerated HTML docs for v2.41.0-rc0
Diffstat (limited to 'git-interpret-trailers.html')
-rw-r--r--git-interpret-trailers.html103
1 files changed, 58 insertions, 45 deletions
diff --git a/git-interpret-trailers.html b/git-interpret-trailers.html
index 281a7f0c3..2d00f1a8b 100644
--- a/git-interpret-trailers.html
+++ b/git-interpret-trailers.html
@@ -1120,7 +1120,7 @@ $ cat msg.txt
subject
message
-$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice &lt;alice@example.com&gt;' --trailer 'sign: Bob &lt;bob@example.com&gt;'
+$ git interpret-trailers --trailer 'sign: Alice &lt;alice@example.com&gt;' --trailer 'sign: Bob &lt;bob@example.com&gt;' &lt;msg.txt
subject
message
@@ -1171,17 +1171,30 @@ Configure a <em>sign</em> trailer with a command to automatically add a
</p>
<div class="listingblock">
<div class="content">
-<pre><code>$ git config trailer.sign.key "Signed-off-by: "
+<pre><code>$ cat msg1.txt
+subject
+
+message
+$ git config trailer.sign.key "Signed-off-by: "
$ git config trailer.sign.ifmissing add
$ git config trailer.sign.ifexists doNothing
-$ git config trailer.sign.command 'echo "$(git config user.name) &lt;$(git config user.email)&gt;"'
-$ git interpret-trailers &lt;&lt;EOF
-&gt; EOF
+$ git config trailer.sign.cmd 'echo "$(git config user.name) &lt;$(git config user.email)&gt;"'
+$ git interpret-trailers --trailer sign &lt;msg1.txt
+subject
+
+message
Signed-off-by: Bob &lt;bob@example.com&gt;
-$ git interpret-trailers &lt;&lt;EOF
-&gt; Signed-off-by: Alice &lt;alice@example.com&gt;
-&gt; EOF
+$ cat msg2.txt
+subject
+
+message
+
+Signed-off-by: Alice &lt;alice@example.com&gt;
+$ git interpret-trailers --trailer sign &lt;msg2.txt
+subject
+
+message
Signed-off-by: Alice &lt;alice@example.com&gt;</code></pre>
</div></div>
@@ -1212,15 +1225,14 @@ Configure a <em>help</em> trailer with a cmd use a script <code>glog-find-author
<pre><code>$ cat ~/bin/glog-find-author
#!/bin/sh
test -n "$1" &amp;&amp; git log --author="$1" --pretty="%an &lt;%ae&gt;" -1 || true
+$ cat msg.txt
+subject
+
+message
$ git config trailer.help.key "Helped-by: "
$ git config trailer.help.ifExists "addIfDifferentNeighbor"
$ git config trailer.help.cmd "~/bin/glog-find-author"
-$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" &lt;&lt;EOF
-&gt; subject
-&gt;
-&gt; message
-&gt;
-&gt; EOF
+$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" &lt;msg.txt
subject
message
@@ -1240,15 +1252,14 @@ Configure a <em>ref</em> trailer with a cmd use a script <code>glog-grep</code>
<pre><code>$ cat ~/bin/glog-grep
#!/bin/sh
test -n "$1" &amp;&amp; git log --grep "$1" --pretty=reference -1 || true
+$ cat msg.txt
+subject
+
+message
$ git config trailer.ref.key "Reference-to: "
$ git config trailer.ref.ifExists "replace"
$ git config trailer.ref.cmd "~/bin/glog-grep"
-$ git interpret-trailers --trailer="ref:Add copyright notices." &lt;&lt;EOF
-&gt; subject
-&gt;
-&gt; message
-&gt;
-&gt; EOF
+$ git interpret-trailers --trailer="ref:Add copyright notices." &lt;msg.txt
subject
message
@@ -1263,17 +1274,20 @@ Configure a <em>see</em> trailer with a command to show the subject of a
</p>
<div class="listingblock">
<div class="content">
-<pre><code>$ git config trailer.see.key "See-also: "
+<pre><code>$ cat msg.txt
+subject
+
+message
+
+see: HEAD~2
+$ cat ~/bin/glog-ref
+#!/bin/sh
+git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14
+$ git config trailer.see.key "See-also: "
$ git config trailer.see.ifExists "replace"
$ git config trailer.see.ifMissing "doNothing"
-$ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG"
-$ git interpret-trailers &lt;&lt;EOF
-&gt; subject
-&gt;
-&gt; message
-&gt;
-&gt; see: HEAD~2
-&gt; EOF
+$ git config trailer.see.cmd "glog-ref"
+$ git interpret-trailers --trailer=see &lt;msg.txt
subject
message
@@ -1291,22 +1305,21 @@ Configure a commit template with some trailers with empty values
</p>
<div class="listingblock">
<div class="content">
-<pre><code>$ sed -e 's/ Z$/ /' &gt;commit_template.txt &lt;&lt;EOF
-&gt; ***subject***
-&gt;
-&gt; ***message***
-&gt;
-&gt; Fixes: Z
-&gt; Cc: Z
-&gt; Reviewed-by: Z
-&gt; Signed-off-by: Z
-&gt; EOF
+<pre><code>$ cat temp.txt
+***subject***
+
+***message***
+
+Fixes: Z
+Cc: Z
+Reviewed-by: Z
+Signed-off-by: Z
+$ sed -e 's/ Z$/ /' temp.txt &gt; commit_template.txt
$ git config commit.template commit_template.txt
-$ cat &gt;.git/hooks/commit-msg &lt;&lt;EOF
-&gt; #!/bin/sh
-&gt; git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" &gt; "\$1.new"
-&gt; mv "\$1.new" "\$1"
-&gt; EOF
+$ cat .git/hooks/commit-msg
+#!/bin/sh
+git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" &gt; "\$1.new"
+mv "\$1.new" "\$1"
$ chmod +x .git/hooks/commit-msg</code></pre>
</div></div>
</li>
@@ -1330,7 +1343,7 @@ $ chmod +x .git/hooks/commit-msg</code></pre>
<div id="footer">
<div id="footer-text">
Last updated
- 2022-10-28 11:53:56 PDT
+ 2023-05-15 16:02:03 PDT
</div>
</div>
</body>