Questions tagged [rugged]

Ruby open source bindings for libgit2, a native git library

Rugged is a library for accessing libgit2 in Ruby. It gives you the speed and portability of libgit2 with the beauty of the Ruby language.

Rugged gives you access to the many parts of a Git repository. You can read and write objects, walk a tree, access the staging area, and lots more.

Online resources

70 questions
1
vote
1 answer

Check what files are staged in git with rugged ruby

How can I can check what files are 'staged' or changed, but not staged with rugged?
mhl
  • 705
  • 1
  • 8
  • 19
1
vote
1 answer

How to connect to remote using SSH transport

Let the repository's origin remote has an ssh url. So the following code: remote = Rugged::Remote.lookup(repo, "origin") remote.connect(:fetch) raises Rugged::SshError: Cannot set up SSH connection without credentials. It looks like rugged supports…
TheBug
  • 121
  • 2
0
votes
1 answer

How To Invoke Rugged Check_connection Via ssh?

Below is a Ruby program that is supposed to verify a connection with my GitHub repos, private and public. The ssh key is the correct one, and it has no passphrase. However, ssh is apparently not used, as shown near the end of this question. require…
Mike Slinn
  • 7,705
  • 5
  • 51
  • 85
0
votes
0 answers

Count commits ahead or behind using rugged/libgit2

The following git command line provides a count of the commits that origin/master is ahead of master (local copy) git rev-list --count master..origin/master Output will be 0 if not ahead, or n for the number of additional commits made to…
Frank Koehl
  • 3,104
  • 2
  • 29
  • 37
0
votes
1 answer

Rugged can't cherry pick

I'm trying to use rugged (ruby) to cherry pick a commit on a branch like this: repo.fetch('origin', ['origin/stable/branch_name'],credentials: rugged_credentials) repo.reset('origin/stable/branch_name',…
Kerby82
  • 4,934
  • 14
  • 48
  • 74
0
votes
0 answers

How to fix 'Makefile:257: recipe for target 'rugged.so' failed' (rugged)

I'm trying to install pronto gem and one of its dependency (rugged) is failing to build. So, trying to run gem install rugged gives me such output https://pastebin.com/m6v2RgQt I've checked that I have cmake installed and other optional dependencies…
Gleb
  • 93
  • 10
0
votes
2 answers

Removing a tree and committing with Rugged

I'm trying to remove an array of directories in a git repo and make 1 commit for each directory removed. I'm using Rugged and Gitlab_git (which is more or less just a wrapper around Rugged) and so far I've managed to do everything I need to except…
Jtgrenz
  • 591
  • 1
  • 6
  • 21
0
votes
0 answers

Ruby/Rugged How can I save change after a git fetch?

So, I wanted to perform a git pull with rugged, so I make a fetch and merge like this: require 'rugged' certificat = Rugged::Credentials::SshKey.new({username: 'git', privatekey: 'path/to/privatekey', publickey: 'path/to/publickey' }) repo =…
Equinox
  • 11
  • 6
0
votes
2 answers

Rugged (libgit2) stage for index

Looking at index (following a call to merge_commits between master and a branch), I'm seeing 3 results for the same file, {:path=>"file.txt", :oid=>"c6fdbacd7400805042668f4ccf70fc1ebbdac361", :dev=>0, :ino=>0, :mode=>33188, :gid=>0, :uid=>0,…
Cenoc
  • 11,172
  • 21
  • 58
  • 92
0
votes
1 answer

get all commit of a file/path with rugged

I would like to get the list of all the commits for a file/path but I don't know how to do it. For example I want all the commit of the file "test", to get oid of each commit and thanks to this oid, I will get the blob of all revision for this…
fd80132
  • 41
  • 2
  • 6
0
votes
1 answer

Dealing with merge conflicts in Rugged

I'm working on a Ruby script that needs to do some merging. What I'd like to do is, given a target reference and a commit to merge attempt to merge them, and if there are merge conflicts give control back to the user to resolve them, basically…
Anton
  • 27
  • 4
0
votes
1 answer

Can I create an orphaned tag using Rugged or another Ruby library?

I am trying to emulate the following in Ruby: object=$1 tag_name=$2 message=$3 user_name=git config user.name user_email=git config user.email date=date +%s tag="object ${object} type commit tag ${tag_name} tagger…
Daniel Devlin
  • 95
  • 1
  • 11
0
votes
0 answers

Proper way to update a Reference in Rugged

As a followup to an earlier question, I'm trying to update one reference (e.g. release) to point to another reference (e.g. master). If I have a master and a release branch, and master is a single commit ahead of release, I'd like to "fast-forward"…
Max
  • 4,882
  • 2
  • 29
  • 43
0
votes
1 answer

"git branch --merged " via Rugged libgit2 bindings?

Is there any way to get the same information as the native git command git branch --merged via the Rugged libgit2 bindings for Ruby?
cschol
  • 12,799
  • 11
  • 66
  • 80
0
votes
1 answer

Rugged::Repository #status reports a cleared status when using Rugged to add a file to the index

I am attempting to use Rugged::Index #add to add a new file to the index. It seems to be successfully added to the index but the associated Rugged::Repository #status is cleared for the given file. Example IRB session showing my attempt to add file…