tig icon indicating copy to clipboard operation
tig copied to clipboard

[Feature]: file history viewing

Open danielb2 opened this issue 4 months ago • 7 comments

I can open a file with f followed by the filename. Once selected I can view the file. But I want to view the full file for each version in the history. so it would be nice if I could just page between the versions of the file.

i'm looking for a particular change, but I don't know exactly what I'm looking for, so I can't grep.

danielb2 avatar Aug 24 '25 09:08 danielb2

maybe tig log -p -- path/to/file ? That gives you diffs though. If you want blobs, maybe for commit in $(git log --format=%h -- README.rst); do echo $commit:README.rst; done | xargs git show

krobelus avatar Aug 25 '25 08:08 krobelus

thank you for your suggestion.

I don't have enough context from the diffs, so yes, blobs.

danielb2 avatar Aug 25 '25 09:08 danielb2

I don't have enough context from the diffs

there's also the "-U99" diff flag for choosing the amount of context

Sounds like an unusual use case, I usually get by with recursive blame, or "tig -Gfoo".

krobelus avatar Aug 25 '25 09:08 krobelus

Since 2.5.9, pressing f on another commit after returning to the main view will show you the corresponding blob.

koutcher avatar Aug 25 '25 17:08 koutcher

Since 2.5.9, pressing f on another commit after returning to the main view will show you the corresponding blob.

and it lets me browse through prior versions of the files history? that was the first thing I tried, and I couldn't figure out how to see other versions of the file. Only the current one

danielb2 avatar Aug 25 '25 17:08 danielb2

It's easier when starting with tig -- path/to/file, then pressing f on any line will show you directly the corresponding blob.

koutcher avatar Aug 25 '25 17:08 koutcher

It's easier when starting with tig -- path/to/file, then pressing f on any line will show you directly the corresponding blob.

I still don't see it solving what I'm looking to do regardless of the easier way to navigate there. not sure you read carefully

danielb2 avatar Aug 25 '25 17:08 danielb2