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

fix cd path when registering a new package (fix #43) #58

Merged
merged 8 commits into from
Aug 3, 2016

Conversation

bicycle1885
Copy link
Member

This will fix #43.

@tkelman
Copy link
Contributor

tkelman commented Jul 30, 2016

might also fix #28, will have to test. xref #27.

@bicycle1885
Copy link
Member Author

done


@testset "testing package registration" begin
PkgDev.generate("GreatNewPackage", "MIT")
PkgDev.register("GreatNewPackage")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will need git credentials of some kind

@bicycle1885
Copy link
Member Author

INFO: Committing GreatNewPackage generated files
INFO: Registering GreatNewPackage at https://github.com/JuliaLang/GreatNewPackage.jl.git
INFO: Committing METADATA for GreatNewPackage
testing package registration: Error During Test
  Got an exception of type Base.LibGit2.Error.GitError outside of a @test
  GitError(Code:ENOTFOUND, Class:Config, Config value 'user.name' was not found)
   in macro expansion at ./libgit2/error.jl:98 [inlined]
   in default_signature(::Base.LibGit2.GitRepo) at ./libgit2/signature.jl:41
   in Base.LibGit2.Signature(::Base.LibGit2.GitRepo) at ./libgit2/signature.jl:24
   in commit(::Base.LibGit2.GitRepo, ::String) at ./libgit2/commit.jl:56
   in (::PkgDev.Entry.##20#28{String,String,String})(::Base.LibGit2.GitRepo) at /home/travis/.julia/v0.5/PkgDev/src/entry.jl:176
   in transact(::PkgDev.Entry.##20#28{String,String,String}, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:501
   in register(::String, ::String) at /home/travis/.julia/v0.5/PkgDev/src/entry.jl:145
   in register(::String) at /home/travis/.julia/v0.5/PkgDev/src/entry.jl:194
   in register(::String) at /home/travis/.julia/v0.5/PkgDev/src/PkgDev.jl:36
   in macro expansion at /home/travis/.julia/v0.5/PkgDev/test/runtests.jl:170 [inlined]
   in macro expansion at ./test.jl:672 [inlined]
   in (::##1#2)(::String) at /home/travis/.julia/v0.5/PkgDev/test/runtests.jl:164
   in temp_pkg_dir(::##1#2, ::Bool) at /home/travis/.julia/v0.5/PkgDev/test/runtests.jl:15
   in temp_pkg_dir(::Function) at /home/travis/.julia/v0.5/PkgDev/test/runtests.jl:8
   in include_from_node1(::String) at ./loading.jl:426
   in process_options(::Base.JLOptions) at ./client.jl:262
   in _start() at ./client.jl:318
Test Summary:                | Error  Total
  testing package registration |     1      1

I may need to set the global user and email settings for Linux.

@tkelman
Copy link
Contributor

tkelman commented Jul 30, 2016

so does the config dict not apply to both METADATA commits and the new repo? it seems like that could be changed?

@@ -20,6 +20,7 @@ end

temp_pkg_dir() do pkgdir

#=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed before merging, yeah?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@bicycle1885
Copy link
Member Author

so does the config dict not apply to both METADATA commits and the new repo? it seems like that could be changed?

Sorry, I'm not sure what you mean. Each repository and METADATA read the global configuration set with the git command. Can you explain it more explicitly?

@tkelman
Copy link
Contributor

tkelman commented Jul 30, 2016

In dd05320 and 922165d you tried setting a config dictionary. What was the reason that didn't work? Does the config dictionary get applied both to the generated package and any commits to metadata? If not, could it?

@bicycle1885
Copy link
Member Author

If no global setting of git, we need to pass some information about the committer to this call:

LibGit2.commit(repo, msg)
, but it will need adding new parameters to PkgDev.register, which is I'm not sure a good approach or not.

@tkelman tkelman merged commit ee3de65 into JuliaLang:master Aug 3, 2016
@bicycle1885 bicycle1885 deleted the fix-43 branch August 3, 2016 00:32
info("setting git global configuration")
run(`git config --global user.name "Julia Test"`)
run(`git config --global user.email test@julialang.org`)
run(`git config --global github.user JuliaTest`)
Copy link
Contributor

@tkelman tkelman Aug 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a better approach would be to create a temporary directory, and do withenv("HOME" => ...) ?

edit: or set HOME to be inside of JULIA_PKGDIR? is there a different git-specific config location environment variable we could use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running git config --local ... inside a package repository may be better than modifying global configurations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LibGit2.config?

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

Successfully merging this pull request may close these issues.

crash on PkgDev.register
3 participants