Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 9,362
    • Issues 9,362
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Do not update/delete: Banner broadcast message test data

Do not update/delete: Notification broadcast message test data

  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #3138
Closed
Open
Issue created Aug 10, 2017 by username-removed-1508846@g-tit-oxygen

last_commit_id parameter should refer to the file commit_id in API

Description

The get-file-from-repository API returns a "commit_id" and a "last_commit_id". The "commit_id" refers to the commit where the file was modified while the "last_commit_id" refers to the last commit done on the specified branch.

The "last_commit_id" parameter was introduced in the update-existing-file-in-repository API in this issues 32642, 11694. The idea was to know if a file had been modified since the last time the user opened a file, not to know if the entire branch has been modified.

At the moment, if a user gets a file X with the api and someone else edits file Y before the user gets to commit file X, when calling the commit api, a 400 error message will be returned even though file X was not actually modified.

Note that the documentation actually says "last_commit_id : Last known file commit id".

Proposal

Make the "last_commit_id" parameter from the update-existing-file-in-repository API refer to the "commit_id" of a file. This way a more fine grained result is returned, one can know exactly if a file has been modified or not.

This makes sense because the repository_files API works on individual files, not on a repository or a branch.

Use cases

  • The use-case described here.

Feature checklist

  • Feature assurance
  • Documentation
  • Added to features.yml
Assignee
Assign to
Time tracking