libgit2

Is there a better database than Git (with serializable, immutable, versioned trees)?

非 Y 不嫁゛ 提交于 2019-12-20 19:43:27
问题 Imagine the data structure behind Git. It's like a confluently persistent data structure, except using hash references instead of traditional pointers. I need Git's data structure, except without any of the working tree and index stuff. And there would be millions of branches, each tracking a handful of other local branches. Commits and merges would occur several thousand times per minute on different threads. Pulls would occur every second. Between libgit2 and jgit I can use Git's data

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

早过忘川 提交于 2019-12-19 07:58:41
问题 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,

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

▼魔方 西西 提交于 2019-12-17 20:29:55
问题 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

How to commit with Ruby bindings for libgit2

牧云@^-^@ 提交于 2019-12-13 20:02:56
问题 Does anyone know how to create a commit using the ruby bindings (the 'rugged' gem) for libgit2? I've tried all the examples I can find, on the libgit2 usage guide and on the rugged gem github page, and none of the exampes for creating or editing a commit are working. This has been helpful in trying to figure out how to commit so far, except it's for libgit2 itself and not the ruby bindings. http://librelist.com/browser//libgit2/2011/2/19/initing-a-repository-adding-files-to-the-index-and

How to update the working directory when creating a commit with Rugged/libgit2?

不打扰是莪最后的温柔 提交于 2019-12-13 16:22:32
问题 I'm trying to create a commit with rugged using the following test script: require "rugged" r = Rugged::Repository.new(".") index = r.index index.read_tree(r.references["refs/heads/master"].target.tree) blob = r.write("My test", :blob) index.add(:oid => blob, :path => "test.md", :mode => 0100644) tree = index.write_tree parents = [r.references["refs/heads/master"].target].compact actor = {:name => "Actor", :email => "actor@bla"} options = { :tree => tree, :parents => parents, :committer =>

Cloning only the main branch using PyGit2

混江龙づ霸主 提交于 2019-12-13 07:36:59
问题 I want to clone some remote repositories, but only retrieving the main branch. My code currently gets all of the branches. def init_remote(repo, name, url): # Create the remote with a mirroring url remote = repo.remotes.create(name, url, "+refs/*:refs/*") # And set the configuration option to true for the push command mirror_var = "remote.{}.mirror".format(name) repo.config[mirror_var] = True # Return the remote, which pygit2 will use to perform the clone return remote pygit2.clone_repository

How to list branches that contain a given commit in git2go (libgit2)?

你离开我真会死。 提交于 2019-12-13 05:56:37
问题 Given a specific reference (a tag in this case) how can you list the branches that contain that commit in git2go? Similar to git branch --contains <commit> . 回答1: The question here, graph-wise is "how do I know if A is an ancestor of B?" (repeated a few times for each branch which you want to be B). The only way to answer that is to walk down the history graph starting at B and check if you find A. You can do this in a few ways, but the most efficient is generally going to be to reduce the

not able to run LibGit2Sharp on Mono on ubuntu

对着背影说爱祢 提交于 2019-12-13 05:37:16
问题 have a very simple one line console app (using monodevelop) but getting below error. System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: git2-e0902fb my app has reference two nuget package LibGit2Sharp 0.21.0.176 LibGit2Sharp.NativeBinaries 1.0.119 LibGit2Sharp.Repository.Init("foler path"); 回答1: libGit2Sharp 0.21.0.176 nuget does have dependency on a specific native library and it requires

How to exclude stashes while querying refs?

和自甴很熟 提交于 2019-12-12 20:04:18
问题 I'm trying to query for commits: repo.Commits.QueryBy(new LibGit2Sharp.Filter { Since = repo.Refs }).Take(100) This is otherwise ok, but it also returns stashes. How can I exclude stashes? I know that when I'm looping through the results I could just ignore them I guess, but then I wouldn't have 100 of them as I wanted. 回答1: The Since and Until properties of the Filter type are quite tolerant regarding what they can be valued with. According to the documentation they Can either be a string

visualstudio.com thinks latest libgit2 is old

邮差的信 提交于 2019-12-12 19:08:14
问题 When cloning or fetching from visualstudio.com I get a sideband message that "you're using an older version of Git". This happens with libgit2 commit f1323d9 that is from January 10. Is there anything I can do about this and is this anything I should worry about? It can be replicated with something like #include <stdio.h> #include <git2.h> static int cred_acquire_cb(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload) { return git_cred