Bug report - git show <tagname> together with --pretty=format

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Bug report - git show <tagname> together with --pretty=format

From: Cornelius <hidden>
Date: 2016-06-15 22:46:34

Hi,
I've a problem with git 1.6.2.2 (self compiled) and git show. I use it's 
output for parsing the git data, so this is more than a minor issue for 
me. When you normally do a git show on a tag name it's output resembles 
the following:
tag <tagname>
Tagger: Cornelius [off-list ref]
Date:   Wed Apr 8 14:39:17 2009 +0200


tagmessage
commit 77e312e0527f87604e4c70ebf6040e79bb55d2ed
<snip>

Now when you do a git show <tagname> 
--pretty=format:"ENDOFGITTAGOUTPUTMESAGEHERE%n%H" --
the Date: line is missing. Git 1.6.0.5 (which is avaible in my distro's 
repos) doesn't have this issue. Please CC me, I'm not subcribed here.
Cornelius

Re: Bug report - git show <tagname> together with --pretty=format

From: Michael J Gruber <hidden>
Date: 2016-06-15 22:46:34

Cornelius venit, vidit, dixit 08.04.2009 14:56:
Hi,
I've a problem with git 1.6.2.2 (self compiled) and git show. I use it's 
output for parsing the git data, so this is more than a minor issue for 
me. When you normally do a git show on a tag name it's output resembles 
the following:
tag <tagname>
Tagger: Cornelius [off-list ref]
Date:   Wed Apr 8 14:39:17 2009 +0200


tagmessage
commit 77e312e0527f87604e4c70ebf6040e79bb55d2ed
<snip>

Now when you do a git show <tagname> 
--pretty=format:"ENDOFGITTAGOUTPUTMESAGEHERE%n%H" --
the Date: line is missing. Git 1.6.0.5 (which is avaible in my distro's 
repos) doesn't have this issue. Please CC me, I'm not subcribed here.
Cornelius
It's not a bug, it's a feature ;)

In fact, git show used to ignore format specifiers for the tag part and
apply them to the commit part only. Since
ea718e6 (show <tag>: reuse pp_user_info() instead of duplicating code,
2009-01-02)
(which is in v1.6.2) it applies the format to both, which is why there
is no tag date unless you ask for it (or use the default format).

Michael

Re: Bug report - git show <tagname> together with --pretty=format

From: Santi Béjar <hidden>
Date: 2016-06-15 22:46:34

2009/4/8 Michael J Gruber [off-list ref]:
Cornelius venit, vidit, dixit 08.04.2009 14:56:
quoted
Hi,
I've a problem with git 1.6.2.2 (self compiled) and git show. I use it's
output for parsing the git data,
In addition to what Michael said, you should use the plumbing commands
instead of the porcelain (see man git). They are specifically for use
with scripts and parse their output. The output from the porcelain
commands can change.

Santi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help