Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request more infomation via API for "Get a single commit from a repository" #16205

Open
2 of 6 tasks
lchrennew opened this issue Jun 19, 2021 · 0 comments
Open
2 of 6 tasks
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@lchrennew
Copy link

lchrennew commented Jun 19, 2021

  • Gitea version (or commit ref): 1.14.2
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

In current gitea version, the responses of the API for "Get a single commit from a repository" GET /repos/{owner}/{repo}/git/commits/{sha} don't include enough infomation that I need, for example:

I want to show the diffs file by file or summary of a commit, and there's only filenames I can aquire, my expectation:

{
   ...
   stats: {
       total: a number for lines of code changed of this commit,
       additions: a number for lines of code added of this commit,
       deletions: a number for lines of code deleted of this commit,
   },
   files: [
      {
         parent: 'the blob sha of this file before changed (in order to do content diff)',
         sha: 'the blob sha of this file after changed',
         filename: 'the file path',
         status: 'modified | added | deleted',
         additions: a number for lines of code added,
         deletions: a number for lines of code deleted,
         changes: a number for lines of code added plus deleted,
         patch: 'the git diff string, when the sha and parent fields are provided, this field is not nessesary, I think',
         ...
      }
   ]
   ...
}

Screenshots

@noerw noerw added modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jun 27, 2021
lunny pushed a commit that referenced this issue Jul 20, 2023
…) (#25831)

#16205 To obtain a closer behavior to the api from github, the status
(added, modified, removed) of a file should be available in addition to
the filename.
See github doc :

https://docs.github.com/fr/rest/commits/commits?apiVersion=2022-11-28#get-a-commit
zjjhot added a commit to zjjhot/gitea that referenced this issue Jul 21, 2023
* giteaoffical/main: (22 commits)
  Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (go-gitea#25974)
  Use frontend fetch for branch dropdown component  (go-gitea#25719)
  Remove commit status running and warning from the dashboard repo list (go-gitea#26036)
  Refactor to use urfave/cli/v2 (go-gitea#25959)
  Remove commit status running and warning to align GitHub (go-gitea#25839)
  Fix escape problems in the branch selector (go-gitea#25875)
  Update README.md to fix the broken link of Hugo (go-gitea#26008)
  Support copy protected branch from template repository (go-gitea#25889)
  Update JS dependencies (go-gitea#26025)
  Reduce margins on admin pages (go-gitea#26026)
  Actions Artifacts support uploading multiple files and directories (go-gitea#24874)
  [skip ci] Updated translations via Crowdin
  Remove redundant "RouteMethods" method (go-gitea#26024)
  Adding remaining enum for migration repo model type. (go-gitea#26021)
  RPM Registry: Show zypper commands for SUSE based distros as well (go-gitea#25981)
  Fix the route for pull-request's authors (go-gitea#26016)
  Remove nfnt/resize and oliamb/cutter (go-gitea#25999)
  Correctly refer to dev tags as nightly in the docker docs (go-gitea#26004)
  Fix env config parsing for "GITEA____APP_NAME" (go-gitea#26001)
  Add file status for API "Get a single commit from a repository" (go-gitea#16205) (go-gitea#25831)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants