什么是我可以在--format选项中使用的有效git字段 [英] What are valid git fields that I can use in --format option

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

问题描述

我试图找到在资源库上创建的第一个分支。为此,我使用了:

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



然而,我想了解更多关于这个分支的信息。 I.e这个分支住了多久,何时合并回主干线等。
是否有一个可用的字段选项列表?我尝试了很多搜索引擎,但找不到任何东西。



谢谢 解决方案

我在git存储库上找到了一个字段列表,文件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},
};


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.

Thanks

解决方案

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" },
};

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

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