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

Allow a watch of dynamically created content in Confluence
Sourcetree Installation - Atlassian Login Stuck
DITA to Confluence 5+
Get list of new wiki pages using Confluence API
Atlassian Plugin Descriptor XML Schema
Is there a way to use a plugin/macro in Confluence to display results on a page?
how to find out how many times blueprints in confluence has been used
Converting a RefApp REST plugin into a Confluence plugin
Show HTML artifacts in bamboo without downloading
Atlassian Bitbucket Server Precommit Issue getting files
Atlassian Stash popup on Pull Request
Failed to load resource:soy template {Not all code is in Soy V 2 syntax (found file simple.soy not in Soy V2 syntax). }
Integrate HipChat into Slack
Section in Atlassian products (refapp)
How to read a file contained as a hash in Atlassian Stash Repository Hook?
Is atlas-run the only way to see how the changes are reflected?

Categories

HOME
grok
eslint
pyqt
socket.io
graphics
requirements
seo
iis-6
jax-ws
jtextpane
recordrtc
commonjs
pega
gource
selectize.js
mathprog
sse
lilypond
visual-glitch
ksh
react-toolbox
strongname
data.stackexchange.com
ms-access-2003
handler
alm
testbed
code-snippets
reactjs.net
sharding
installscript
jwplayer6
magento-1.9.2.4
lint
playframework-2.1
naming
angular-http
jide
fwrite
ovf
yii2-api
tinymce-3
posixct
magic-draw
azure-cli
appdomain
smartfoxserver
usart
pure-css
centrifuge
signalr.client
rspec2
tooleap
vorpal.js
google-query-language
freepbx
dbamp
libav
halcon
kendo-upload
crouton-os
vhosts
assertion
qt5.2
xenomai
morton-number
extjs-grid
skspritenode
matlab-deployment
umlgraph
primitive-types
teaspoon
encryption-asymmetric
jqmodal
ray
amslidemenu
getopt
notorm
solace-mq
away3d
mbunit
jeromq
dolby-audio-api
mantle
chart-director
idn
qtconcurrent
veracity
jdb
failing-tests
fitbounds
gobject-introspection
u2netdk
objective-j
vs-android
rowlex
eclipse-marketplace
murmurhash
silverlight-oob
wysiwym
java1.4
leader
pnrp

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