threads / discuss / 3640

What should I use instead of git show?

Subject: What should I use instead of git show?

## tl;dr

11 messages between Mar 13, 2006 and Mar 20, 2006.

replies: 10people: 6as markdown or json

Olivier Galibert· Mar 13, 2006, 14:47 UTC · lore
Since it seems to be gone.

Up until now, when I wanted to send a patch to someone with the associated changelog, I just did a git log to find the changelog sha1 then a git show to get the goods. How am I supposed to do that now?

  OG.
Radoslaw Szkodzinski· Mar 13, 2006, 16:17 UTC · re: Olivier Galibert · lore

Re: What should I use instead of git show?

On Monday 13 March 2006 15:47, Olivier Galibert wrote yet:
Show 7 quoted lines
> Since it seems to be gone.
>
> Up until now, when I wanted to send a patch to someone with the
> associated changelog, I just did a git log to find the changelog sha1
> then a git show to get the goods.  How am I supposed to do that now?
>
>   OG.

Why not use git-whatchanged? It's exacly meant to do this. Or try qgit, or even gitk (which is what git show did).

--
GPG Key id:  0xD1F10BA2
Fingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2
AstralStorm
Linus Torvalds· Mar 13, 2006, 16:33 UTC · re: Radoslaw Szkodzinski · lore

Re: What should I use instead of git show?

On Mon, 13 Mar 2006, Radoslaw Szkodzinski wrote:
Show 11 quoted lines
> On Monday 13 March 2006 15:47, Olivier Galibert wrote yet:
> > Since it seems to be gone.
> >
> > Up until now, when I wanted to send a patch to someone with the
> > associated changelog, I just did a git log to find the changelog sha1
> > then a git show to get the goods.  How am I supposed to do that now?
> >
> >   OG.
> 
> Why not use git-whatchanged? It's exacly meant to do this.
> Or try qgit, or even gitk (which is what git show did).
Why not just use "git show"?
It hasn't gone anywhere that I know of. It's still there.

Are you stuck with an older version of git that doesn't have it? If so, you can indeed do

	git whatchanged -p -1 <sha1>

instead (actually, if your git is really old, you shouldn't use the modern shorthand of "-1", you should use the longer "--max-count=1" instead).

		Linus
Olivier Galibert· Mar 13, 2006, 16:58 UTC · re: Linus Torvalds · lore

Re: What should I use instead of git show?

On Mon, Mar 13, 2006 at 08:33:22AM -0800, Linus Torvalds wrote:
> Why not just use "git show"?
> 
> It hasn't gone anywhere that I know of. It's still there.
Oh beautiful.

I had an old (as in 3 months max, but heh) git-tree at work in a corner from which I had compiled git. When I saw it didn't have git show which I have at home I did a git pull, recompile, reinstall.

The new git didn't have git show, so I thought it had been removed after all. Turns out, the git pull had broken halfway due to the old version of git. It hadn't fast forwarded _all_ the versions. But the new git, while not current, has been able to do the complete git pull this time. And now I have git show at work too.

Guess you have to update git every month or so if you want to be able to follow current trees.

  OG.
Mark Hollomon· Mar 13, 2006, 23:26 UTC · re: Linus Torvalds · lore

Re: What should I use instead of git show?

Linus Torvalds wrote:
Show 6 quoted lines
> 
> 
> 	git whatchanged -p -1 <sha1>
> 
> instead (actually, if your git is really old, you shouldn't use the modern 
> shorthand of "-1", you should use the longer "--max-count=1" instead).
I must be misunderstanding this:
	git whatchanged -p -1 HEAD
in the current git tree results in nothing. only when I get to -5 does it show something.
Is this expected?
 > git version
git version 1.2.4.gea75
-- 
Mark Hollomon
Junio C Hamano· Mar 13, 2006, 23:55 UTC · re: Mark Hollomon · lore

Re: What should I use instead of git show?

Mark Hollomon <markhollomon@comcast.net> writes:
Show 10 quoted lines
> I must be misunderstanding this:
>
> 	git whatchanged -p -1 HEAD
>
> in the current git tree results in nothing. only when I get to -5 does it show something.
>
> Is this expected?
>
>> git version
> git version 1.2.4.gea75

In this case what matterks is not the version of your git but what that HEAD is. If it is a merge commit, whatchanged -p does not show anything by default.

Mark Hollomon· Mar 14, 2006, 11:49 UTC · re: Junio C Hamano · lore

Re: What should I use instead of git show?

Junio C Hamano wrote:
Show 16 quoted lines
> Mark Hollomon <markhollomon@comcast.net> writes:
> 
>> I must be misunderstanding this:
>>
>> 	git whatchanged -p -1 HEAD
>>
>> in the current git tree results in nothing. only when I get to -5 does it show something.
>>
>> Is this expected?
>>
>>> git version
>> git version 1.2.4.gea75
> 
> In this case what matterks is not the version of your git but
> what that HEAD is.  If it is a merge commit, whatchanged -p does
> not show anything by default.

Oh, I see. As a pass through to git-rev-list that makes sense. --max-count is really -max-commits-to-consider (or something like that).

Is there a --max-commits-to-show?
-- 
Mark Hollomon
Olivier Galibert· Mar 13, 2006, 16:50 UTC · re: Radoslaw Szkodzinski · lore

Re: What should I use instead of git show?

On Mon, Mar 13, 2006 at 05:17:47PM +0100, Radoslaw Szkodzinski wrote:
Show 8 quoted lines
> On Monday 13 March 2006 15:47, Olivier Galibert wrote yet:
> > Since it seems to be gone.
> >
> > Up until now, when I wanted to send a patch to someone with the
> > associated changelog, I just did a git log to find the changelog sha1
> > then a git show to get the goods.  How am I supposed to do that now?
> 
> Why not use git-whatchanged? It's exacly meant to do this.
Indeed, git-whatchanged -p origin..HEAD worked.  Thanks.
> Or try qgit, or even gitk (which is what git show did).
gitk does not seem to have an export function.  Dunno about qgit.
  OG.
Paul Mackerras· Mar 20, 2006, 11:33 UTC · re: Olivier Galibert · lore

Re: What should I use instead of git show?

Olivier Galibert writes:
> gitk does not seem to have an export function.  Dunno about qgit.

Right-click on a commit should bring up a context menu which includes a "write commit to file" option. Or did you mean something different by "export"?

Paul.
Olivier Galibert· Mar 20, 2006, 13:16 UTC · re: Paul Mackerras · lore

Re: What should I use instead of git show?

On Mon, Mar 20, 2006 at 10:33:31PM +1100, Paul Mackerras wrote:
Show 7 quoted lines
> Olivier Galibert writes:
> 
> > gitk does not seem to have an export function.  Dunno about qgit.
> 
> Right-click on a commit should bring up a context menu which includes
> a "write commit to file" option.  Or did you mean something different
> by "export"?
No, I meant exactly that.  Thanks, that can be quite useful.
  OG.
Junio C Hamano· Mar 14, 2006, 03:09 UTC · re: Olivier Galibert · lore

Re: What should I use instead of git show?

Olivier Galibert <galibert@pobox.com> writes:
> Up until now, when I wanted to send a patch to someone with the
> associated changelog, I just did a git log to find the changelog sha1
> then a git show to get the goods.  How am I supposed to do that now?

"git show" is fine and it is still there, but there is a command designed specifically for that purpose: format-patch.

← back to recent threads