hackage-cli icon indicating copy to clipboard operation
hackage-cli copied to clipboard

Better x-revision handling

Open sjakobi opened this issue 5 years ago • 3 comments
trafficstars

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?

sjakobi avatar Oct 01 '20 18:10 sjakobi

No. We want be explicit to avoid accidents, i.e. make operation inputs independent of Hackage state.

Having --set-rev=N would be fine.

phadej avatar Oct 02 '20 09:10 phadej

Having --set-rev=N would be fine.

Sounds good to me.

sjakobi avatar Oct 03 '20 08:10 sjakobi

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: N to 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.)

andreasabel avatar Jul 17 '23 07:07 andreasabel