Pkg.tag "fatal: Not a valid commit name" error

552 views
Skip to first unread message

Rob

unread,
Feb 20, 2016, 5:19:55 AM2/20/16
to julia-users
I recently needed to remove some sensitive information from my package and used bfg as described by github.

Now when I try to tag my package I get the following error

julia> Pkg.tag("EEG")
fatal
: Not a valid commit name 66e78bde1a6bb0ec6b4b1a29c18bb41b32da9c6d
ERROR
: failed process: Process(`git --work-tree=/Users/rluke/.julia/v0.4/EEG --git-dir=/Users/rluke/.julia/v0.4/EEG/.git merge-base 66e78bde1a6bb0ec6b4b1a29c18bb41b32da9c6d e24530c6b9336db73f78892afada86ea28050990`, ProcessExited(128)) [128]
 
in pipeline_error at process.jl:555
 
in readbytes at process.jl:515
 
in anonymous at pkg/entry.jl:570
 
in filter at array.jl:940
 
in tag at pkg/entry.jl:570
 
in tag at pkg/entry.jl:559
 
in anonymous at pkg/dir.jl:31
 
in cd at file.jl:22
 
in cd at pkg/dir.jl:31
 
in tag at pkg.jl:51

Does anyone know how I can resolve this error and publish a new package version?

Rob

unread,
Feb 20, 2016, 5:21:36 AM2/20/16
to julia-users
Specifying a version [Pkg.tag("EEG", v"0.0.3")] number also fails 

SundaraRaman R

unread,
Feb 20, 2016, 11:22:25 AM2/20/16
to julia-users
The problem is, I think, due to the fact that applying bfg changes the commit ID (sha1) of every commit that contained the sensitive files, as well as every commit that derives from those commits in the repository.

The code in Pkg.tag() tries to use the sha1 IDs stored under METADATA/EEG/versions/ directories for each older version of the module, to find which ones are ancestors of the current commit [1] - but since the older versions' sha1 IDs have been changed by bfg, the command fails.

If you're specifying the version number yourself and don't need the auto-increment features of Pkg.tag, you can do a force tagging via Pkg.tag("EEG", v"0.0.3", force=true) which skips the part that does the sha1 comparison.

However, it may be better to go back and tag each version from 0.0.1 (or whichever your first version was) with the correct commit ID, as seen with git log --tags now. This will avoid having to use force=true every time, and thus missing out on the sanity checks in Pkg.tag that the force option skips.

(By the way, I'm not sure how the bfg-ing of history will affect any existing users of the module, but my guess is that they would need to either mess with git rebase or just delete the EEG module's directory locally and add it afresh.)

[1] (at https://github.com/JuliaLang/PkgDev.jl/blob/e7e0e5aeda9310317a161d9755d86f919e990485/src/entry.jl#L220 , which in turn calls https://github.com/JuliaLang/julia/blob/84c06b17c6d5373cee213103834e8811533290f0/base/pkg/read.jl#L13 )

SundaraRaman R

unread,
Feb 20, 2016, 11:39:54 AM2/20/16
to julia-users


On Saturday, February 20, 2016 at 9:52:25 PM UTC+5:30, SundaraRaman R wrote:
you can do a force tagging via Pkg.tag("EEG", v"0.0.3", force=true)
force isn't a keyword arg, so this should've been just Pkg.tag("EEG", v"0.0.3", true)
 
However, it may be better to go back and tag each version from 0.0.1 (or whichever your first version was) with the correct commit ID, as seen with git log --tags now.

Just for completion's sake, this would be done as Pkg.tag("EEG", v"0.0.1", true, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") , where the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the sha1 commit ID of tag 0.0.1 as emitted by the git log command (and similarly for v"0.0.2").


Rob

unread,
Feb 21, 2016, 2:26:50 PM2/21/16
to julia-users
Thanks for the help I managed to retag all versions with the command 

Pkg.tag("EEG", v"0.0.2", "eb110a6c7d11ec72ea06e9db9292d33be6248c95", force=true)

But now when running `Pkg.publish()` I get the following error

ERROR: EEG v0.0.1 SHA1 changed in METADATA – refusing to publish

Any tips on how to solve this?

SundaraRaman R

unread,
Feb 26, 2016, 4:16:36 PM2/26/16
to julia-users
Hi! Sorry I wasn't able to reply sooner on this during the work week. Looks like you got it successfully published anyway (https://github.com/codles/EEG.jl/releases), cheers!

For the sake of posterity that searches these forums, could you describe what you had to do to solve this `publish` issue? Was doing a manual publish of the METADATA as described in http://docs.julialang.org/en/latest/manual/packages/#man-manual-publish sufficient? Or did it involve more magic?
Reply all
Reply to author
Forward
0 new messages