gohack icon indicating copy to clipboard operation
gohack copied to clipboard

implement gohack diff subcommand

Open rogpeppe opened this issue 7 years ago • 1 comments
trafficstars

When we do gohack get of a module without specifying the -vcs flag, we record the checksum so we can later report that the source has been changed, but we have know way of informing the user exactly what has been changed.

We should record the version that's being checked out as well as the checksum. That way we can find out what's changed (using gohack diff). This also potentially allows us to switch from default to VCS mode while preserving changes made by the user.

One potentially issue with implementing this command is that it's potentially a slippery slope towards adding endless diff features.

rogpeppe avatar Oct 17 '18 22:10 rogpeppe

If you use github.com/pkg/diff to provide the diff, then there'll be much less temptation to support adding endless diff features, since package diff probably doesn't support them. :) And it doesn't require an external diff tool.

josharian avatar Sep 30 '19 17:09 josharian