git for-each-ref的--format选项的有效字段是什么? [英] What are valid fields for the --format option of git for-each-ref?

查看:588
本文介绍了git for-each-ref的--format选项的有效字段是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到在存储库上创建的第一个分支.为此,我使用了:

I am trying to find the first branch that was created on a repository. To do so I used:

git for-each-ref --sort=commiterdate --format='%(commiterdate:short) %(refname:short)' --count=1

但是我想要有关该分支的更多信息.即该分支生存了多长时间,何时合并回主干等. 某处是否有可用的字段选项列表?我尝试了很多次谷歌搜索,但找不到任何东西.

However I want more information on this branch. I.e how long this branch lived, when was it merged back to the master trunk etc. Is there a list of field options available somewhere? I tried googling a lot but couldn't find anything.

推荐答案

我在git存储库中找到了一个字段列表,

I've found a field list on git repository, file builtin/for-each-ref.c:

} valid_atom[] = {
    { "refname" },
    { "objecttype" },
    { "objectsize", FIELD_ULONG },
    { "objectname" },
    { "tree" },
    { "parent" },
    { "numparent", FIELD_ULONG },
    { "object" },
    { "type" },
    { "tag" },
    { "author" },
    { "authorname" },
    { "authoremail" },
    { "authordate", FIELD_TIME },
    { "committer" },
    { "committername" },
    { "committeremail" },
    { "committerdate", FIELD_TIME },
    { "tagger" },
    { "taggername" },
    { "taggeremail" },
    { "taggerdate", FIELD_TIME },
    { "creator" },
    { "creatordate", FIELD_TIME },
    { "subject" },
    { "body" },
    { "contents" },
    { "contents:subject" },
    { "contents:body" },
    { "contents:signature" },
    { "upstream" },
    { "symref" },
    { "flag" },
    { "HEAD" },
    { "color" },
};

这篇关于git for-each-ref的--format选项的有效字段是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