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

ディレクトリ 検索
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
テキスト

命名

git-for-each-ref  - 每個(gè)參考的輸出信息

概要

git for-each-ref [--count=<count>] [--shell|--perl|--python|--tcl]                   [(--sort=<key>)…] [--format=<format>] [<pattern>…]                   [--points-at=<object>]                   (--merged[=<object>] | --no-merged[=<object>])                   [--contains[=<object>]] [--no-contains[=<object>]]

描述

迭代所有匹配的ref <pattern>并根據(jù)給定的值顯示它們<format>,然后根據(jù)給定的集合對(duì)它們進(jìn)行排序<key>。如果<count>給出,請(qǐng)?jiān)陲@示多個(gè)參考后停止。插入的值<format>可以選擇性地作為指定宿主語言中的字符串文本引用,以便用該語言直接進(jìn)行評(píng)估。

選項(xiàng)

<pattern>…

如果給出了一個(gè)或多個(gè)模式,則只顯示與至少一個(gè)模式相匹配的引用,或者使用fnmatch(3)或從字面上匹配,在后一種情況下完全匹配或從開始直到斜杠。

--count=<count>

默認(rèn)情況下,該命令顯示所有匹配的參考<pattern>。該選項(xiàng)會(huì)在顯示多個(gè)參考文件后停止。

--sort=<key>

要排序的字段名稱。前綴-按值的降序進(jìn)行排序。未指定時(shí)refname使用。您可以多次使用--sort = <key>選項(xiàng),在這種情況下,最后一個(gè)鍵變?yōu)橹麈I。

--format=<format>

一個(gè)字符串,%(fieldname)從顯示的ref和它指向的對(duì)象中插入。如果fieldname前綴為asterisk(*)并且ref指向標(biāo)記對(duì)象,則使用標(biāo)記對(duì)象引用的對(duì)象中的字段的值(而不是標(biāo)記對(duì)象中的字段)。未指定時(shí),<format>默認(rèn)為%(objectname) SPC %(objecttype) TAB %(refname)。它還插值%%%,和%xx其中xx是十六進(jìn)制數(shù)字插值以十六進(jìn)制碼字符xx; 例如%00內(nèi)插到\0(NUL),%09\t(TAB)和%0a\n(LF)。

--color = <when>:尊重--format選項(xiàng)中指定的任何顏色。該<when>字段必須是中的一個(gè)always,never或者auto(如果<when>不存在,表現(xiàn)得好像always給予)。

--shell   --perl   --python   --tcl

如果給定,則替換%(fieldname)占位符的字符串將被引用為適用于指定主機(jī)語言的字符串文字。這是為了產(chǎn)生一個(gè)可以直接eval編輯的scriptlet 。

--points-at=<object>

只列出指向給定對(duì)象的ref。

--merged=<object>

只列出其提示可從指定提交(HEAD,如果未指定)可訪問的ref,與不兼容--no-merged

--no-merged=<object>

只列出其提示無法從指定提交(HEAD,如果未指定)到達(dá)的ref,與之不兼容--merged

--contains=<object>

只列出包含指定提交的引用(如果未指定,則為HEAD)。

--no-contains=<object>

只列出不包含指定提交的引用(如果未指定,則為HEAD)。

--ignore-case

排序和過濾ref是不區(qū)分大小寫的。

字段名稱

引用對(duì)象中結(jié)構(gòu)化字段的各種值可用于內(nèi)插到結(jié)果輸出中,或作為排序鍵。

對(duì)于所有對(duì)象,可以使用以下名稱:

refname

參考名稱($ GIT_DIR /之后的部分)。對(duì)于ref的append不含糊不清的短名稱:short。選項(xiàng)core.warnAmbiguousRefs用于選擇嚴(yán)格的縮寫模式。如果lstrip=<N>rstrip=<N>)將被附加,條<N>斜線分隔徑分量從refname的前部(背面)(例如%(refname:lstrip=2)變成refs/tags/foofoo%(refname:rstrip=2)轉(zhuǎn)動(dòng)refs/tags/foorefs)。如果<N>是一個(gè)負(fù)數(shù),從指定的端部帶一樣多路徑成分作為必要離開-<N>路徑組件(例如%(refname:lstrip=-2)變成refs/tags/footags/foo%(refname:rstrip=-1)導(dǎo)通refs/tags/foorefs)。當(dāng)ref沒有足夠的組件時(shí),如果使用正數(shù)<N>剝離,結(jié)果將變?yōu)榭兆址?,或者如果使用?fù)數(shù)<N>剝離,則結(jié)果變?yōu)橥暾膔efname。兩者都不是錯(cuò)誤。

strip可以作為synomym來使用lstrip。

objecttype

類型的對(duì)象的(blob,tree,committag)。

objectsize

對(duì)象的大?。ㄅcgit cat-file -s報(bào)告相同)。

objectname

對(duì)象名稱(又名SHA-1)。對(duì)于對(duì)象名稱的非模糊縮寫追加:short。對(duì)于具有所需長(zhǎng)度的對(duì)象名稱的縮寫append :short=<length>,其中最小長(zhǎng)度為MINIMUM_ABBREV。長(zhǎng)度可能會(huì)超過以確保唯一的對(duì)象名稱。

upstream

顯示的參考文獻(xiàn)中可以考慮為“上游”的本地參考文獻(xiàn)的名稱。尊重:short:lstrip:rstrip以與refname上述相同的方式。此外,:track還要顯示“前N,后M”并:trackshort顯示簡(jiǎn)短版本:“>”(前面),“<”(后面),“<>”(前后)或“=”(同步) 。:track當(dāng)遇到未知的上游參考時(shí)也打印“消失”。追加:track,nobracket顯示無括號(hào)的追蹤信息(即“前N,后M”)。如果裁判沒有跟蹤信息,則不起作用。所有選項(xiàng)除外nobracket是互斥的,但如果一起使用,則選擇最后一個(gè)選項(xiàng)。

push

代表@{push}所顯示文獻(xiàn)位置的本地參考文獻(xiàn)的名稱。尊重:short:lstrip,:rstrip,:track,和:trackshort選項(xiàng)upstream呢。如果未@{push}配置ref,則生成一個(gè)空字符串。

HEAD

* 如果HEAD與當(dāng)前參考(已簽出的分支)匹配,則返回“否則”。

color

更改輸出顏色。接下來:<colorname>,在git-config [1]的“CONFIGURATION FILE”部分的Values下描述顏色名稱。例如,%(color:bold red)

align

將%(align:...)和%(end)之間的內(nèi)容左對(duì)齊,中對(duì)齊或右對(duì)齊。該“對(duì)齊”之后width=<width>position=<position>在用逗號(hào),其中所分離的任何次序<position>要么左,右或中間,被留默認(rèn)和<width>與對(duì)準(zhǔn)的內(nèi)容的總長(zhǎng)度。為簡(jiǎn)潔起見,可以省略“width =”和/或“position =”前綴,而使用<width>和<位置>。例如,%(align:<width>,<position>)。如果內(nèi)容長(zhǎng)度大于寬度,則不執(zhí)行對(duì)齊。如果使用--quote%(align:...)和%(end)之間的所有內(nèi)容進(jìn)行引用,但是如果嵌套,則只有最頂層執(zhí)行引用。

if

用作%(if)...%(then)...%(end)或%(if)...%(then)...%(else)...%(end)。如果在%(if)之后有值或字符串的原子,則%(then)后面的所有內(nèi)容都將被打印,否則如果使用%(else)原子,則打?。ィ╡lse)后的所有內(nèi)容。當(dāng)在%(then)之前評(píng)估字符串時(shí),我們會(huì)忽略空格,當(dāng)我們使用打印“*”或“”的%(HEAD)原子時(shí),這很有用,我們只想將該if條件應(yīng)用于HEADref。追加“:等于= <字符串>”或“:notequals = <字符串>”以比較%(如果......)和%(然后)原子與給定字符串之間的值。

symref

給定的符號(hào)ref引用的ref。如果不是符號(hào)參考,則不會(huì)打印任何內(nèi)容。尊重:short:lstrip:rstrip在為同樣的方式選擇refname以上。

除了上述之外,用于提交和標(biāo)簽對(duì)象,報(bào)頭字段名(tree,parent,object,type,和tag)可以被用來指定在報(bào)頭字段中的值。

