Re: showing SHA1 of parent commit in tig [was Re: [ANNOUNCE] tig-0.14
From: Sitaram Chamarty <hidden>
Date: 2016-06-15 22:46:09
On 2009-02-12, Jonas Fonseca [off-list ref] wrote:
On Wed, Feb 11, 2009 at 17:05, Sitaram Chamarty [off-list ref] wrote:quoted
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)"
OK thanks -- I'll give that a shot when I get a chance. Regards, Sitaram