Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging #6

Open
GunnarFarneback opened this issue Apr 4, 2020 · 2 comments
Open

Tagging #6

GunnarFarneback opened this issue Apr 4, 2020 · 2 comments

Comments

@GunnarFarneback
Copy link
Owner

The Julia registries identify the registered package versions by the tree hashes of their content, which can be retrieved from the package's git repository. Whereas this is all that the Julia package manager needs to know, it's not overly practical for interactive exploration or browsing of the package repository. What you typically want is to have git tags on commits corresponding to the registered tree hashes. LocalRegistry should help with this.

Ideas:

  • Add a function tag to retrospectively add tags corresponding to already registered versions.
  • Add a keyword to register to immediately tag the version being registered.

Design questions:

  • Git supports two different kinds of tags; lightweight and annotated. The latter seems to be the more popular option.
  • Should the tag naming convention be hardcoded or is there any need to have that configurable?
@GunnarFarneback
Copy link
Owner Author

Starting from the documentation rather than the implementation, this is how it may look, subject to changes when the reality of implementation indicates that something is not such a great idea after all.


tag(package)
tag(package, registry)

Tag the latest registered version of package with a lightweight
tag. Many variations on this are available through the keyword
arguments. package and registry can be specified in the same way
as for register.

Keyword arguments

tag(package, registry = nothing; push = false, repo = nothing,
    version = nothing, tag_name = nothing, annotation = nothing,
    gitconfig = Dict())
  • push: If true, push the tag(s) to the package repository automatically.
  • repo: Specify the package repository explicitly. Otherwise looked
    up in the registry.
  • version: Specify which version(s) to tag. If nothing, tag the
    latest release. If a string, tag that version. If a vector of
    strings, tag those versions. If :all, tag all registered versions.
  • tag_name: If nothing, use tags of the form v1.2.3 for
    normal packages and Package_v1.2.3 for packages in
    subdirectories. If set to a function, call that function with the
    version number and use the returned string as tag name.
  • annotation: If not nothing, create an annotated tag instead of a
    lightweight tag. If set to a string, use that as annotation
    message. If set to a function, call that function with the version
    number and use the returned string as annotation message.
  • gitconfig: Optional configuration parameters for the git command.

@baggepinnen
Copy link

I have a local fork of LocalRegistry where I've added the keyword argument tag::Union{Nothing, AbstractString} = nothing, and the following in the end of register

    if tag !== nothing
        @info "Tagging, push tags with `git push --tags`" version=pkg.version
        git = gitcmd(package_path, gitconfig)
        run(`$git tag -a $(pkg.version) -m $(tag)`)
    end

This works quite well and is very simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants