Re: showing SHA1 of parent commit in tig [was Re: [ANNOUNCE] tig-0.14
- From
Jonas Fonseca <jonas.fonseca@gmail.com>
- Date
- Feb 12, 2009, 01:19 UTC
- Message-ID
- <2c6b72b30902111719r6fd25dc7uc22b471f7904bedc@mail.gmail.com>
- In-Reply-To
- <slrngp5tqk.u46.sitaramc@sitaramc.homelinux.net>
On Wed, Feb 11, 2009 at 17:05, Sitaram Chamarty <sitaramc@gmail.com> wrote:
Show 6 quoted lines
> Is there any way to see the sha1 of the parent commit in any > of the displays, like gitk does? > > I know you're only parsing the 4 or 5 basic git commands, > and none of those do, so I guess I know the answer :-( but > it doesn't hurt to ask.
It is sort of possible by setting the TIG_DIFF_CMD environment variable to something appropriate, for example using (and I don't know if this will be formatted correctly):
export TIG_DIFF_CMD='git show -p --stat -C -M --pretty=format:commit%x20%H%d%nAuthor:%x20%an%x20<%ae>%x20%ai%nParent:%x20%P%nSubject:%x20%s%n%n%b %(commit)'
You need to avoid using space except for where it really separates arguments, which is why the obscure %x20 is used. ;)
Another solution would be to create a script, which just expects the commit SHA1 as its first argument and then do the formatting there and then use:
export TIG_DIFF_CMD="/my/script %(commit)"
-- Jonas Fonseca