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

Package system on libgit2 #11196

Merged
merged 90 commits into from
Sep 29, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
865c87c
changing `installed` based to support `libgit2`
wildart May 5, 2015
851c053
merged installed & dependents into `Read`, moved `libgit2` calls into…
wildart May 5, 2015
12a525c
removed `Git` module calls from `Read`
wildart May 5, 2015
b2be2d7
changed string type
wildart May 5, 2015
9c88dbc
renamed to 'libgit2'
wildart May 6, 2015
cdf28d4
fixed to AbstractString
wildart May 7, 2015
c57ec72
added libgit2 error handling
wildart May 8, 2015
7140141
write to repo configuration value with any accepted type
wildart May 8, 2015
f836a71
added `clone` & `fetch`, updated 'Dir' and `Cache`
wildart May 8, 2015
61ba8f0
switching to `Ref` type
wildart May 8, 2015
ba591fe
changed incorrect types & syntax
wildart May 8, 2015
efb5bba
working on `Generate`
wildart May 9, 2015
bb40811
fixed changed api
wildart May 9, 2015
4ca8175
construct type pragmatically
wildart May 9, 2015
25a7d0a
added `with_libgit2` helper function
wildart May 9, 2015
3516046
package generator works!!!
wildart May 10, 2015
3198519
added default value to GitConfig 'get' to prevent exceptions
wildart May 10, 2015
3305ed6
added anyobject type and `checkout` functions
wildart May 10, 2015
071a872
no more `git` in Write
wildart May 10, 2015
87e7fbf
fixed `revparse`, `isdirty` & errors in `Write`
wildart May 10, 2015
409bb27
improved git types description
wildart May 10, 2015
9802b85
transitioned Entry.add
wildart May 11, 2015
e2c1a38
transitioned Entry.clone
wildart May 11, 2015
ff9b5d6
GitError is Exception subclass
wildart May 11, 2015
f55de93
fixed `need_update`, `head_oid`, `revparse`, `CHECKOUT_NONE`, `Checko…
wildart May 11, 2015
6dedbb2
transitioned Entry: `free` & `pin`
wildart May 11, 2015
8fbf905
refactored error handling
wildart May 13, 2015
e4ac8bd
error fix: nonexistent directory case, cannot create empty wrapper
wildart May 13, 2015
8ff8a25
made options structures immutable with convinient constructors
wildart May 13, 2015
273ecfa
rewrote Write module: changed resource management and commit checkout.
wildart May 13, 2015
c1179e7
added proper `checkout` & `branch` functions
wildart May 13, 2015
67435f6
added tests for `libgit2`
wildart May 16, 2015
740194a
removed unnecessary `rethrow` calls
wildart May 16, 2015
30688dc
transitioned `checkout`, `free`, `update`, `register`
wildart May 17, 2015
331f8c2
switched to https
wildart May 17, 2015
dcac546
added `gitdir` (location of repo '.git') and `path` (repo location)
wildart May 17, 2015
52d72cb
import Base for `finalize`s
wildart May 17, 2015
3e957e8
transitioned `tag` & `register`
wildart May 17, 2015
3ff4628
fixed `get` with default for GitConfig
wildart May 18, 2015
c9d04e2
fixed errors, set to run only pkg & libgit2 tests
wildart May 18, 2015
d409e13
added PkgError exception
wildart May 19, 2015
3335bf7
added licence line
wildart May 19, 2015
b5efeef
fixed GitHub saved token retrieval & PkgError visibility
wildart May 19, 2015
efde7ed
added `push`, transitioned `pull_request`
wildart May 19, 2015
f1b5694
fixed import error
wildart May 20, 2015
c1298e8
added `revcount` for counting differences
wildart May 20, 2015
6943209
fixed exceptions in tests
wildart May 20, 2015
8612798
speedup `prefetch` call
wildart May 21, 2015
9016b11
refactored GitConfig methods
wildart May 21, 2015
21fcc2c
removed prefix from `finalize` calls
wildart May 21, 2015
2d456ab
newline at end of file
wildart May 21, 2015
327e989
No more `Git`!
wildart May 23, 2015
307aa8b
partial fix for #11580
wildart Jun 6, 2015
70963a9
adopting CString & refactoring
wildart Jun 27, 2015
f8b0dec
added prototype of git repl
wildart Jun 28, 2015
c0d59a0
added `clone` & `init` command
wildart Jul 2, 2015
09406ad
refactoring commit message call
wildart Jul 8, 2015
50b81f6
rebased, moved `libgit2` to `base`, updated to 0.23 & tests
testurser Jul 9, 2015
c9fcd0b
fixed repl tests
wildart Jul 9, 2015
39aa02b
tuple-based Oid
testurser Jul 9, 2015
8b5dd78
added `Oid` tests, modified `free` with tuple parameters,
testurser Jul 10, 2015
5a4aad0
fixed: string value retrieval from config, resource management in tests
wildart Jul 10, 2015
c254abb
fixed 0.23 compatibility errors, added more commands to git-repl
wildart Jul 13, 2015
f58f762
used new enums, changed location of GITHUB_REGEX, exported PkgError
wildart Jul 13, 2015
fad9263
switch to release build for windows
wildart Jul 14, 2015
93af677
diff & rebase update to v0.23, error fixes
wildart Jul 27, 2015
1347d68
added callbacks, updated push & publish
wildart Jul 28, 2015
25778f7
merge overhaul, added credential & fetchhead callbacks, small fixes &…
wildart Aug 2, 2015
9f3bad9
added extended repo open, ported Base.url
wildart Aug 2, 2015
5fa68d5
fixed Pkg.pull_request, suppress backtrace PkgError & code cleanup
wildart Aug 2, 2015
f3301fb
switch GitRepo to GitRevWalker
wildart Aug 2, 2015
9690fa6
added to GitREPL: branch & tag
wildart Aug 2, 2015
c5350e5
added `commit` to Git REPL & fixed commands help info
wildart Aug 2, 2015
243e1a8
fix Git REPL `commit` output
wildart Aug 2, 2015
7aa333b
added `checkout` to Git REPL
wildart Aug 2, 2015
2f8c7b7
fixed remote branch name
wildart Aug 2, 2015
2853db0
reomoved Git module and its tests
wildart Aug 2, 2015
0ccfdfe
fix error message & add all tests
wildart Aug 3, 2015
4beb9af
fixed cache update, remove redundant `chomp` call from Git REPL `comm…
wildart Aug 3, 2015
7e9caae
fixed: `tag` requirements creation, empty callbacks
wildart Aug 8, 2015
78929ad
fixed tests
wildart Sep 14, 2015
29004a4
removed Git REPL
wildart Sep 14, 2015
116bb4c
fixed bad rebase commit of `inbase`
wildart Sep 14, 2015
b0f07a8
added: tree entry type, tree walker, blob lookup, some refinements
wildart Sep 23, 2015
80f0db7
Union() => Union{}
wildart Sep 23, 2015
0663672
fixed comparisons to `nothing`
wildart Sep 25, 2015
509e4b2
renamed module `GitConst` to `Consts`, added support of ssh-agent
wildart Sep 29, 2015
11f08b5
returned `Pkg.Git` module
wildart Sep 29, 2015
d18efae
fix deprecation warning
jakebolewski Sep 29, 2015
35cd85f
add error branch test for package availablity
jakebolewski Sep 29, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed changed api
  • Loading branch information
