Skip to content

Better x-revision handling #16

Description

@sjakobi

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?

Activity

  1. phadej commented on Oct 2, 2020

    @phadej
    Collaborator

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

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

  2. sjakobi commented on Oct 3, 2020

    @sjakobi
    CollaboratorAuthor

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

    Sounds good to me.

  3. andreasabel commented on Jul 17, 2023

    @andreasabel
    Member

    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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions