{
    "content": [
        {
            "type": "text",
            "text": "# git-interpret-trailers(1) (man)\n\n**Summary:** git-interpret-trailers - Add or parse structured information in commit messages\n\n**Synopsis:** git interpret-trailers [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]\ngit interpret-trailers [<options>] [--parse] [<file>...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | --in-place | — | Edit the files in place. |\n| — | --trim-empty | — | If the <value> part of any trailer contains only whitespace, the whole trailer will be removed from the resulting messag |\n| — | --no-where | <placement> | Specify where all new trailers will be added. A setting provided with --where overrides all configuration variables and  |\n| — | --no-if-exists | <action> | Specify what action will be performed when there is already at least one trailer with the same <token> in the message. A |\n| — | --no-if-missing | <action> | Specify what action will be performed when there is no other trailer with the same <token> in the message. A setting pro |\n| — | --only-trailers | — | Output only the trailers, not any other parts of the input. |\n| — | --only-input | — | Output only trailers that exist in the input; do not add any from the command-line or by following configured trailer.*  |\n| — | --unfold | — | Remove any whitespace-continuation in trailers, so that each trailer appears on a line by itself with its full content. |\n| — | --parse | — | A convenience alias for --only-trailers --only-input --unfold. |\n| — | --no-divider | — | Do not treat --- as the end of the commit message. Use this when you know your input contains just the commit message it |\n\n## Examples\n\n- `•   Configure a sign trailer with a Signed-off-by key, and then add two of these trailers to`\n- `a message:`\n- `$ git config trailer.sign.key \"Signed-off-by\"`\n- `$ cat msg.txt`\n- `subject`\n- `message`\n- `$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>'`\n- `subject`\n- `message`\n- `Signed-off-by: Alice <alice@example.com>`\n- `Signed-off-by: Bob <bob@example.com>`\n- `•   Use the --in-place option to edit a message file in place:`\n- `$ cat msg.txt`\n- `subject`\n- `message`\n- `Signed-off-by: Bob <bob@example.com>`\n- `$ git interpret-trailers --trailer 'Acked-by: Alice <alice@example.com>' --in-place msg.txt`\n- `$ cat msg.txt`\n- `subject`\n- `message`\n- `Signed-off-by: Bob <bob@example.com>`\n- `Acked-by: Alice <alice@example.com>`\n- `•   Extract the last commit as a patch, and add a Cc and a Reviewed-by trailer to it:`\n- `$ git format-patch -1`\n- `0001-foo.patch`\n- `$ git interpret-trailers --trailer 'Cc: Alice <alice@example.com>' --trailer 'Reviewed-by: Bob <bob@example.com>' 0001-foo.patch >0001-bar.patch`\n- `•   Configure a sign trailer with a command to automatically add a 'Signed-off-by: ' with the`\n- `author information only if there is no 'Signed-off-by: ' already, and show how it works:`\n- `$ git config trailer.sign.key \"Signed-off-by: \"`\n- `$ git config trailer.sign.ifmissing add`\n- `$ git config trailer.sign.ifexists doNothing`\n- `$ git config trailer.sign.command 'echo \"$(git config user.name) <$(git config user.email)>\"'`\n- `$ git interpret-trailers <<EOF`\n- `> EOF`\n- `Signed-off-by: Bob <bob@example.com>`\n- `$ git interpret-trailers <<EOF`\n- `> Signed-off-by: Alice <alice@example.com>`\n- `> EOF`\n- `Signed-off-by: Alice <alice@example.com>`\n- `•   Configure a fix trailer with a key that contains a # and no space after this character,`\n- `and show how it works:`\n- `$ git config trailer.separators \":#\"`\n- `$ git config trailer.fix.key \"Fix #\"`\n- `$ echo \"subject\" | git interpret-trailers --trailer fix=42`\n- `subject`\n- `Fix #42`\n- `•   Configure a help trailer with a cmd use a script glog-find-author which search specified`\n- `author identity from git log in git repository and show how it works:`\n- `$ cat ~/bin/glog-find-author`\n- `#!/bin/sh`\n- `test -n \"$1\" && git log --author=\"$1\" --pretty=\"%an <%ae>\" -1 || true`\n- `$ git config trailer.help.key \"Helped-by: \"`\n- `$ git config trailer.help.ifExists \"addIfDifferentNeighbor\"`\n- `$ git config trailer.help.cmd \"~/bin/glog-find-author\"`\n- `$ git interpret-trailers --trailer=\"help:Junio\" --trailer=\"help:Couder\" <<EOF`\n- `> subject`\n- `> message`\n- `> EOF`\n- `subject`\n- `message`\n- `Helped-by: Junio C Hamano <gitster@pobox.com>`\n- `Helped-by: Christian Couder <christian.couder@gmail.com>`\n- `•   Configure a ref trailer with a cmd use a script glog-grep to grep last relevant commit`\n- `from git log in the git repository and show how it works:`\n- `$ cat ~/bin/glog-grep`\n- `#!/bin/sh`\n- `test -n \"$1\" && git log --grep \"$1\" --pretty=reference -1 || true`\n- `$ git config trailer.ref.key \"Reference-to: \"`\n- `$ git config trailer.ref.ifExists \"replace\"`\n- `$ git config trailer.ref.cmd \"~/bin/glog-grep\"`\n- `$ git interpret-trailers --trailer=\"ref:Add copyright notices.\" <<EOF`\n- `> subject`\n- `> message`\n- `> EOF`\n- `subject`\n- `message`\n- `Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)`\n- `•   Configure a see trailer with a command to show the subject of a commit that is related,`\n- `and show how it works:`\n- `$ git config trailer.see.key \"See-also: \"`\n- `$ git config trailer.see.ifExists \"replace\"`\n- `$ git config trailer.see.ifMissing \"doNothing\"`\n- `$ git config trailer.see.command \"git log -1 --oneline --format=\\\"%h (%s)\\\" --abbrev-commit --abbrev=14 \\$ARG\"`\n- `$ git interpret-trailers <<EOF`\n- `> subject`\n- `> message`\n- `> see: HEAD~2`\n- `> EOF`\n- `subject`\n- `message`\n- `See-also: fe3187489d69c4 (subject of related commit)`\n- `•   Configure a commit template with some trailers with empty values (using sed to show and`\n- `keep the trailing spaces at the end of the trailers), then configure a commit-msg hook`\n- `that uses git interpret-trailers to remove trailers with empty values and to add a`\n- `git-version trailer:`\n- `$ sed -e 's/ Z$/ /' >committemplate.txt <<EOF`\n- `> *subject*`\n- `> *message*`\n- `> Fixes: Z`\n- `> Cc: Z`\n- `> Reviewed-by: Z`\n- `> Signed-off-by: Z`\n- `> EOF`\n- `$ git config commit.template committemplate.txt`\n- `$ cat >.git/hooks/commit-msg <<EOF`\n- `> #!/bin/sh`\n- `> git interpret-trailers --trim-empty --trailer \"git-version: \\$(git describe)\" \"\\$1\" > \"\\$1.new\"`\n- `> mv \"\\$1.new\" \"\\$1\"`\n- `> EOF`\n- `$ chmod +x .git/hooks/commit-msg`\n\n## See Also\n\n- git-commit(1)\n- git-format-patch(1)\n- git-config(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (47 lines)\n- **OPTIONS** (1 lines) — 10 subsections\n  - --in-place (2 lines)\n  - --trim-empty (8 lines)\n  - --where <placement>, --no-where (4 lines)\n  - --if-exists <action>, --no-if-exists (6 lines)\n  - --if-missing <action>, --no-if-missing (5 lines)\n  - --only-trailers (2 lines)\n  - --only-input (3 lines)\n  - --unfold (3 lines)\n  - --parse (2 lines)\n  - --no-divider (4 lines)\n- **CONFIGURATION VARIABLES** (112 lines)\n- **EXAMPLES** (161 lines)\n- **SEE ALSO** (2 lines)\n- **GIT** (5 lines)\n\n## Full Content\n\n### NAME\n\ngit-interpret-trailers - Add or parse structured information in commit messages\n\n### SYNOPSIS\n\ngit interpret-trailers [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]\ngit interpret-trailers [<options>] [--parse] [<file>...]\n\n### DESCRIPTION\n\nHelp parsing or adding trailers lines, that look similar to RFC 822 e-mail headers, at the\nend of the otherwise free-form part of a commit message.\n\nThis command reads some patches or commit messages from either the <file> arguments or the\nstandard input if no <file> is specified. If --parse is specified, the output consists of the\nparsed trailers.\n\nOtherwise, this command applies the arguments passed using the --trailer option, if any, to\nthe commit message part of each input file. The result is emitted on the standard output.\n\nSome configuration variables control the way the --trailer arguments are applied to each\ncommit message and the way any existing trailer in the commit message is changed. They also\nmake it possible to automatically add some trailers.\n\nBy default, a <token>=<value> or <token>:<value> argument given using --trailer will be\nappended after the existing trailers only if the last trailer has a different (<token>,\n<value>) pair (or if there is no existing trailer). The <token> and <value> parts will be\ntrimmed to remove starting and trailing whitespace, and the resulting trimmed <token> and\n<value> will appear in the message like this:\n\ntoken: value\n\n\nThis means that the trimmed <token> and <value> will be separated by ': ' (one colon followed\nby one space).\n\nBy default the new trailer will appear at the end of all the existing trailers. If there is\nno existing trailer, the new trailer will appear after the commit message part of the output,\nand, if there is no line with only spaces at the end of the commit message part, one blank\nline will be added before the new trailer.\n\nExisting trailers are extracted from the input message by looking for a group of one or more\nlines that (i) is all trailers, or (ii) contains at least one Git-generated or\nuser-configured trailer and consists of at least 25% trailers. The group must be preceded by\none or more empty (or whitespace-only) lines. The group must either be at the end of the\nmessage or be the last non-whitespace lines before a line that starts with --- (followed by a\nspace or the end of the line). Such three minus signs start the patch part of the message.\nSee also --no-divider below.\n\nWhen reading trailers, there can be whitespaces after the token, the separator and the value.\nThere can also be whitespaces inside the token and the value. The value may be split over\nmultiple lines with each subsequent line starting with whitespace, like the \"folding\" in RFC\n822.\n\nNote that trailers do not follow and are not intended to follow many rules for RFC 822\nheaders. For example they do not follow the encoding rules and probably many other rules.\n\n### OPTIONS\n\n#### --in-place\n\nEdit the files in place.\n\n#### --trim-empty\n\nIf the <value> part of any trailer contains only whitespace, the whole trailer will be\nremoved from the resulting message. This applies to existing trailers as well as new\ntrailers.\n\n--trailer <token>[(=|:)<value>]\nSpecify a (<token>, <value>) pair that should be applied as a trailer to the input\nmessages. See the description of this command.\n\n#### --where <placement>, --no-where\n\nSpecify where all new trailers will be added. A setting provided with --where overrides\nall configuration variables and applies to all --trailer options until the next\noccurrence of --where or --no-where. Possible values are after, before, end or start.\n\n#### --if-exists <action>, --no-if-exists\n\nSpecify what action will be performed when there is already at least one trailer with the\nsame <token> in the message. A setting provided with --if-exists overrides all\nconfiguration variables and applies to all --trailer options until the next occurrence of\n--if-exists or --no-if-exists. Possible actions are addIfDifferent,\naddIfDifferentNeighbor, add, replace and doNothing.\n\n#### --if-missing <action>, --no-if-missing\n\nSpecify what action will be performed when there is no other trailer with the same\n<token> in the message. A setting provided with --if-missing overrides all configuration\nvariables and applies to all --trailer options until the next occurrence of --if-missing\nor --no-if-missing. Possible actions are doNothing or add.\n\n#### --only-trailers\n\nOutput only the trailers, not any other parts of the input.\n\n#### --only-input\n\nOutput only trailers that exist in the input; do not add any from the command-line or by\nfollowing configured trailer.*  rules.\n\n#### --unfold\n\nRemove any whitespace-continuation in trailers, so that each trailer appears on a line by\nitself with its full content.\n\n#### --parse\n\nA convenience alias for --only-trailers --only-input --unfold.\n\n#### --no-divider\n\nDo not treat --- as the end of the commit message. Use this when you know your input\ncontains just the commit message itself (and not an email or the output of git\nformat-patch).\n\n### CONFIGURATION VARIABLES\n\ntrailer.separators\nThis option tells which characters are recognized as trailer separators. By default only\n: is recognized as a trailer separator, except that = is always accepted on the command\nline for compatibility with other git commands.\n\nThe first character given by this option will be the default character used when another\nseparator is not specified in the config for this trailer.\n\nFor example, if the value for this option is \"%=$\", then only lines using the format\n<token><sep><value> with <sep> containing %, = or $ and then spaces will be considered\ntrailers. And % will be the default separator used, so by default trailers will appear\nlike: <token>% <value> (one percent sign and one space will appear between the token and\nthe value).\n\ntrailer.where\nThis option tells where a new trailer will be added.\n\nThis can be end, which is the default, start, after or before.\n\nIf it is end, then each new trailer will appear at the end of the existing trailers.\n\nIf it is start, then each new trailer will appear at the start, instead of the end, of\nthe existing trailers.\n\nIf it is after, then each new trailer will appear just after the last trailer with the\nsame <token>.\n\nIf it is before, then each new trailer will appear just before the first trailer with the\nsame <token>.\n\ntrailer.ifexists\nThis option makes it possible to choose what action will be performed when there is\nalready at least one trailer with the same <token> in the message.\n\nThe valid values for this option are: addIfDifferentNeighbor (this is the default),\naddIfDifferent, add, replace or doNothing.\n\nWith addIfDifferentNeighbor, a new trailer will be added only if no trailer with the same\n(<token>, <value>) pair is above or below the line where the new trailer will be added.\n\nWith addIfDifferent, a new trailer will be added only if no trailer with the same\n(<token>, <value>) pair is already in the message.\n\nWith add, a new trailer will be added, even if some trailers with the same (<token>,\n<value>) pair are already in the message.\n\nWith replace, an existing trailer with the same <token> will be deleted and the new\ntrailer will be added. The deleted trailer will be the closest one (with the same\n<token>) to the place where the new one will be added.\n\nWith doNothing, nothing will be done; that is no new trailer will be added if there is\nalready one with the same <token> in the message.\n\ntrailer.ifmissing\nThis option makes it possible to choose what action will be performed when there is not\nyet any trailer with the same <token> in the message.\n\nThe valid values for this option are: add (this is the default) and doNothing.\n\nWith add, a new trailer will be added.\n\nWith doNothing, nothing will be done.\n\ntrailer.<token>.key\nThis key will be used instead of <token> in the trailer. At the end of this key, a\nseparator can appear and then some space characters. By default the only valid separator\nis :, but this can be changed using the trailer.separators config variable.\n\nIf there is a separator, then the key will be used instead of both the <token> and the\ndefault separator when adding the trailer.\n\ntrailer.<token>.where\nThis option takes the same values as the trailer.where configuration variable and it\noverrides what is specified by that option for trailers with the specified <token>.\n\ntrailer.<token>.ifexists\nThis option takes the same values as the trailer.ifexists configuration variable and it\noverrides what is specified by that option for trailers with the specified <token>.\n\ntrailer.<token>.ifmissing\nThis option takes the same values as the trailer.ifmissing configuration variable and it\noverrides what is specified by that option for trailers with the specified <token>.\n\ntrailer.<token>.command\nThis option behaves in the same way as trailer.<token>.cmd, except that it doesn’t pass\nanything as argument to the specified command. Instead the first occurrence of substring\n$ARG is replaced by the value that would be passed as argument.\n\nThe trailer.<token>.command option has been deprecated in favor of trailer.<token>.cmd\ndue to the fact that $ARG in the user’s command is only replaced once and that the\noriginal way of replacing $ARG is not safe.\n\nWhen both trailer.<token>.cmd and trailer.<token>.command are given for the same <token>,\ntrailer.<token>.cmd is used and trailer.<token>.command is ignored.\n\ntrailer.<token>.cmd\nThis option can be used to specify a shell command that will be called: once to\nautomatically add a trailer with the specified <token>, and then each time a --trailer\n<token>=<value> argument to modify the <value> of the trailer that this option would\nproduce.\n\nWhen the specified command is first called to add a trailer with the specified <token>,\nthe behavior is as if a special --trailer <token>=<value> argument was added at the\nbeginning of the \"git interpret-trailers\" command, where <value> is taken to be the\nstandard output of the command with any leading and trailing whitespace trimmed off.\n\nIf some --trailer <token>=<value> arguments are also passed on the command line, the\ncommand is called again once for each of these arguments with the same <token>. And the\n<value> part of these arguments, if any, will be passed to the command as its first\nargument. This way the command can produce a <value> computed from the <value> passed in\nthe --trailer <token>=<value> argument.\n\n### EXAMPLES\n\n•   Configure a sign trailer with a Signed-off-by key, and then add two of these trailers to\na message:\n\n$ git config trailer.sign.key \"Signed-off-by\"\n$ cat msg.txt\nsubject\n\nmessage\n$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>'\nsubject\n\nmessage\n\nSigned-off-by: Alice <alice@example.com>\nSigned-off-by: Bob <bob@example.com>\n\n\n•   Use the --in-place option to edit a message file in place:\n\n$ cat msg.txt\nsubject\n\nmessage\n\nSigned-off-by: Bob <bob@example.com>\n$ git interpret-trailers --trailer 'Acked-by: Alice <alice@example.com>' --in-place msg.txt\n$ cat msg.txt\nsubject\n\nmessage\n\nSigned-off-by: Bob <bob@example.com>\nAcked-by: Alice <alice@example.com>\n\n\n•   Extract the last commit as a patch, and add a Cc and a Reviewed-by trailer to it:\n\n$ git format-patch -1\n0001-foo.patch\n$ git interpret-trailers --trailer 'Cc: Alice <alice@example.com>' --trailer 'Reviewed-by: Bob <bob@example.com>' 0001-foo.patch >0001-bar.patch\n\n\n•   Configure a sign trailer with a command to automatically add a 'Signed-off-by: ' with the\nauthor information only if there is no 'Signed-off-by: ' already, and show how it works:\n\n$ git config trailer.sign.key \"Signed-off-by: \"\n$ git config trailer.sign.ifmissing add\n$ git config trailer.sign.ifexists doNothing\n$ git config trailer.sign.command 'echo \"$(git config user.name) <$(git config user.email)>\"'\n$ git interpret-trailers <<EOF\n> EOF\n\nSigned-off-by: Bob <bob@example.com>\n$ git interpret-trailers <<EOF\n> Signed-off-by: Alice <alice@example.com>\n> EOF\n\nSigned-off-by: Alice <alice@example.com>\n\n\n•   Configure a fix trailer with a key that contains a # and no space after this character,\nand show how it works:\n\n$ git config trailer.separators \":#\"\n$ git config trailer.fix.key \"Fix #\"\n$ echo \"subject\" | git interpret-trailers --trailer fix=42\nsubject\n\nFix #42\n\n\n•   Configure a help trailer with a cmd use a script glog-find-author which search specified\nauthor identity from git log in git repository and show how it works:\n\n$ cat ~/bin/glog-find-author\n#!/bin/sh\ntest -n \"$1\" && git log --author=\"$1\" --pretty=\"%an <%ae>\" -1 || true\n$ git config trailer.help.key \"Helped-by: \"\n$ git config trailer.help.ifExists \"addIfDifferentNeighbor\"\n$ git config trailer.help.cmd \"~/bin/glog-find-author\"\n$ git interpret-trailers --trailer=\"help:Junio\" --trailer=\"help:Couder\" <<EOF\n> subject\n>\n> message\n>\n> EOF\nsubject\n\nmessage\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: Christian Couder <christian.couder@gmail.com>\n\n\n•   Configure a ref trailer with a cmd use a script glog-grep to grep last relevant commit\nfrom git log in the git repository and show how it works:\n\n$ cat ~/bin/glog-grep\n#!/bin/sh\ntest -n \"$1\" && git log --grep \"$1\" --pretty=reference -1 || true\n$ git config trailer.ref.key \"Reference-to: \"\n$ git config trailer.ref.ifExists \"replace\"\n$ git config trailer.ref.cmd \"~/bin/glog-grep\"\n$ git interpret-trailers --trailer=\"ref:Add copyright notices.\" <<EOF\n> subject\n>\n> message\n>\n> EOF\nsubject\n\nmessage\n\nReference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)\n\n\n•   Configure a see trailer with a command to show the subject of a commit that is related,\nand show how it works:\n\n$ git config trailer.see.key \"See-also: \"\n$ git config trailer.see.ifExists \"replace\"\n$ git config trailer.see.ifMissing \"doNothing\"\n$ git config trailer.see.command \"git log -1 --oneline --format=\\\"%h (%s)\\\" --abbrev-commit --abbrev=14 \\$ARG\"\n$ git interpret-trailers <<EOF\n> subject\n>\n> message\n>\n> see: HEAD~2\n> EOF\nsubject\n\nmessage\n\nSee-also: fe3187489d69c4 (subject of related commit)\n\n\n•   Configure a commit template with some trailers with empty values (using sed to show and\nkeep the trailing spaces at the end of the trailers), then configure a commit-msg hook\nthat uses git interpret-trailers to remove trailers with empty values and to add a\ngit-version trailer:\n\n$ sed -e 's/ Z$/ /' >committemplate.txt <<EOF\n> *subject*\n>\n> *message*\n>\n> Fixes: Z\n> Cc: Z\n> Reviewed-by: Z\n> Signed-off-by: Z\n> EOF\n$ git config commit.template committemplate.txt\n$ cat >.git/hooks/commit-msg <<EOF\n> #!/bin/sh\n> git interpret-trailers --trim-empty --trailer \"git-version: \\$(git describe)\" \"\\$1\" > \"\\$1.new\"\n> mv \"\\$1.new\" \"\\$1\"\n> EOF\n$ chmod +x .git/hooks/commit-msg\n\n### SEE ALSO\n\ngit-commit(1), git-format-patch(1), git-config(1)\n\n### GIT\n\nPart of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                        GIT-INTERPRET-TRAI(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "git-interpret-trailers",
        "section": "1",
        "mode": "man",
        "summary": "git-interpret-trailers - Add or parse structured information in commit messages",
        "synopsis": "git interpret-trailers [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]\ngit interpret-trailers [<options>] [--parse] [<file>...]",
        "flags": [
            {
                "flag": "",
                "long": "--in-place",
                "arg": null,
                "description": "Edit the files in place."
            },
            {
                "flag": "",
                "long": "--trim-empty",
                "arg": null,
                "description": "If the <value> part of any trailer contains only whitespace, the whole trailer will be removed from the resulting message. This applies to existing trailers as well as new trailers. --trailer <token>[(=|:)<value>] Specify a (<token>, <value>) pair that should be applied as a trailer to the input messages. See the description of this command."
            },
            {
                "flag": "",
                "long": "--no-where",
                "arg": "<placement>",
                "description": "Specify where all new trailers will be added. A setting provided with --where overrides all configuration variables and applies to all --trailer options until the next occurrence of --where or --no-where. Possible values are after, before, end or start."
            },
            {
                "flag": "",
                "long": "--no-if-exists",
                "arg": "<action>",
                "description": "Specify what action will be performed when there is already at least one trailer with the same <token> in the message. A setting provided with --if-exists overrides all configuration variables and applies to all --trailer options until the next occurrence of --if-exists or --no-if-exists. Possible actions are addIfDifferent, addIfDifferentNeighbor, add, replace and doNothing."
            },
            {
                "flag": "",
                "long": "--no-if-missing",
                "arg": "<action>",
                "description": "Specify what action will be performed when there is no other trailer with the same <token> in the message. A setting provided with --if-missing overrides all configuration variables and applies to all --trailer options until the next occurrence of --if-missing or --no-if-missing. Possible actions are doNothing or add."
            },
            {
                "flag": "",
                "long": "--only-trailers",
                "arg": null,
                "description": "Output only the trailers, not any other parts of the input."
            },
            {
                "flag": "",
                "long": "--only-input",
                "arg": null,
                "description": "Output only trailers that exist in the input; do not add any from the command-line or by following configured trailer.* rules."
            },
            {
                "flag": "",
                "long": "--unfold",
                "arg": null,
                "description": "Remove any whitespace-continuation in trailers, so that each trailer appears on a line by itself with its full content."
            },
            {
                "flag": "",
                "long": "--parse",
                "arg": null,
                "description": "A convenience alias for --only-trailers --only-input --unfold."
            },
            {
                "flag": "",
                "long": "--no-divider",
                "arg": null,
                "description": "Do not treat --- as the end of the commit message. Use this when you know your input contains just the commit message itself (and not an email or the output of git format-patch)."
            }
        ],
        "examples": [
            "•   Configure a sign trailer with a Signed-off-by key, and then add two of these trailers to",
            "a message:",
            "$ git config trailer.sign.key \"Signed-off-by\"",
            "$ cat msg.txt",
            "subject",
            "message",
            "$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>'",
            "subject",
            "message",
            "Signed-off-by: Alice <alice@example.com>",
            "Signed-off-by: Bob <bob@example.com>",
            "•   Use the --in-place option to edit a message file in place:",
            "$ cat msg.txt",
            "subject",
            "message",
            "Signed-off-by: Bob <bob@example.com>",
            "$ git interpret-trailers --trailer 'Acked-by: Alice <alice@example.com>' --in-place msg.txt",
            "$ cat msg.txt",
            "subject",
            "message",
            "Signed-off-by: Bob <bob@example.com>",
            "Acked-by: Alice <alice@example.com>",
            "•   Extract the last commit as a patch, and add a Cc and a Reviewed-by trailer to it:",
            "$ git format-patch -1",
            "0001-foo.patch",
            "$ git interpret-trailers --trailer 'Cc: Alice <alice@example.com>' --trailer 'Reviewed-by: Bob <bob@example.com>' 0001-foo.patch >0001-bar.patch",
            "•   Configure a sign trailer with a command to automatically add a 'Signed-off-by: ' with the",
            "author information only if there is no 'Signed-off-by: ' already, and show how it works:",
            "$ 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",
            "Signed-off-by: Bob <bob@example.com>",
            "$ git interpret-trailers <<EOF",
            "> Signed-off-by: Alice <alice@example.com>",
            "> EOF",
            "Signed-off-by: Alice <alice@example.com>",
            "•   Configure a fix trailer with a key that contains a # and no space after this character,",
            "and show how it works:",
            "$ git config trailer.separators \":#\"",
            "$ git config trailer.fix.key \"Fix #\"",
            "$ echo \"subject\" | git interpret-trailers --trailer fix=42",
            "subject",
            "Fix #42",
            "•   Configure a help trailer with a cmd use a script glog-find-author which search specified",
            "author identity from git log in git repository and show how it works:",
            "$ cat ~/bin/glog-find-author",
            "#!/bin/sh",
            "test -n \"$1\" && git log --author=\"$1\" --pretty=\"%an <%ae>\" -1 || true",
            "$ 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",
            "subject",
            "message",
            "Helped-by: Junio C Hamano <gitster@pobox.com>",
            "Helped-by: Christian Couder <christian.couder@gmail.com>",
            "•   Configure a ref trailer with a cmd use a script glog-grep to grep last relevant commit",
            "from git log in the git repository and show how it works:",
            "$ cat ~/bin/glog-grep",
            "#!/bin/sh",
            "test -n \"$1\" && git log --grep \"$1\" --pretty=reference -1 || true",
            "$ 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",
            "subject",
            "message",
            "Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)",
            "•   Configure a see trailer with a command to show the subject of a commit that is related,",
            "and show how it works:",
            "$ 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",
            "subject",
            "message",
            "See-also: fe3187489d69c4 (subject of related commit)",
            "•   Configure a commit template with some trailers with empty values (using sed to show and",
            "keep the trailing spaces at the end of the trailers), then configure a commit-msg hook",
            "that uses git interpret-trailers to remove trailers with empty values and to add a",
            "git-version trailer:",
            "$ sed -e 's/ Z$/ /' >committemplate.txt <<EOF",
            "> *subject*",
            "> *message*",
            "> Fixes: Z",
            "> Cc: Z",
            "> Reviewed-by: Z",
            "> Signed-off-by: Z",
            "> EOF",
            "$ git config commit.template committemplate.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",
            "$ chmod +x .git/hooks/commit-msg"
        ],
        "see_also": [
            {
                "name": "git-commit",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-commit/1/json"
            },
            {
                "name": "git-format-patch",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-format-patch/1/json"
            },
            {
                "name": "git-config",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-config/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 47,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--in-place",
                        "lines": 2,
                        "long": "--in-place"
                    },
                    {
                        "name": "--trim-empty",
                        "lines": 8,
                        "long": "--trim-empty"
                    },
                    {
                        "name": "--where <placement>, --no-where",
                        "lines": 4,
                        "long": "--no-where",
                        "arg": "<placement>"
                    },
                    {
                        "name": "--if-exists <action>, --no-if-exists",
                        "lines": 6,
                        "long": "--no-if-exists",
                        "arg": "<action>"
                    },
                    {
                        "name": "--if-missing <action>, --no-if-missing",
                        "lines": 5,
                        "long": "--no-if-missing",
                        "arg": "<action>"
                    },
                    {
                        "name": "--only-trailers",
                        "lines": 2,
                        "long": "--only-trailers"
                    },
                    {
                        "name": "--only-input",
                        "lines": 3,
                        "long": "--only-input"
                    },
                    {
                        "name": "--unfold",
                        "lines": 3,
                        "long": "--unfold"
                    },
                    {
                        "name": "--parse",
                        "lines": 2,
                        "long": "--parse"
                    },
                    {
                        "name": "--no-divider",
                        "lines": 4,
                        "long": "--no-divider"
                    }
                ]
            },
            {
                "name": "CONFIGURATION VARIABLES",
                "lines": 112,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 161,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}