亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
characters

名稱

git-interpret-trailers  - 幫助將結構化信息添加到提交消息中

概要

git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])…] [<file>…]

描述

在提交消息的其他自由格式部分的末尾,幫助添加與RFC 822電子郵件標題類似的trailers行。

如果沒有指定<file>,該命令將從<file>參數(shù)或標準輸入讀取一些補丁或提交消息。然后該命令將使用該--trailer選項傳遞的參數(shù)(如果有)應用于每個輸入文件的提交消息部分。結果發(fā)送到標準輸出。

一些配置變量控制--trailer參數(shù)應用于每個提交消息的方式以及提交消息中任何現(xiàn)有的尾部改變的方式。他們還可以自動添加一些預告片。

默認情況下,一個<token>=<value><token>:<value>利用給定的參數(shù)--trailer在現(xiàn)有拖車之后將附加僅當最后拖車具有不同的(<令牌>,<值>)對(或如果不存在現(xiàn)有拖車)。<token>和<value>部分將被修剪以刪除開始和結尾的空白,并且生成的修剪后的<token>和<value>將出現(xiàn)在消息中,如下所示:

token: value

這意味著修剪后的<token>和<value>將被分隔': '(一個冒號后跟一個空格)。

默認情況下,新的預告片將出現(xiàn)在所有現(xiàn)有預告片的末尾。如果沒有現(xiàn)有的預告片,則新的預告片將出現(xiàn)在輸出的提交消息部分之后,并且如果在提交消息部分末尾沒有只有空格的行,則在新預告片之前將添加一個空白行。

通過查找一組一條或多條(i)都是預告片,或(ii)至少包含一個由 Git 生成或用戶配置的預告片并由至少25%預告片組成的一組或多行的線,從輸入消息中提取現(xiàn)有預告片。該組必須在一個或多個空白(或僅空白)行之前。該組必須位于消息的末尾,或者是以一行開頭的行之前的最后一個非空白行---。這三個減號開始消息的補丁部分。

閱讀預告片時,令牌,分隔符和值之后可能有空格。標記和值中還可能有空格。該值可以分成多行,每個后續(xù)行以空格開頭,如 RFC 822中的“折疊”。

請注意,trailers不要遵循并且不打算遵循 RFC 822標頭的許多規(guī)則。例如,他們不遵循編碼規(guī)則和其他許多規(guī)則。

選項

--in-place

編輯文件。

--trim-empty

如果任何預告片的<value>部分只包含空格,則整個預告片將從結果消息中刪除。這適用于現(xiàn)有的拖車以及新的拖車。

--trailer <token>(=|:)<value>

指定應作為尾部應用于輸入消息的(<token>,<value>)對。請參閱此命令的說明。

配置變量

trailer.separators

該選項告訴哪些字符被識別為拖車分隔符。默認情況下,只有:被識別為一個尾部分隔符,除了=在命令行上始終接受,以便與其他 git 命令兼容。

此選項給出的第一個字符將是當此預告片的配置中未指定另一個分隔符時使用的默認字符。

例如,如果此選項的值是“(%)= $”,則僅使用格式線<token><sep><value>與<月>含%,=$然后空格將被視為拖車。并且%將作為默認分隔符,因此默認拖放器將顯示為:(<token>% <value>一個百分號和一個空格將出現(xiàn)在令牌和值之間)。

trailer.where

這個選項告訴將添加一個新的預告片。

這可以是end,這是默認的startafter或者before。

如果是end,則每個新的預告片將出現(xiàn)在現(xiàn)有預告片的末尾。

如果是start,則每個新的預告片將出現(xiàn)在現(xiàn)有預告片的開始而不是結尾。

如果是after,則每個新的預告片將在具有相同<令牌>的最后一個預告片之后出現(xiàn)。

如果是before,則每個新的預告片將在具有相同的<令牌>的第一個預告片之前出現(xiàn)。

trailer.ifexists

此選項可以選擇在消息中至少有一個具有相同<token>的預告片時執(zhí)行的操作。

此選項的有效值是:addIfDifferentNeighbor(這是默認), addIfDifferent ,addreplacedoNothing。

使用時addIfDifferentNeighbor,只有在沒有相同(<token>,<value>)對的拖車位于新拖車添加行的上方或下方時,才會添加新拖車。

使用時addIfDifferent,只有在消息中沒有具有相同(<token>,<value>)對的尾部時,才會添加新預告片。

隨著add,即使一些具有相同(<token>,<value>)對的預告片已經在消息中,也會添加新的預告片。

