libgit2

libgit2 how to get the the status of the current directory?

大兔子大兔子 提交于 2019-12-02 10:22:39
How can I get the status of a single directory, rather than the whole repository? I have looked at the following: git_status_list_new which gets the repository status, but I care only about files located in a single directory. git_status_file which gets the status of a single. Is there a way that I can get the status of a single directory using libgit2? git_status_list_new accepts a git_status_options struct, which contains a pathspec member which controls which files will be included in the list. You can use that to limit your returned statuses to those in a single directory. 来源: https:/

Unable to load DLL 'git2.dll' The specified module could not be found

大兔子大兔子 提交于 2019-12-01 21:18:17
问题 I'm trying to use libgit2sharp in a web-project. The problem is that libgit2sharp's solution is for VS2010 and I'm using VS2008. So I had to create a new solution and modify the code not to use default parameters. That wasn't a problem, except I'm getting the exception listed in the title when I try to use the compiled libgit2sharp DLL. I've tried linking in the git2.dll, but that hasn't helped. Copying the git2.dll into the web-project hasn't helped either. Edit : The issue was handled over

Unable to load DLL 'git2.dll' The specified module could not be found

可紊 提交于 2019-12-01 19:44:15
I'm trying to use libgit2sharp in a web-project. The problem is that libgit2sharp's solution is for VS2010 and I'm using VS2008. So I had to create a new solution and modify the code not to use default parameters. That wasn't a problem, except I'm getting the exception listed in the title when I try to use the compiled libgit2sharp DLL. I've tried linking in the git2.dll, but that hasn't helped. Copying the git2.dll into the web-project hasn't helped either. Edit : The issue was handled over at the LibGit2Sharp issue tracker: https://github.com/libgit2/libgit2sharp/issues/39 Off the top of my

How to make a git merge by pygit2

£可爱£侵袭症+ 提交于 2019-12-01 12:45:39
问题 I try to merge branch into master: repo = pygit2.Repository("/path/to/repo/") branch = repo.lookup_branch("upstream/branch", pygit2.GIT_BRANCH_REMOTE) oid = branch.target merge_result = repo.merge(oid) And merge_result contains ff oid (as in documentaion) and repo hasn't changed. What should I do next to change the repository? 回答1: The merge function does the merge (or in this case tells you you could skip it), but it's up to you (or the user of the tool) whether you want to move the current

Performing a “fast-forward” merge with Rugged

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 09:36:59
Using Rugged, what's the canonical way to perform a fast-forward "merge"? From here I found one possible lead: # Move branch forward # Since there's no fast-forward merge in this lib yet, do it by hand. br = repo.branch "master" br.move 'master-old', true if br != nil repo.create_branch 'master', commit_sha #br.delete! # No real harm in this hanging around But I'm curious if there's room for improvement here. There is no need for an operation called "fast-forward merge" libgit2 since a so-called ff-merge is updating the current branch to whatever commit is on the other branch, which does exist

Performing a “fast-forward” merge with Rugged

寵の児 提交于 2019-12-01 08:56:23
问题 Using Rugged, what's the canonical way to perform a fast-forward "merge"? From here I found one possible lead: # Move branch forward # Since there's no fast-forward merge in this lib yet, do it by hand. br = repo.branch "master" br.move 'master-old', true if br != nil repo.create_branch 'master', commit_sha #br.delete! # No real harm in this hanging around But I'm curious if there's room for improvement here. 回答1: There is no need for an operation called "fast-forward merge" libgit2 since a

How to find all commits having a particular parent?

与世无争的帅哥 提交于 2019-12-01 07:02:05
How may I find all commits in a repository that have a specific parent? For example, if I have a commit A , I would like to find all other commits that share the parent with A . What would be the most effective, i.e. performant yet correct way to do this in LibGit2Sharp? That's a tricky question ;-) The Git object allows to retrieve the parents of a commit. However, there's no easy way to find the children of a commit. The following code would however partially solve this. The idea is to perform a git log from all the references of the repository (heads, tags, ...) and, along the way, select

Which format should be SSH private key for LibGit2 LibGit2Sharp (+SSH)

做~自己de王妃 提交于 2019-12-01 06:19:27
I´m kind of stuck with an SSH private key issue and LibGit2Sharp-Ssh. I have a .Net/C# application that uses LibGit2Sharp-Ssh to clone a Git repository. I need to use SSH (https with user/password is not an option) and I also have a valid key, which is already working e.g. with Teamcity. My code looks like this: CloneOptions options = new CloneOptions { Checkout = false, CredentialsProvider = (url, user, cred) => new SshUserKeyCredentials() { PrivateKey = privateKey, Passphrase = passphrase, PublicKey = publicKey, Username = "git" } }; var clone = LibGit2Sharp.Repository.Clone(remoteUrl,

How to find all commits having a particular parent?

五迷三道 提交于 2019-12-01 05:54:35
问题 How may I find all commits in a repository that have a specific parent? For example, if I have a commit A , I would like to find all other commits that share the parent with A . What would be the most effective, i.e. performant yet correct way to do this in LibGit2Sharp? 回答1: That's a tricky question ;-) The Git object allows to retrieve the parents of a commit. However, there's no easy way to find the children of a commit. The following code would however partially solve this. The idea is to

An error was raised by libgit2. Category = Os (Error)

不羁的心 提交于 2019-12-01 01:19:05
问题 I have run into this several times now: An error was raised by libgit2. Category = Os (Error). Which sometimes causes this or similar error while i am writing code: Failed to open '.../App_Data/....mdf': The process cannot access the file because it is being used by another process. When this happens i can't code without restarting my Visaul Studio 2012 . I think it's being caused by Source Control - Git as i don't remember having this problem before i installed the Git extension for Visual