Revision¶
-
GET
/api/1/revision/
(sha1_git)/
¶ Get information about a revision in the archive. Revisions are identified by sha1 checksums, compatible with Git commit identifiers. See
swh.model.identifiers.revision_identifier()
in our data model module for details about how they are computed.- Parameters
sha1_git (string) – hexadecimal representation of the revision sha1_git identifier
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
- Response JSON Object
author (object) – information about the author of the revision
committer (object) – information about the committer of the revision
committer_date (string) – ISO representation of the commit date (in UTC)
date (string) – ISO representation of the revision date (in UTC)
directory (string) – the unique identifier that revision points to
directory_url (string) – link to
GET /api/1/directory/(sha1_git)/[(path)/]
to get information about the directory associated to the revisionid (string) – the revision unique identifier
merge (boolean) – whether or not the revision corresponds to a merge commit
message (string) – the message associated to the revision
parents (array) – the parents of the revision, i.e. the previous revisions that head directly to it, each entry of that array contains an unique parent revision identifier but also a link to
GET /api/1/revision/(sha1_git)/
to get more information about ittype (string) – the type of the revision
- Status Codes
200 OK – no error
400 Bad Request – an invalid sha1_git value has been provided
404 Not Found – requested revision can not be found in the archive
Example:
https://archive.softwareheritage.org/api/1/revision/aafb16d69fd30ff58afdd69036a26047f3aebdc6/
-
GET
/api/1/revision/
(sha1_git)/directory/[
(path)/]
¶ Get information about directory (entry) objects associated to revisions. Each revision is associated to a single “root” directory. This endpoint behaves like
GET /api/1/directory/(sha1_git)/[(path)/]
, but operates on the root directory associated to a given revision.- Parameters
sha1_git (string) – hexadecimal representation of the revision sha1_git identifier
path (string) – optional parameter to get information about the directory entry pointed by that relative path
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
- Response JSON Object
content (array) – directory entries as returned by
GET /api/1/directory/(sha1_git)/[(path)/]
path (string) – path of directory from the revision root one
revision (string) – the unique revision identifier
type (string) – the type of the directory
- Status Codes
200 OK – no error
400 Bad Request – an invalid sha1_git value has been provided
404 Not Found – requested revision can not be found in the archive
Example:
https://archive.softwareheritage.org/api/1/revision/f1b94134a4b879bc55c3dacdb496690c8ebdc03f/directory/
-
GET
/api/1/revision/
(sha1_git)/log/
¶ Get a list of all revisions heading to a given one, in other words show the commit log.
The revisions are returned in the breadth-first search order while visiting the revision graph. The number of revisions to return is also bounded by the limit query parameter.
Warning
To get the full BFS traversal of the revision graph when the total number of revisions is greater than 1000, it is up to the client to keep track of the multiple branches of history when there’s merge revisions in the returned objects. In other words, identify all the continuation points that need to be followed to get the full history through recursion.
- Parameters
sha1_git (string) – hexadecimal representation of the revision sha1_git identifier
- Query Parameters
limit (int) – maximum number of revisions to return when performing BFS traversal on the revision graph (default to 10, can not exceed 1000)
- Request Headers
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers
Content-Type – this depends on Accept header of request
- Response JSON Array of Objects
author (object) – information about the author of the revision
committer (object) – information about the committer of the revision
committer_date (string) – ISO representation of the commit date (in UTC)
date (string) – ISO representation of the revision date (in UTC)
directory (string) – the unique identifier that revision points to
directory_url (string) – link to
GET /api/1/directory/(sha1_git)/[(path)/]
to get information about the directory associated to the revisionid (string) – the revision unique identifier
merge (boolean) – whether or not the revision corresponds to a merge commit
message (string) – the message associated to the revision
parents (array) – the parents of the revision, i.e. the previous revisions that head directly to it, each entry of that array contains an unique parent revision identifier but also a link to
GET /api/1/revision/(sha1_git)/
to get more information about ittype (string) – the type of the revision
- Status Codes
200 OK – no error
400 Bad Request – an invalid sha1_git value has been provided
404 Not Found – head revision can not be found in the archive
Example:
https://archive.softwareheritage.org/api/1/revision/e1a315fa3fa734e2a6154ed7b5b9ae0eb8987aad/log/