Git help: how to edit an older release of a package


#1

I’ve forgotten (or I might not ever have known) how to git-edit an older release of a package without affecting anything else. I’ve got these releases and tags:

I want to edit v0.9.2 to make it work on Julia v0.5. (I think v0.9.3 didn’t go anywhere.) Sometimes the more you read the more confusing it seems, and it’s easy to dig holes in the wrong places…


#2

While it is possible to change a git tag to refer to another commit, I wouldn’t recommend it. In particular, the Julia package manager associates package versions with specific git SHAs. Editing that release would require changing the associated SHA. That would lead to a situation where two users could both have Luxor.jl at v0.9.2 but have different code, which breaks the whole notion of version numbers being a meaningful description of the exact code a user has.

On the other hand, it looks like v0.9.3 was never merged into METADATA: https://github.com/JuliaLang/METADATA.jl/pull/11716 , so changing what that tag points to won’t affect the Julia package manager. Why not just make whatever fixes you wanted for 0.9.2, call them v0.9.3 and publish that? You can delete tags directly from github if you don’t want to do it on the command line: https://github.com/JuliaGraphics/Luxor.jl/releases/tag/v0.9.3 and you can create a new github release (which also creates a git tag automatically) pointing to any commit from https://github.com/JuliaGraphics/Luxor.jl/releases (just change the option in the drop-down from master to whatever commit or branch you’ve pushed your 0.9.3 fixes to).


#3

Thanks, that sounds like a plan. Will it upset Attobot? (I don’t like to upset Attobot…)


#4

Nah, Attobot’s pretty smart. You’re just doing https://github.com/attobot/attobot#updatingdeleting-a-release with a very long delay.