hackage-cli
hackage-cli copied to clipboard
Better x-revision handling
I'd like to use hackage-cli for packages where I don't track the x-revision field in the git repo. Currently, when I try to upload a second revision for such a package with push-cabal --incr-rev, I get the error
The new x-revision must be 2
Could --incr-rev possibly be changed to simply increment the latest revision?
No. We want be explicit to avoid accidents, i.e. make operation inputs independent of Hackage state.
Having --set-rev=N would be fine.
Having
--set-rev=Nwould be fine.
Sounds good to me.
Pondering whether to implement --set-rev=N, I got doubts that it is worthwhile:
- It only sensibly applies to pushing a single cabal file (but maybe exactly this was the intended use case).
- It does now save much work over manually adding
x-revision: Nto the cabal file and deleting this line again afterwards.
A flag like --auto-rev implementing the OP would offer enough net gain, though.
Note that the default dry-run mode already helps to avoid accidents. (At least, I personally always first do a dry run before supplying the --publish flag.)