2016-12-13 1 views
4

GIT 커밋을 쿼리하여 특정 커밋과 관련된 작업 항목 ID를 가져 오려고합니다. (https://www.visualstudio.com/en-us/docs/integrate/api/git/commits)TFS GIT REST API 관련 커밋 작업 항목 받기

요청 :

http://{server}/tfs/{collection}/{git repository}/_apis/git/repositories/{repository name}/commits?api-version=1.0 

불행하게도이 잘린 의견을 반환하고 그 때문에이 작업 항목 ID (# {작업 항목 ID를})를 참조하는 것이 항상 가능한 것은 아니다.

{ 
    "count": 100, 
    "value": [{ 
      "commitId": "commit hash", 
      "author": { 
       "name": "some name", 
       "email": "some email", 
       "date": "2016-12-12T14:29:28Z" 
      }, 
      "committer": { 
       "name": "some name", 
       "email": "some email", 
       "date": "2016-12-12T14:29:28Z" 
      }, 
      "comment": "Merge branch 'someBranch' of something.", 
      "commentTruncated": true, 
      "changeCounts": { 
       "Add": 5, 
       "Edit": 34 
      }, 
      "url": "url", 
      "remoteUrl": "remoteUrl" 
     }] 
} 

위의 응답에서 "commentTruncated"속성은 true로 설정됩니다. 설명서를 읽었지만 전체 설명이나 관련 작업 항목을 별도로 얻는 솔루션을 찾지 못했습니다.

답변

3

각 커밋의 세부 정보를 묻습니다.

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commits/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4?api-version=1.0

는 문서에서 Just the commit 섹션을 참조하십시오.

+0

고맙습니다! 내가 기대했던 것이 실제로는 아니었지만 그것이 유일한 접근이라면 나는 그걸로 갈 것입니다. –

관련 문제