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

could not determine kind of name for C.GIT_CHECKOUT_SAFE_CREATE #181

Closed
shawnl opened this issue Mar 14, 2015 · 20 comments
Closed

could not determine kind of name for C.GIT_CHECKOUT_SAFE_CREATE #181

shawnl opened this issue Mar 14, 2015 · 20 comments

Comments

@shawnl
Copy link

shawnl commented Mar 14, 2015

commit 98793509039cc80b774c527d9e5a7b5d70e3b6c4
Author: Shawn Landden <shawn@churchofgit.com>
Date:   Sat Mar 14 15:42:25 2015 -0700

    GIT_CHECKOUT_SAFE_CREATE has been removed in libgit2

    Signed-off-by: Shawn Landden <shawn@churchofgit.com>

diff --git a/checkout.go b/checkout.go
index 6eb6098..9456168 100644
--- a/checkout.go
+++ b/checkout.go
@@ -15,7 +15,6 @@ type CheckoutStrategy uint
 const (
        CheckoutNone                      CheckoutStrategy = C.GIT_CHECKOUT_NONE                         // Dry run, no actual updates
        CheckoutSafe                      CheckoutStrategy = C.GIT_CHECKOUT_SAFE                         // Allow safe updates that cannot overwrite uncommitted data
-       CheckoutSafeCreate                CheckoutStrategy = C.GIT_CHECKOUT_SAFE_CREATE                  // Allow safe updates plus creation of missing files
        CheckoutForce                     CheckoutStrategy = C.GIT_CHECKOUT_FORCE                        // Allow all updates to force working directory to look like index
        CheckoutAllowConflicts            CheckoutStrategy = C.GIT_CHECKOUT_ALLOW_CONFLICTS              // Allow checkout to make safe updates even if conflicts are found
        CheckoutRemoveUntracked           CheckoutStrategy = C.GIT_CHECKOUT_REMOVE_UNTRACKED             // Remove untracked files not in index (that are not ignored)
@shawnl
Copy link
Author

shawnl commented Mar 14, 2015

Sorry about the formatting. I hate github pull requests.

@carlosmn
Copy link
Member

This is just one change that would have to be made to let the master branch build with libgit2's master, but this doesn't update the bundled libgit2 to a version which would need this change so it's just removing some functionality which we do ship with.

@b35li
Copy link

b35li commented Mar 19, 2015

Yeah, I got this error when I run "go install" in git2go. Do you know what version of git2go to use? Now I am working on master branch.

@b35li
Copy link

b35li commented Mar 19, 2015

When I checked out to next, I saw the change above, when will you merge to master? Otherwise ,what version of libgit2 I should use for the git2go on master?

@carlosmn
Copy link
Member

See the README file for which branch goes with with libgit2 branch. next will be merged to master when libgit2 makes a release with those changes in it.

@carlosmn
Copy link
Member

This change is now in next along with the rest of changes needed to make it compile against libgit2 master, so I'm going to close this.

@shawnl
Copy link
Author

shawnl commented Mar 19, 2015

upsteam became incompatible again:
./merge.go:100: opts.flags undefined (type *C.struct___2 has no field or method flags)
./merge.go:126: unknown C.struct___2 field 'flags' in struct literal
./merge.go:336: cannot use C.git_merge_file_flags_t(options.Flags) (type C.git_merge_file_flags_t) as type C.uint in assignment

@b35li
Copy link

b35li commented Mar 20, 2015

@carlosmn Thanks. Got it, wonderful.

@b35li
Copy link

b35li commented Mar 20, 2015

@carlosmn when will the changes be merged to master and be made a release?

@shawnl
Copy link
Author

shawnl commented Mar 20, 2015

When upstream makes a release

@carlosmn
Copy link
Member

The master branch for libgit2 did move, but that doesn't matter because git2go has the submodule with the working version.

@tony
Copy link

tony commented Apr 17, 2015

I was able to fix this by moving checking out v0.22.2 (the latest stable release available through git tags) for libgit2.

@gbbr
Copy link

gbbr commented Jun 8, 2015

On branch next I get:

# github.com/libgit2/git2go
could not determine kind of name for C.GIT_ECONFLICT

@carlosmn
Copy link
Member

carlosmn commented Jun 8, 2015

It looks like you forgot to run git submodule update

@gbbr
Copy link

gbbr commented Jun 8, 2015

Even with git submodule update the same thing happens on OS X. For context:

gbbr@mecca:git2go (next)$ git submodule status
 b6011e296e4db6942d71f5a8548d1308353927ee vendor/libgit2 (v0.16.0-6344-gb6011e2)

@gbbr
Copy link

gbbr commented Jun 8, 2015

Nevermind, I had to RTFM :) Thanks

@gr4y
Copy link

gr4y commented Aug 11, 2015

I didn't want to create an new issue, so I just dug that old issue out of the trash. Sorry, about that.

$ ~/git-webhook[master]: go get gopkg.in/libgit2/git2go.v22
# gopkg.in/libgit2/git2go.v22
could not determine kind of name for C.GIT_CHECKOUT_SAFE_CREATE

go version: go1.4.2 darwin/amd64

I don't have any submodules to update, so I can't do that.

@gr4y
Copy link

gr4y commented Aug 11, 2015

So I found out that homebrew provides version 0.23.0, so I installed 0.22.3 manually and pinned it for now.

Edit:
I will put that here for any developers on OS X who run into the same problem and don't know what to do:

brew unlink libgit2
brew install https://raw.githubusercontent.com/Homebrew/homebrew/d6a9bb6adeb2043c5c5e9ba3a878decdefc1d240/Library/Formula/libgit2.rb
brew switch libgit2 0.22.3
brew pin libgit2

The last line pins libgit2 to 0.22.3, so if you want to use 0.23.0 or later you have to brew unpin libgit2 first!

@phonyphonecall
Copy link

@gr4y that worked perfect for me. Thanks! 👍

@ef2k
Copy link

ef2k commented Aug 15, 2015

Ran into this issue, solved by @gr4y above. Thanks.

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

8 participants