對(duì)于提交和標(biāo)記對(duì)象,特殊字段creatordatecreator字段將根據(jù)對(duì)象類型與committertagger字段中的相應(yīng)日期或名稱 - 電子郵件日期元組相對(duì)應(yīng)。這些旨在用于混合使用注釋和輕量級(jí)標(biāo)簽。

有名字的電子郵件最新的元組作為其值的字段(author,committer,和tagger)可以與后綴name,email以及date提取命名組件。

提交和標(biāo)簽對(duì)象中的完整消息是contents。它的第一行是contents:subject,主題是提交消息的所有行連接到第一個(gè)空白行。接下來的一行是contents:body,body是第一個(gè)空白行之后的所有行??蛇x的GPG簽名是contents:signature。N消息的第一行是使用獲得的contents:lines=N。此外,由git-interpret-trailers [1]解釋的預(yù)告片也可以獲得contents:trailers。

用于排序目的,與字段排序按數(shù)值順序排列的數(shù)字值(objectsizeauthordate,committerdate,creatordate,taggerdate)。所有其他字段都用于按字節(jié)值順序排序。

還有一個(gè)選項(xiàng)可以按版本排序,這可以通過使用字段名version:refname或其別名來完成v:refname

在任何情況下,引用不適用于由ref引用的對(duì)象的字段的字段名稱都不會(huì)導(dǎo)致錯(cuò)誤。它返回一個(gè)空字符串。

作為日期類型字段的特殊情況,您可以通過添加:日期格式名稱來指定日期格式(請(qǐng)參閱--dategit-rev-list [1]選項(xiàng)的值)。

像%(align)和%(if)這樣的一些原子總是需要匹配的%(end)。我們稱之為“開放原子”,有時(shí)將它們表示為%($ open)。

當(dāng)腳本語言特定的引用有效時(shí),根據(jù)開放原子的語義評(píng)估頂級(jí)開放原子與其匹配的%(end)之間的所有內(nèi)容,并僅引用頂級(jí)結(jié)果。

例子

直接生成格式化文本的示例。顯示最近3個(gè)標(biāo)記的提交:

#!/bin/sh

git for-each-ref --count=3 --sort='-*authordate' \--format='From: %(*authorname) %(*authoremail)Subject: %(*subject)Date: %(*authordate)Ref: %(*refname)%(*body)' 'refs/tags'

一個(gè)簡(jiǎn)單的例子,顯示了在輸出中使用shell eval,展示了--shell的使用。列出所有頭的前綴:

#!/bin/sh

git for-each-ref --shell --format="ref=%(refname)" refs/heads | \while read entrydo
        eval "$entry"
        echo `dirname $ref`done

更詳細(xì)的標(biāo)簽報(bào)告,證明格式可能是整個(gè)腳本:

#!/bin/sh

fmt='
        r=%(refname)
        t=%(*objecttype)
        T=${r#refs/tags/}

        o=%(*objectname)
        n=%(*authorname)
        e=%(*authoremail)
        s=%(*subject)
        d=%(*authordate)
        b=%(*body)

        kind=Tag        if test "z$t" = z
        then
                # could be a lightweight tag
                t=%(objecttype)
                kind="Lightweight tag"
                o=%(objectname)
                n=%(authorname)
                e=%(authoremail)
                s=%(subject)
                d=%(authordate)
                b=%(body)
        fi
        echo "$kind $T points at a $t object $o"        if test "z$t" = zcommit
        then
                echo "The commit was authored by $n $e
at $d, and titled

    $s

Its message reads as:"
                echo "$b" | sed -e "s/^/    /"
                echo
        fi
'

eval=`git for-each-ref --shell --format="$fmt" \
        --sort='*objecttype' \
        --sort=-taggerdate \
        refs/tags`eval "$eval"

示例顯示%(if)...%(then)...%(else)...%(end)的用法。這以當(dāng)前分支為前綴。

git for-each-ref --format="%(if)%(HEAD)%(then)* %(else)  %(end)%(refname:short)" refs/heads/

顯示%(if)...%(then)...%(end)的用法的示例。這將打印作者名稱(如果存在)。

git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Authored by: %(authorname)%(end)"
前の記事: 次の記事: