Getting incorrect return from get_commit_diffs()
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at the get_commit_diffs() entry point and compare the Python arguments with the REST request shown in the issue, especially the base and target commit descriptors. Reproduce the call and verify whether the returned base_commit, target_commit, and changes match the direct REST response; done means the Python API returns the expected diff.
Written by the indexing model from the issue text.
Description
I'm trying to get the diff between two commit, therefore using this API as,
ref_heads = git_client.get_refs(repository_id=REPOSITORY_ID, project=PROJECT_NAME, filter=target_branch)
master_commit_id = ref_heads.value[0].object_id
source_commit_id = pull_request.last_merge_source_commit.commit_id
base_version_descriptor = GitBaseVersionDescriptor(version_type='commit', version=master_commit_id)
target_version_descriptor = GitTargetVersionDescriptor(version_type='commit', version=source_commit_id)
commit_diffs = git_client.get_commit_diffs(repository_id=REPOSITORY_ID, project=PROJECT_NAME,
diff_common_commit=True,
base_version_descriptor=base_version_descriptor,
target_version_descriptor=target_version_descriptor)
while print the commit_diffs, having output as,
Diffs Response: {'additional_properties': {}, 'ahead_count': 0, 'all_changes_included': True, 'base_commit': 'b106b44eebeef93d5240f08dca8ceb0124ca4415', 'behind_count': 0, 'change_counts': {}, 'changes': [], 'common_commit': 'b106b44eebeef93d5240f08dca8ceb0124ca4415', 'target_commit': 'b106b44eebeef93d5240f08dca8ceb0124ca4415'}
whereas, using curl to set direct REST request, returns correct output.
"https://dev.azure.com/ORGANIZATION/project/_apis/git/repositories/a21206d3-9bdb-41c4-8b77-56f82360a311e/diffs/commits?baseVersionType=commit&baseVersion=b106b44eebeef93d5240f08dca8ceb0124ca4415&targetVersionType=commit&targetVersion=165c197e54d689e9910eb111b9c14e2516184dd8&api-version=6.0"
What is the correct way to use the get_commit_diff()? Or what I'm doing wrong?
- Dominant language
- Python
- Stars
- 684
- Forks
- 218
- Avg merge
- 8d 10h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/azure-devops-python-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in microsoft/azure-devops-python-api
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·