问题标签 [pygit2]
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.
python - Repository.walk 是否遍历所有提交
在pygit2
,Repository.walk
可用于从提交开始遍历提交。
但是,文档没有明确说明是否将遍历存储库中的所有提交,包括悬空提交,或者只是开始提交的父级和子级。
如果这不包括悬空提交,我能做些什么来遍历它们吗?
hash - 如何使用 pygit2 通过 SHA-1 哈希检查修订?
似乎 Repository.checkout 只能签出一个参考。
我们可以通过 SHA1-hash 检查 repo 中的任何修订吗?
相当于颠覆系统中的“svn checkout -r”
github - 如何在 pygit2.clone_repository 中设置凭据?
当我通过 pygit2 从 github 克隆一个 repo 时,它返回:'OSError: Failed to send request: A security error occurred'
代码很简单,
但它不起作用,对吗?
python - 在pygit2中更新TreeEntry多个级别
无法弄清楚如何更新多层次深度的条目。我下面的示例是尝试更新 test/hist/out 中的文件,但它也会从 test/hist/ 中删除所有其他文件。
构造TreeBuilder
函数不接受 TreeEntries,只接受 Trees,所以我不知道该怎么做。任何想法?
python - Implementing Pull with Pygit2
I am trying to implement some 'porcelain' commands using pygit2. It seems that I have run into a bit of road block while implementing pull. Specifically the easiest pull case, a fast forward.
Setup:
I have two git repos. One 'remote' and one 'local'. I make one commit on the remote repo and then create the local repo using pygit2's clone_repository()
. I make a subsequent commit on the remote and then attempt to run the pull()
function outlined below.
My implementation:
After the fast forward bit of my code executes, my index is no longer clean and I have no idea why. Looking at the git-log, it looks successful. My head and the master branch are now pointing at the most recent commit on the remote repo. However, why was remote_repo_test.txt
modified in the process of running set_target()
.
The Outputs:
The pull print statements:
Git log:
Git status:
remote_repo_test.txt content:
Related Questions without Answers:
- pulling and integrating remote changes with pygit2
- Implementing 'git pull' with libgit2?
- Performing a “fast-forward” merge with Rugged
Thoughts?
python - 安装 pygit2 时出错
我必须在我的 ubuntu 机器上安装 pygit2 库。当我尝试“pip install pygit2”时出现以下错误。
cffi.ffiplatform.VerificationError: CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
清理...命令 python setup.py egg_info 在 /tmp/pip_build_root/pygit2 中失败,错误代码 1 在 /root/.pip/pip.log 中存储失败的调试日志
在此之前,我做了以下事情很好(http://www.pygit2.org/install.html#quick-install)。
我的机器上已经有 libffi6 了。
python - 如何在 python 中打印 pygit 对象的内容
我正在尝试打印“差异”对象,如下所示。我期待类似于 git show 的输出,但我没有得到相同的结果。我如何实现这一目标?谢谢。
python - 从提交树中提取与代码更改相关的提交
现在,我可以使用 pygit2 库遍历 github 存储库的提交树。我正在获取存储库中每个文件更改的所有提交。这意味着我也在存储库中获得扩展名为 .rtf 的文本文件的更改。如何过滤掉仅与代码更改相关的提交?我不想要与文本文档相关的更改。
感谢任何帮助或指示。谢谢。
作为输出的一部分,我得到了 rtf 文件的差异以及以下内容:
要么我必须从树中过滤提交,要么我必须过滤输出。我在想是否可以通过在遍历树时删除相应的提交来删除与 rtf 文件相关的更改。
python - 使用 pygit2 在远程存储库上创建一个分支
我正在使用 pygit2 在远程存储库上创建一个分支。如果它在本地存储库中,我会使用:
但是当我给函数 Repository 一个远程 url(不是路径)它不起作用时,有解决方案吗?