wildart authored and jakebolewski committed Sep 29, 2015
commit bb40811d890c66a38c0cbb0853bf42eea0264e65
4 changes: 2 additions & 2 deletions base/pkg/entry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ function status(io::IO, pkg::AbstractString, ver::VersionNumber, fix::Bool)
prepo = LibGit2.GitRepo(pkg)
phead = LibGit2.head(prepo)
if LibGit2.isattached(prepo)
print(io, LibGit2.ref_name(phead))
print(io, LibGit2.shortname(phead))
else
print(io, LibGit2.ref_id(phead)[1:8])
print(io, string(LibGit2.Oid(phead))[1:8])
end
attrs = AbstractString[]
isfile("METADATA",pkg,"url") || push!(attrs,"unregistered")
Expand Down
22 changes: 12 additions & 10 deletions base/pkg/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,28 @@ function iscommit(id::AbstractString, repo::GitRepo)
end

function isdirty(repo::GitRepo, paths::AbstractString="")
tree_oid =revparse(repo, "HEAD^{tree}")
tree_oid = revparse(repo, "HEAD^{tree}")
tree_oid == nothing && return true

tree_ptr = Ptr{Void}[0]
tree_ptr_ptr = Ref{Ptr{Void}}(C_NULL)
tree_oid_ptr = Ref(tree_oid)
err = ccall((:git_tree_lookup, :libgit2), Cint,
(Ptr{Ptr{Void}}, Ptr{Void}, Ptr{UInt8}), tree_ptr, repo.ptr, tree_oid)
(Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Oid}),
tree_ptr_ptr, repo.ptr, tree_oid_ptr)
err != 0 && return true

diff_ptr = Ptr{Void}[0]
diff_ptr_ptr = Ref{Ptr{Void}}(C_NULL)
err = ccall((:git_diff_tree_to_workdir_with_index, :libgit2), Cint,
(Ptr{Ptr{Void}}, Ptr{Void}, Ptr{Void}, Ptr{Void}, Ptr{Void}),
diff_ptr, repo.ptr, tree_ptr[1], C_NULL, C_NULL)
diff_ptr_ptr, repo.ptr, tree_ptr_ptr[], C_NULL, C_NULL)
err != 0 && return true

if isempty(paths)
c = ccall((:git_diff_num_deltas, :libgit2), Cint, (Ptr{Void},), diff_ptr[1])
c = ccall((:git_diff_num_deltas, :libgit2), Cint, (Ptr{Void},), diff_ptr_ptr[])
c > 0 && return true
else
# TODO look for specified path
c = ccall((:git_diff_num_deltas, :libgit2), Cint, (Ptr{Void},), diff_ptr[1])
c = ccall((:git_diff_num_deltas, :libgit2), Cint, (Ptr{Void},), diff_ptr_ptr[])
c > 0 && return true
end
return false
Expand All @@ -72,7 +74,7 @@ function merge_base(one::AbstractString, two::AbstractString, repo::GitRepo)
(Ptr{Oid}, Ptr{Void}, Ptr{Oid}, Ptr{Oid}),
moid_ptr, repo.ptr, oid1_ptr, oid2_ptr)
err != 0 && return nothing
return moid[]
return moid_ptr[]
end

function is_ancestor_of(a::AbstractString, b::AbstractString, repo::GitRepo)
Expand All @@ -83,14 +85,14 @@ end
function set_remote_url(repo::GitRepo, url::AbstractString; remote::AbstractString="origin")
cfg = GitConfig(repo)

err = set!(AbstractString, cfg, "remote.$remote.url", url)
err = set!(cfg, "remote.$remote.url", url)
err !=0 && return

m = match(GITHUB_REGEX,url)
m == nothing && return
push = "[email protected]:$(m.captures[1]).git"
if push != url
err = set!(AbstractString, cfg, "remote.$remote.pushurl", push)
err = set!(cfg, "remote.$remote.pushurl", push)
end
end

Expand Down