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
  • author_url (string) – link to GET /api/1/person/(person_id)/ to get information about the author of the revision
  • committer (object) – information about the committer of the revision
  • committer_url (string) – link to GET /api/1/person/(person_id)/ to get 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
  • author_url (string) – link to GET /api/1/person/(person_id)/ to get information about the author of the revision
  • committer (object) – information about the committer of the revision
  • committer_url (string) – link to GET /api/1/person/(person_id)/ to get 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/
GET /api/1/revision/origin/(origin_id)/[branch/(branch_name)/][ts/(timestamp)/]

Get information about a revision, searching for it based on software origin, branch name, and/or visit timestamp.

This endpoint behaves like GET /api/1/revision/(sha1_git)/, but operates on the revision that has been found at a given software origin, close to a given point in time, pointed by a given branch.

Warning

All endpoints using an origin_id are deprecated and will be removed in the near future. Only those using an origin_url will remain available. You should instead use successively GET /api/1/origin/(origin_url)/visits/, GET /api/1/snapshot/(snapshot_id)/, and GET /api/1/revision/(sha1_git)/.

Parameters:
  • origin_id (int) – a software origin identifier
  • branch_name (string) – optional parameter specifying a fully-qualified branch name associated to the software origin, e.g., “refs/heads/master”. Defaults to the HEAD branch.
  • timestamp (string) – optional parameter specifying a timestamp close to which the revision pointed by the given branch should be looked up. The timestamp can be expressed either as an ISO date or as a Unix one (in UTC). Defaults to now.
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
  • author_url (string) – link to GET /api/1/person/(person_id)/ to get information about the author of the revision
  • committer (object) – information about the committer of the revision
  • committer_url (string) – link to GET /api/1/person/(person_id)/ to get 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:
  • 200 OK – no error
  • 404 Not Found – no revision matching the given criteria could be found in the archive

Example:

https://archive.softwareheritage.org/api/1/revision/origin/13706355/branch/refs/heads/2.7/
GET /api/1/revision/origin/(origin_id)[/branch/(branch_name)][/ts/(timestamp)]/log

Show the commit log for a revision, searching for it based on software origin, branch name, and/or visit timestamp.

This endpoint behaves like GET /api/1/revision/(sha1_git)[/prev/(prev_sha1s)]/log/, but operates on the revision that has been found at a given software origin, close to a given point in time, pointed by a given branch.

Warning

All endpoints using an origin_id are deprecated and will be removed in the near future. Only those using an origin_url will remain available. You should instead use successively GET /api/1/origin/(origin_url)/visits/, GET /api/1/snapshot/(snapshot_id)/, and GET /api/1/revision/(sha1_git)[/prev/(prev_sha1s)]/log/.

Parameters:
  • origin_id (int) – a software origin identifier
  • branch_name (string) – optional parameter specifying a fully-qualified branch name associated to the software origin, e.g., “refs/heads/master”. Defaults to the HEAD branch.
  • timestamp (string) – optional parameter specifying a timestamp close to which the revision pointed by the given branch should be looked up. The timestamp can be expressed either as an ISO date or as a Unix one (in UTC). Defaults to now.
Request Headers:
 
  • Accept – the requested response content type, either application/json (default) or application/yaml
Response Headers:
 
Response JSON Array of Objects:
 
  • author (object) – information about the author of the revision
  • author_url (string) – link to GET /api/1/person/(person_id)/ to get information about the author of the revision
  • committer (object) – information about the committer of the revision
  • committer_url (string) – link to GET /api/1/person/(person_id)/ to get 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:
  • 200 OK – no error
  • 404 Not Found – no revision matching the given criteria could be found in the archive

Example:

https://archive.softwareheritage.org/api/1/revision/origin/723566/ts/2016-01-17T00:00:00+00:00/log/