Atlassian Git API Diff使用Git表示法提交

问题描述 投票:0回答:1

我已成功地使用stash git API“diff”两个文件,但是,每次必须指定提交的完整哈希值时,如下所示:

rest/api/latest/projects/{project}/diff/{path to file}?since={hash}&until={hash}

我想做的是这样的事情:

rest/api/latest/projects/{project}/diff/{path to file}?since=HEAD^^&until=HEAD

类似于:

git diff HEAD^^ HEAD {my_file}(HEAD和之前提交的文件之间的差异。)

我能够从API获取历史提交列表的唯一方法是使用他们的文档中的以下内容:

https://stash.atlassian.com/rest/api/1.0/projects/JIRA/repos/jira/commits

将:“最新提交到JIRA项目中的jira存储库”但不是针对特定文件。

从我能够找到的,似乎API不支持此功能。

bitbucket-server
1个回答
0
投票

由于我的Firefox控制台,我能够解决这个问题。 UI使用历史记录下拉列表显示文件的最后25次提交,其中包含以下URL:

rest/api/latest/projects/{project}/commits?path={path_to_fil‌​e}&until=refs%2Fhead‌​s%2Fmaster&start=0&l‌​imit=25
© www.soinside.com 2019 - 2024. All rights reserved.