niv icon indicating copy to clipboard operation
niv copied to clipboard

New command “niv changelog”

Open nmattia opened this issue 6 years ago • 6 comments

It’d be ultra nice to display a diff of the changelog (CHANGELOG.md on GH) when updating a GitHub repo. Alternatively there could also be a niv changelog command that just displays the changes since the last rev.

nmattia avatar Jun 10 '19 18:06 nmattia

Hey. Thanks for creating niv! I know that this comment is not really contributing, but I just wanted to tell you that this feature would be great to have; I would love to see the list of commits (maybe a GitHub compare page) comparing the old and the new version.

utdemir avatar Jul 15 '19 03:07 utdemir

@nomeata suggested outputting the equivalent of

git log --oneline --first-parent oldhash..lasthash

ggreif avatar Jan 23 '20 12:01 ggreif

Or, more flexible, include a field in the sources config that contains a command line to run that outputs the changes, with placeholders for old and new rev. Then some projects can print a diff of a changelog, others a git log with specific flags or directories.

nomeata avatar Jan 23 '20 15:01 nomeata

Given that we now have Github Actions like https://github.com/knl/niv-updater-action that do most of the heavy lifiting, is there still a need for this in Niv? It adds a lot of complexity.

andir avatar Jul 31 '21 10:07 andir

I would argue that this functionality should be moved from niv-updater-action to niv: The Github action should just be a simple way to automate something that I can also do manually. And indeed, I might have a dependency that I update weekly via github action, but sometimes I need to manually update it out-of-band. Surely, this should not mean I get a less useful commit message (i.e. no nice summary of changes)!

nomeata avatar Aug 09 '21 10:08 nomeata

I think I agree with @nomeata here. The one big problem, which is the same problem blocking #111, is that there is not way to get the list of commits from Git (say "metadata") without fetching the repo content. This is a big, big problem for e.g. repo like nixpkgs.

I guess for both #111 and this we could make the metadata fetching optional, i.e. only add the timestamps or fetch the history when some CLI flag is set. Does someone want to have a go at that?

nmattia avatar Aug 10 '21 08:08 nmattia