January 13, 2020

The swh-badges are here!

In recent years, the trend of adding badges to a repository’s README file, became very popular. Many possibilities exist; license, continuous integration, passing tests, peer reviewed, chat, release date, and much more…

We are happy to introduce the Software Heritage badges (swh-badges), that you can use to link to the archived source code.

There are three types of badges:

  1.  The archived repository: a link to the location of a repository as archived in Software Heritage.

    which contains all snapshots from SWH visits and is updated frequently, here the link to the archived Unipisa/CMM
  2. A release: a link to the persistent location of a specific release.

    The badge shows the tag used for the release, here version 1.9 of the CMM repository.
  3. A source code artifact (e.g snapshot, revision, directory or file): a link to the persistent location of the artifact using the SWH-ID

    Here the target revision of the 1.9 CMM release.
SWH-IDs as supported by Software Heritage allow you to go even further and pinpoint a given fragment of code inside a specific version of a file, by using the lines= qualifier available for identifiers that point to files.
For example, the following SWH-ID points to the core mapping algorithm inside the Parmap source code as presented in a research article describing Parmap back in 2012:
This feature is available for the source code artifact swh-badge as well: try clicking on the following image, and see!
If you want to know more about the SWH-ID, a fully documented standard identifier schema, see the documentation.

A very simple way of getting the badge you want is to browse your archived code in Software Heritage, and navigate to the location you are interested in. Click then on the permalinks vertical red tab that is present on all pages of the archive, and in the tab that opens up you select the artifact for which you need the badge. The archived repository badge is always available:

Then, you can click on the badge itself and you will find the text for inserting a badge in HTML, Markdown or reStructuredText.

That’s it !

We invite you to use these new badges, providing an easy access to the archived versions of your source code.

January 13, 2020