问题标签 [rugged]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
417 浏览

ruby - 坚固的已安装,但捆绑器无法安装

我正在尝试安装 Gitorious,我想安装 Gitorious 所需的 gem。我目前正在运行 ruby​​ 2.0.0 patchlevel 247(我能得到的最新更新。)和 ruby​​gems 版本 2.0.3。我也在一个共享的 Dreamhost 共享平台上使用这个 wiki 页面http://wiki.dreamhost.com/Gitorious虽然它有点过时了,但我仍然让它工作。当我运行gem install rugged -v '0.19.0'它返回 Building native extensions. This could take a while... Successfully installed rugged-0.19.0 unable to convert "\x85" from ASCII-8BIT to UTF-8 for test/fixtures/alternate/objects/14/6ae76773c91e3b1d00cf7a338ec55ae58297e2, skipping unable to convert "\xAD" from ASCII-8BIT to UTF-8 for test/fixtures/alternate/objects/14/9c32d47e99d0a3572ff1e70a2e0051bbf347a9, skipping unable to convert "\xED" from ASCII-8BIT to UTF-8 for test/fixtures/alternate/objects/14/fb3108588f9421bf764041e5e3ac305eb6277f, skipping unable to convert "\xE5" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/index, skipping unable to convert "\x8C" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/0c/37a5391bbff43c37f0d0371823a5509eed5b1d, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/13/85f264afb75a56a5bec74243be9b367ba4ca08, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/18/1037049a54a1eb5fab404658a3a250b44335d7, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/18/10dff58d8a660512d4832e740f692884338ccd, skipping unable to convert "\x95" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/2d/2eff63372b08adf0a9eb84109ccf7d19e2f3a2, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/36/060c58702ed4c2a40832c51758d5344201d89a, skipping unable to convert "\xA5" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/44/1034f860c1d5d90e4188d11ae0d325176869a8, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/45/b983be36b73c0788dc9cbcb76cbb80fc7bb057, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/4a/202b346bb0fb0db7eff3cffeb3c70babbd2045, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/5b/5b025afb0b4c913b4c338a42934a3863bf3644, skipping unable to convert "\xB3" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/60/d415052a33de2150bf68757f6461df4f563ae4, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/61/9f9935957e010c419cb9d15621916ddfcc0b96, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/68/8a8f4ef7496901d15322972f96e212a9e466cc, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/75/057dd4114e74cca1d750d0aee1647c903cb60a, skipping unable to convert "\xED" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/77/71329dfa3002caf8c61a0ceb62a31d09023f37, skipping unable to convert "\xB3" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/81/4889a078c031f61ed08ab5fa863aea9314344d, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/84/96071c1b46c854b31185ea97743be6a8774479, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/94/eca2de348d5f672faf56b0decafa5937e3235e, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/9b/7384fe1676186192842f5d3e129457b62db9e3, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/9f/d738e8f7967c078dceed8190330fc8648ee56a, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/a4/a7dce85cf63874e984719f4fdd239f5145052f, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/a7/1586c1dfe8a71c6cbf6c129f404c5642ff31bd, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/a8/233120f6ad708f843d861ce2b7228ec4e3dec6, skipping unable to convert "\xA5" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/b7/4713326bc972cc15751ed504dca6f6f3b91f7a, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/be/3563ae3f795b2b4353bcce3a527ad0a4f7f644, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/c4/7800c7266a2be04c571c04d5a6614691ea99bd, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/c4/dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391, skipping unable to convert "\xB3" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/f6/0079018b664e4e79329a7ef9559c8d9e0378d1, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/fa/49b077972391ad58037050f2a75f74e3671e92, skipping unable to convert "\xB3" from ASCII-8BIT to UTF-8 for test/fixtures/testrepo.git/objects/fd/093bff70906175335656e6ce6ae05783708765, skipping unable to convert "\xF0" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/08/8b64704e0d6b8bd061dea879418cb5442a3fbf, skipping unable to convert "\xB2" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/13/a5e939bca25940c069fd2169d993dba328e30b, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/19/bf568e59e3a0b363cafb4106226e62d4a4c41c, skipping unable to convert "\xBF" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/58/1fadd35b4cf320d102a152f918729011604773, skipping unable to convert "\x85" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/5c/87b6791e8b13da658a14d1ef7e09b5dc3bac8c, skipping unable to convert "\x85" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/6f/e5f5398af85fb3de8a6aba0339b6d3bfa26a27, skipping unable to convert "\x95" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/7f/ccd75616ec188b8f1b23d67506a334cc34a49d, skipping unable to convert "\x95" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/80/6999882bf91d24241e4077906b9017605eb1f3, skipping unable to convert "\xB2" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/83/7d176303c5005505ec1e4a30231c40930c0230, skipping unable to convert "\x95" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/a8/595ccca04f40818ae0155c8f9c77a230e597b6, skipping unable to convert "\xF0" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/cf/8f1cf5cce859c438d6cc067284cb5e161206e7, skipping unable to convert "\x85" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/d5/278d05c8607ec420bfee4cf219fbc0eeebfd6a, skipping unable to convert "\xB2" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/f4/e16fb76536591a41454194058d048d8e4dd2e9, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for test/fixtures/unsymlinked.git/objects/f9/e65619d93fdf2673882e0a261c5e93b1a84006, skipping 1 gem installed 当我bundle install在克隆主线 repo 后运行时,它返回 `Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension。

