Re:Code only says what it does
by aflag on Monday July 06, 2020 @04:22PM
(#23752310)
Which tool do you use to view commit messages and revisions for each file? I think one of the reasons this is uncommon is due to lack of tooling (or wide-spread knowledge of them). I'd really like to be able to easily see all the previous commits that affected a specific line while I'm editing code. But I usually have to resort to interacting with git, rather than having something popping up on my screen (I use pycharm and vim regularly).
[ Parent
| on HN ]
Re:Code only says what it does
by kevinschumacher on Monday July 06, 2020 @04:33PM
(#23752439)
Not the person you were replying to, but in PyCharm:
- right click on the line number, click Annotate; this gives you the commit date and author in the gutter
- hover over the date/author name; this gives you the commit hash and message
- click on the hash itself in the popover; this shows the git commit graph on the Version Control tab
- right click on the date/author name, click Annotate Revision; this opens up the version committed then, with its git blame in the gutter.
That's nice, and setting the options to detect movements really improves it. It'd be nice to see the commit message, rather than the author, without the need to hovering, though.
I use gitlens for vscode
I use tig, which is a terminal UI. The "blame" view has a shortcut to jump to the commit before the one that changed a given line. This makes it easy to quickly dig backwards through the history of a file.