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) or application/yaml
Response Headers:
 
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 revision
  • id (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 it
  • type (string) – the type of the revision

Allowed HTTP Methods: GET, HEAD, OPTIONS

Status Codes:

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) or application/yaml
Response Headers:
 
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

Allowed HTTP Methods: GET, HEAD, OPTIONS

Status Codes:

Example:

https://archive.softwareheritage.org/api/1/revision/f1b94134a4b879bc55c3dacdb496690c8ebdc03f/directory/
GET /api/1/revision/(sha1_git)[/prev/(prev_sha1s)]/log/

Get a list of all revisions heading to a given one, in other words show the commit log.

Parameters:
  • sha1_git (string) – hexadecimal representation of the revision sha1_git identifier
  • prev_sha1s (string) – optional parameter representing the navigation breadcrumbs (descendant revisions previously visited). If multiple values, use / as delimiter. If provided, revisions information will be added at the beginning of the returned list.
Query Parameters:
 
  • per_page (int) – number of elements in the returned list, for pagination purpose
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
  • Content-Type – this depends on Accept header of request
  • Link – indicates that a subsequent result page is available and contains the url pointing to it
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 revision
  • id (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 it
  • type (string) – the type of the revision

Allowed HTTP Methods: GET, HEAD, OPTIONS

Status Codes:

Example:

https://archive.softwareheritage.org/api/1/revision/e1a315fa3fa734e2a6154ed7b5b9ae0eb8987aad/log/