gpt4 book ai didi

libgit2sharp - 如何计算前支或后支

转载 作者:行者123 更新时间:2023-12-04 05:22:28 26 4
gpt4 key购买 nike

使用 libgit2sharp ,如何计算aheadbehind指标。赞本页 https://github.com/libgit2/libgit2sharp/branches

最佳答案

How to calculate ahead or behind metrics



每个 Branch熊一个 TrackingDetails属性(property)。此属性暴露 AheadByBehindBy可为空值(当分支没有上游配置或上游分支不存在时,将返回 null)。

这些值将表示与上游分支(即正在跟踪的远程分支)相比,本地分支领先/落后的提交数量。

这会输出与 git status -sb 相似的结果

like this page https://github.com/libgit2/libgit2sharp/branches



该页面实际上将上游(即托管在 GitHub 上的那个)存储库的每个分支与远程 HEAD 的当前提示进行比较。 .此功能(比较两个本地分支)在 LibGit2Sharp 中不可用。

如果您对此感兴趣,请随时联系 open a feature request .

更新

引入新方法 repo.ObjectDatabase.CalculateHistoryDivergence(Commit, Commit) 的拉取请求(参见 #564 )正在做饭。

这将允许用户确定超前和超后计数,以及用于计算这些距离的合并基数。

关于libgit2sharp - 如何计算前支或后支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19930935/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com