go-git icon indicating copy to clipboard operation
go-git copied to clipboard

Where is 'git show' implemented?

Open Marakai opened this issue 3 years ago • 1 comments

The compatibility table has a tickmark next to "(git) show", yet I see no code, methods or funcs that actually implement this, never mind with all its myriad options. Am I missing something and its equivalent is actually "spread out" over various other methods that return object/blob/tag/commit info?

Marakai avatar Sep 01 '22 00:09 Marakai

It looks like you can use r.CommitObject to mimic git show

https://github.com/go-git/go-git/blob/master/_examples/commit/main.go#L64

eze-kiel avatar Sep 30 '22 21:09 eze-kiel

Yeah, that's the simplest case (-s), but doesn't cover the rest of the options.

Marakai avatar Nov 02 '22 00:11 Marakai

@eze-kiel @Marakai it's pretty old but do you know how to achieve git show --name-only to show only the actual changed files and ignore the rest?

Shaked avatar Sep 21 '23 23:09 Shaked