Page MenuHomeSoftware Heritage

add two example scripts to the snippets repository
ClosedPublic

Authored by stsp on Dec 1 2021, 4:11 PM.

Details

Summary

add swh-diff.py; displays SWH revision changes as a unified diff
add swh-log-oneline.py; displays a one-line summary for each revision in history

Diff Detail

Repository
rDSNIP Code snippets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

stsp requested review of this revision.Dec 1 2021, 4:11 PM
ardumont added a subscriber: ardumont.

I've proposed something to improve readability (i think)
It's not blocking at all, you can push as is.

Cheers,

stsp/swh-diff.py
24

jsyk, not blocking at all, we tend to use click [1].
Even die hard fan of the old ways of python cli from the cli tend to use it agreeably now ;)

It allows to be a bit more explicit on the parameter and arguments on the cli.
(see your other script where i tried to demo what i'm saying).

[1] https://click.palletsprojects.com/en/7.x/

stsp/swh-log-oneline.py
15–36 ↗(On Diff #24399)

something like ^
(again not blocking, just showing ;)

disclaimer: not tested ;)

This revision is now accepted and ready to land.Dec 1 2021, 5:35 PM
stsp/swh-log-oneline.py
15–36 ↗(On Diff #24399)

Indeed, this looks nice. I will do this when I find another reason to touch the scripts again.