/home/harborcn/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/shellwords.rb:73:in 'shellsplit': 未定义方法'scan' for true:TrueClass (NoMethodError) from /home/harborcn/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:2409:in '' 来自 /home/harborcn/.rvm/rubies/ruby-2.0。 0-p247/lib/ruby/2.0.0/mkmf.rb:47:in '' 来自 /home/harborcn/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/ rubygems/core_ext/kernel_require.rb:45:in 'require' from /home/harborcn/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb :45:in 'require' 来自 extconf.rb:1:in ''

Gem 文件将继续安装在 /home/harborcn/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rugged-76f3382f7eb0 以供检查。结果记录到 /home/harborcn/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rugged-76f3382f7eb0/ext/rugged/gem_make.out 安装加固型 (0.19.0) 和 Bundler 时出错无法继续。在捆绑之前确保 gem install rough -v '0.19.0' 成功。`

我该如何解决?谢谢!

0 投票
1 回答
151 浏览

ruby - 创建新标签

只是想知道是否可以使用 Rugged 创建新的 GIT 标签。如果是这样,一个例子将不胜感激。

我基本上只是想在提交 oid 上创建/移动/删除标签。

0 投票
1 回答
203 浏览

libgit2 - 如何从补丁创建差异对象?

我在数据库中有 git 补丁。如何将其转换为 diff 对象?在这里https://github.com/libgit2/rugged#diffs我可以从差异中获取补丁,diff.patch我想进行相反的操作。

0 投票
1 回答
421 浏览

rugged - clone_at 和 fetch 返回 Rugged::NetworkError: 此传输未实现。对不起

所以我一直在尝试结合使用坚固的获取和克隆 repo 的能力。我试过以下

还有这个

这也是

所有这些都返回错误

现在,通常情况下,我会接受该错误,因为它尚未实施。但是,看到这样的问题还有这个。我质疑那个错误的准确性。

我已确保 libgit2 和 libssh2 都安装在运行此代码的本地系统上。

我还查看了源代码,试图找到生成此错误的位置,但无法找到它。对我来说,这没有意义,因为错误的描述性不足以具体指出它失败的地方。

我的问题是,这是预期的行为吗?根据我找到的有关此的问题和答案,我认为不是。在这种情况下,有人知道这是否是一个常见问题吗?任何帮助表示赞赏。

0 投票
2 回答
579 浏览

git - 坚固耐用,相当于“git ls-tree”

在一个裸存储库中,我可以键入$ git ls-tree -r master. (这与我可以使用命令在非裸仓库中获得的东西是一样的git ls-files

获取 git 存储库中文件及其 sha refs 的完整列表。

使用 Rugged,我如何获取特定分支或主控中的文件列表?

0 投票
1 回答
110 浏览

git - Rugged::Repository #status 在使用 Rugged 将文件添加到索引时报告清除状态

我正在尝试使用 Rugged::Index #add 将新文件添加到索引中。它似乎已成功添加到索引中,但为给定文件清除了关联的 Rugged::Repository #status。

显示我尝试添加文件“TEST_JJV_IRB1”的示例 IRB 会话

Rugged::Repository #status 正确报告了新创建的文件“TEST_JJV_IRB1”

并且正确地未包含在 Rugged::Index 中

在这里,我尝试将新文件添加到索引中。

正在添加的文件“TEST_JJV_IRB1”现在已正确包含在索引中。

但它的状态报告为 Rugged::Repository #status 已清除

我希望 Rugged::Repository #status 报告 [:index_new]

奇怪的是git status,从命令行发出的新文件“TEST_JJV_IRB1”显示为“要提交的更改:”

0 投票
1 回答
191 浏览

ruby - “git 分支——合并“通过坚固的 libgit2 绑定?

有没有办法获得与原生 git 命令相同的信息

通过 Ruby 的Rugged libgit2 绑定?

0 投票
1 回答
128 浏览

ruby - 是否有使用 Rugged 将所有内容添加到 Git 的特定协议?

我最近开始使用 Rugged,并且已经遇到了一些问题。基本上我想做的就是在 Git 存储库中添加所有内容,提交分阶段的更改,然后将所有内容推送到分支。我从第一步开始,如下所示:

但控制台最终对我尖叫。我浏览了 libgit2 的文档,找不到任何在 repo 中添加所有内容的示例。一些彻底的谷歌搜索产生了类似的结果。我可能只是将 a@repo.workdir.entries作为 的path参数插入index.add,但我不确定。有没有更好的方法来解决这个问题?

0 投票
1 回答
863 浏览

ruby - 使用 Rugged 执行“快进”合并

使用 Rugged,执行快进“合并”的规范方法是什么?

这里我发现了一个可能的线索:

但我很好奇这里是否有改进的余地。

0 投票
1 回答
336 浏览

ruby - 使用 Rugged/libgit2 创建提交时如何更新工作目录?

我正在尝试使用以下测试脚本创建一个坚固的提交:

创建提交,并且脚本输出773d97f453a6df6e8bb5099dc0b3fc8aba5ebaa7(新提交的 SHA)。生成的提交和树看起来应该是:

但是,工作目录没有更新:

我必须做一个git reset --hard HEAD让丢失的文件test.md显示在工作目录中。我认为创建 Rugged 提交和设置:update_ref => "HEAD"应该会自动更新工作目录,但肯定有问题,因为这样做r.checkout_head也没有效果。但是,我认为我正确地遵循了坚固的示例。我在这里想念什么?

编辑: