Re: git name-rev for fun and profit (Re: [PATCH] t/: work around one-shot variable assignment with test_must_fail)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 21, 2010 at 01:05, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>
>> As an aside, how do you make these 61-commits-after-rc0 commit ids. Is
>> there a sha1->that tool that I haven't spotted?
>
>  GIT_PAGER_IN_USE=1 git log --all-match --grep=shell --grep=export |
>  git -p name-rev --tags --stdin
>
> v1.5.6-rc0~61 is 61 commits before rc0 (well, the 61st-generation
> grandparent using the first parent where there is a choice).  The
> distinction matters because “61 commits _after_ 1.5.6-rc0” is not
> well-defined.

Thanks, added that as an alias in my .gitconfig:

        abbrev-commit = "!f() { git name-rev --tags \"$@\" | sed
's|.*tags/||;s|\\([0-9a-f]\\{7\\}\\).*|\\1|'; }; f"

> If you want the latter sort of description anyway, ‘git describe’
> might help.

git describe was actually more like what I wanted. I'd used it before,
but forgotten it. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]