diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-05-15 16:04:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-15 16:04:43 -0700 |
commit | d37473e2a262d1f0e9c59977086e3cc740b6278f (patch) | |
tree | 701a49546edd05ea1c7f8e594a495647ac8ef6be /git-interpret-trailers.html | |
parent | d155f614392834fc25b1a475aa3fa83c543b7538 (diff) | |
download | git-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.html | 103 |
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 <alice@example.com>' --trailer 'sign: Bob <bob@example.com>'
+$ git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>' <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) <$(git config user.email)>"'
-$ git interpret-trailers <<EOF
-> EOF
+$ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"'
+$ git interpret-trailers --trailer sign <msg1.txt
+subject
+
+message
Signed-off-by: Bob <bob@example.com>
-$ git interpret-trailers <<EOF
-> Signed-off-by: Alice <alice@example.com>
-> EOF
+$ cat msg2.txt
+subject
+
+message
+
+Signed-off-by: Alice <alice@example.com>
+$ git interpret-trailers --trailer sign <msg2.txt
+subject
+
+message
Signed-off-by: Alice <alice@example.com></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" && git log --author="$1" --pretty="%an <%ae>" -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" <<EOF
-> subject
->
-> message
->
-> EOF
+$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" <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" && 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." <<EOF
-> subject
->
-> message
->
-> EOF
+$ git interpret-trailers --trailer="ref:Add copyright notices." <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 <<EOF
-> subject
->
-> message
->
-> see: HEAD~2
-> EOF
+$ git config trailer.see.cmd "glog-ref"
+$ git interpret-trailers --trailer=see <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$/ /' >commit_template.txt <<EOF
-> ***subject***
->
-> ***message***
->
-> Fixes: Z
-> Cc: Z
-> Reviewed-by: Z
-> Signed-off-by: Z
-> 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 > commit_template.txt
$ git config commit.template commit_template.txt
-$ cat >.git/hooks/commit-msg <<EOF
-> #!/bin/sh
-> git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new"
-> mv "\$1.new" "\$1"
-> EOF
+$ cat .git/hooks/commit-msg
+#!/bin/sh
+git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$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>
|