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
2
votes
1 answer

Is there a 'git cherry' in libgit2

I'm working on a project and one of the requirements is the need to call git cherry command to get some differences between on branch and the other - (note this is not git cherry-pick). I was planning to use ruby rugged gem for this project but I…
RobisonSantos
  • 611
  • 6
  • 16
2
votes
2 answers

How to select the appropriate diff /patch for a commit with rugged

I try to get the commits that have been done after a date in a local copy of a git repo and then extract the related modifications on the files. If I would like to compare this to a git command, It would be : git log -p --reverse…
cedlemo
  • 3,205
  • 3
  • 32
  • 50
2
votes
1 answer

How to `git diff --name-only master` with rugged?

In Ruby, using the rugged gem, how does one do the equivalent of the following? %x(git diff --name-only master) I need to list changed files that are either staged or unstaged.
jwfearn
  • 28,781
  • 28
  • 95
  • 122
2
votes
1 answer

Error trying to reinstall rugged gem

I'm trying to reinstall rugged as it's causing issues with another program (Dandelion Deploy). I've recently updated my RVM and Ruby, and installed cmake and pkg-config again, but I get this error when I run the following command: gem install…
jx3
  • 921
  • 1
  • 7
  • 22
2
votes
1 answer

Are rugged Repository instances threadsafe?

My question boils down to the title: are rugged Repository instances (intended to be) threadsafe? While I'm at it, I may be able to settle a question I've been having longer: is access to a git repository using rugged (intended to be) threadsafe…
Confusion
  • 16,256
  • 8
  • 46
  • 71
2
votes
1 answer

Rugged merge commit from origin does not update working tree

Similar to this question, but instead of creating a new file, I'm trying to merge from origin. After creating a new index using Rugged::Repository's merge_commits, and a new merge commit, git reports the new file (coming from origin) as…
2
votes
1 answer

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

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",…
dometto
  • 21
  • 1
2
votes
1 answer

Performing a "fast-forward" merge with Rugged

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…
Max
  • 4,882
  • 2
  • 29
  • 43
2
votes
2 answers

Rugged equivalent to 'git ls-tree'

In a bare repository I can type $ git ls-tree -r master. (this is sort of the same thing I can get in a none-bare repos with the command git ls-files ) for a full list of files and their sha refs in a git repository. With Rugged, how do I get that…
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
2
votes
1 answer

How to create diff object from patch?

I have git patch in database. How can I convert it to diff object? Here https://github.com/libgit2/rugged#diffs I can take patch from diff diff.patch I want to make opposite operation.
Headless
  • 233
  • 3
  • 11
2
votes
0 answers

rugged is installed but bundler fails to install

I am trying to install Gitorious and I want to install the gems required for Gitorious. I am currently running ruby 2.0.0 patchlevel 247 (Most updated as I can get.), and rubygems version 2.0.3. I am also on a shared Dreamhost shared platform using…
2
votes
1 answer

how can i use rugged to create and commit a file like from the command line?

i'm trying to use rugged to do something pretty simple: create and commit a file, leaving the repository in the same state as doing: git init echo "blah blah blah" > blah.txt git add blah.txt git commit -m "write blah.txt" which leaves git status…
nrser
  • 1,287
  • 1
  • 13
  • 23
2
votes
0 answers

Does Rugged Support .gitattributes?

If so, can someone point me at how to make use of them? I know that libgit2 supports them from this, but I'm not having any luck in my research regarding support within Rugged.
kyrofa
  • 1,759
  • 1
  • 14
  • 19
1
vote
0 answers

Obtain all commits in all branches Using Ruby Rugged

Using the Rugged gem, I want to obtain all commits in all branches, similar to this git command line: $ git log --all Walker requires a branch, so the following only works for the specified branch: repo = Rugged::Repository.new(working_dir) walker…
Mike Slinn
  • 7,705
  • 5
  • 51
  • 85
1
vote
1 answer

rugged gem failing to build native extension

OS: Ubuntu 18.04 GCC version: gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) JRuby version: 9.2.8.0 Ruby version: 2.5.3 Issue origin: Trying to install pronto gem (version 0.11.0) While running gem install pronto, the gem install fails at a…