同時replace,具有相同<令牌>的現(xiàn)有預告片將被刪除,新預告片將被添加。已刪除的預告片將是最接近的一個(具有相同的<令牌>)以添加新的預告片。

隨著doNothing,什么都不會做;如果消息中已經有一個具有相同的<token>,則不會添加新的預告片。

trailer.ifmissing

通過此選項,可以選擇在消息中還沒有具有相同<token>的任何預告片時執(zhí)行的操作。

此選項的有效值為:add(是默認值)和doNothing。

隨著add,一個新的預告片將被添加。

隨著doNothing,什么都不會做。

trailer.<token>.key

key將在預告片中用來代替<token>。在這個鍵的最后,可以出現(xiàn)分隔符,然后出現(xiàn)一些空格字符。默認情況下,唯一有效的分隔符是:,但可以使用trailer.separatorsconfig變量更改。

如果有分隔符,則在添加預告片時,將使用該鍵代替<token>和默認分隔符。

trailer.<token>.where

此選項采用與trailer.where配置變量相同的值,并覆蓋具有指定<token>的拖車的該選項指定的內容。

trailer.<token>.ifexist

此選項采用與trailer.ifexist配置變量相同的值,并覆蓋具有指定<token>的拖車的該選項指定的內容。

trailer.<token>.ifmissing

此選項采用與trailer.ifmissing配置變量相同的值,并覆蓋具有指定<token>的拖車的該選項指定的內容。

trailer.<token>.command

該選項可用于指定將被調用以自動添加或修改具有指定的<token>的尾部的 shell 命令。

如果指定了此選項,則行為就好像<token>=<value>在命令行的開始處添加了一個特殊參數(shù),其中<value>將被視為指定命令的標準輸出,并且任何前導和尾隨空格都將被裁掉。

如果命令包含$ARG字符串,則在命令啟動之前,該字符串將替換為具有相同<標記>的現(xiàn)有預告片的<值>部分(如果有)。

如果某些<token>=<value>參數(shù)也通過命令行傳遞,trailer.<token>.command則配置a時,也會為每個參數(shù)執(zhí)行該命令。并且這些參數(shù)的<value>部分(如果有的話)將用于替換$ARG命令中的字符串。

示例

  • sign使用Signed-off-by密鑰配置預告片,然后將兩個預告片添加到消息中:$ git config trailer.sign.key“Signed-off-by”$ cat msg.txt主題消息$ cat msg.txt | git interpret-trailers --trailer'sign:Alice alice@example.com '--trailer'sign:Bob bob@example.com'subject message簽名:Alice alice@example.com簽名:鮑勃bob@example.com

  • 使用該--in-place選項即可編輯消息文件:

$ cat msg.txt主題信息簽名:Bob bob@example.com $ git interpret-trailers --trailer'Acked-by:Alice alice@example.com'--in-place msg.txt $ cat msg .txt主題消息簽名:Bob bob@example.com Acked-by:Alice alice@example.com

  • 提取最后一次提交的補丁,并添加CcReviewed-by拖車到它:$ git的格式補丁-1 0001-foo.patch $ git的解釋拖車--trailer“抄送:愛麗絲alice@example.com ” --trailer '評論者:Bob bob@example.com'0001-foo.patch > 0001-bar.patch

  • sign只有當沒有'Signed-off-by:'時,才會使用命令配置尾部,以自動添加'Signed-off-by:'和作者信息,并顯示其工作原理:

$ 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

  • 在這個字符后面配置一個fix包含一個#沒有空格的鍵的尾部,并顯示它的工作原理:$ git config trailer.separators“:?!? git config trailer.fix.key“Fix?!? echo“subject”| git interpret-trailers --trailer fix = 42主題修復#42

  • see使用命令配置尾部以顯示相關提交的主題,并顯示其工作原理:

$ git config trailer.see.key“另請參閱:”$ git config trailer.see.ifExists“替換”$ 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>>請參閱:HEAD?2 > EOF主題信息也參見:fe3187489d69c4(相關提交的主題)

  • 使用一些空值的預告片配置提交模板(使用 sed 在預告結束處顯示并保留尾部空格),然后配置一個git interpret-trailers用于刪除空值預告片的提交消息鉤子并添加git-version預告片:

$ sed -e 's/ Z$/ /' >commit_template.txt <<EOF > ***subject*** > > ***message*** > > Fixes: Z > Cc: Z > Reviewed-by: Z > Signed-off-by: Z > EOF $ 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 $ chmod +x .git/hooks/commit-msg

Previous article: Next article: