Thread (61 messages) flat view 61 messages, 14 authors, 2016-06-15

Re: showing SHA1 of parent commit in tig [was Re: [ANNOUNCE] tig-0.14

From: Jonas Fonseca <hidden>
Date: 2016-06-15 22:46:09

On Wed, Feb 11, 2009 at 17:05, Sitaram Chamarty [off-list ref] wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help