atlassian


Atlassian Git API Diff Commits using Git notation


I have successfully been able to "diff" two files using the stash git API, however, each time you have to specify the full hashes of the commits, like so:
rest/api/latest/projects/{project}/diff/{path to file}?since={hash}&until={hash}
What I would like to do is something like this:
rest/api/latest/projects/{project}/diff/{path to file}?since=HEAD^^&until=HEAD
To resemble:
git diff HEAD^^ HEAD {my_file} (So diff between the HEAD and previous commits on that file.)
The only way I have been able to get a list of historical commits from the API is using the following from their docs:
https://stash.atlassian.com/rest/api/1.0/projects/JIRA/repos/jira/commits
which will: "the latest commits to the jira repository in the JIRA project" but not for a specific file.
From what I have been able to find it seems as though the API does not support this functionality.
I have been able to solve this, thanks to my Firfox console. The UI makes use of a history drop down showing the last 25 commits to the file with the following URL:
rest/api/latest/projects/{project}/commits?path={path_to_fil‌​e}&until=refs%2Fhead‌​s%2Fmaster&start=0&l‌​imit=25

Related Links

What is the practical difference between atlas-run and atlas-run-standalone in the Atlassian SDK?
Commit Not Found on Bitbucket on PreReceiveRepositoryHook
Making text bold based on page tree depth in Confluence
Sql query to get all pages and their associated links for all confluence spaces
Atlassian Crowd Custom Connector Issue with AddUser - looking for Example Code and Documentation
WARNs in Confluence 6.0.1 after upgrade
compact code block in confluence wiki
Atlassian Confluence: Rest Api Create attachments Error 500 and Permission denied
Atlassian Git API Diff Commits using Git notation
Autogenerating atlassian confluence pagesusing JSDocs
Confluence atlassian change event listener
Enumerating user macro instances in Confluence
Add attachment to Jira using REST API
Update an open pull request successfully but get 409 conflict code
How do you reset HipChat Server Guest Console password
In Crowd is it possible to grant a user to JIRA and not to Confluence?

Categories

HOME
service-worker
delphi-7
ng-idle
jelastic
requirements
r-googlesheets
rendering
appcelerator
opendj
access
newrelic
big-o
web-hosting
telegram-bot
square
jetty
nuget-package
watson-conversation
startup
automatic-ref-counting
gource
eip
firefox-addon
shortest-path
guzzle
jquery-ias
backpack-for-laravel
nstimer
linked-data
testcomplete
livelink
classcastexception
reactjs.net
getlasterror
parse-tree
xcode7.3
apns-php
diacritics
levenshtein-distance
optimizely
servermanager
pair-programming
headless
monkey
universal-analytics
mathcad
swingworker
cronexpression
atlas
actor-platform
redbeard-ios
windows-azure-queues
tooleap
firebase-security
omniauth-facebook
kango-framework
tracker-enabled-dbcontext
upx
np-spring
contentcontrol
jbase
ons-api
dronekit-android
airbrake
graphics2d
kubuntu
zxspectrum
cross-join
mass-assignment
rapidsvn
mruby
sql-scripts
psr-4
jquery-slider
multitasking
mt4j
kendo-dataviz
oocss
actiondispatch
video-codecs
robotlegs
apache-whirr
failing-tests
node-redis
workflow-services
filemerge
tournament
instantiationexception
delimited-text
non-clustered-index
addchild
burndowncharts
windows-identity
escrow
blind
cardspace

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App