libgit2

Best way to do parallel stages?

為{幸葍}努か 提交于 2019-11-30 18:24:38
问题 I want to stage files in parallel and commit into different branches concurrently. There will be multiple access at the same time. The repo.Index.Stage/repo.Commit API works on the same current directory so I think this is out of the question. Can you guys give me some tips on how this might be achievable? A general idea? 回答1: From a feasibility perspective, I can think of two different options: Considering the "stage files in parallel" as a constraint The word "staging" in git parlance

How to retrieve the history of a file?

假如想象 提交于 2019-11-30 10:59:47
I got another libgit2 issue and will be very grateful for your help. I'm trying to retrieve file history, i.e. list of commits where this file was changed. And it seems to be quite unconventional... As far as I can see, there are no function for that. The only approach I can come up with is to use revision walking API to iterate through revisions, check the tree object attached to commit and search for given file there, if found, add commit to my list, otherwise proceed to next commit. But it looks none-optimal for me... May be is there any other approach, for example, look directly into .git

What's the fastest way to find Tags pointing to Commits?

喜你入骨 提交于 2019-11-30 04:48:21
问题 With libgit2sharp I would like to do the following: foreach( Commit commit in repo.Commits ) { // How to implement assignedTags? foreach( Tag tag in commit.assignedTags ) {} } I want to get all tags assigned to the current commit. Whats the best way to do that? Iterate through all Tags and see if tag.Target.Sha == commit.Sha ? Thats not very performant. Is there another way? 回答1: So I want to get all tags assigned to the current commit. Whats the best way to do that? Iterate through all Tags

How to retrieve the history of a file?

自古美人都是妖i 提交于 2019-11-30 01:10:05
问题 I got another libgit2 issue and will be very grateful for your help. I'm trying to retrieve file history, i.e. list of commits where this file was changed. And it seems to be quite unconventional... As far as I can see, there are no function for that. The only approach I can come up with is to use revision walking API to iterate through revisions, check the tree object attached to commit and search for given file there, if found, add commit to my list, otherwise proceed to next commit. But it

How to use libgit2 from a native C++ application on Windows? (Microsoft VC++)

和自甴很熟 提交于 2019-11-29 17:46:59
Summary: Is there any tiny example on how to build the Win32 C++ console application that uses the libgit2 library (sources available at GitHub )? I have followed the readme and the wiki on how to build the library on Windows using the CMake, and it worked smoothly (only a single unit-test error). Now, I want to build a simple console application that uses the library -- using Microsoft Visual Studio C++ 2010 ( the.vcxproj and the.sln ). I have found the general.c code in the libgit2 examples, and I would like to do the same from my C++ application. No success -- I feel really stupid today...

LibGit2Sharp: Fetching fails with “Too many redirects or authentication replays”

不羁岁月 提交于 2019-11-28 13:01:38
Here's the code I'm using to fetch: public static void GitFetch() { var creds = new UsernamePasswordCredentials() {Username = "user", Password = "pass"}; var fetchOpts = new FetchOptions {Credentials = creds}; using (repo = new Repository(@"C:\project");) { repo.Network.Fetch(repo.Network.Remotes["origin"], fetchOpts); } } but it fails during fetch with the following exception: LibGit2Sharp.LibGit2SharpException: Too many redirects or authentication replays Result StackTrace: at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle