Skip to content

Commit

Permalink
Add pga siva set of commands
Browse files Browse the repository at this point in the history
Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
  • Loading branch information
vmarkovtsev committed Sep 25, 2019
1 parent b0877d7 commit 86d04de
Show file tree
Hide file tree
Showing 11 changed files with 360 additions and 217 deletions.
11 changes: 0 additions & 11 deletions PublicGitArchive/examples/go.mod

This file was deleted.

62 changes: 0 additions & 62 deletions PublicGitArchive/examples/go.sum

This file was deleted.

13 changes: 0 additions & 13 deletions PublicGitArchive/examples/java.md

This file was deleted.

118 changes: 0 additions & 118 deletions PublicGitArchive/examples/siva-heads.go

This file was deleted.

11 changes: 0 additions & 11 deletions PublicGitArchive/examples/siva-heads.md

This file was deleted.

32 changes: 31 additions & 1 deletion PublicGitArchive/pga/README.md
Expand Up @@ -14,7 +14,7 @@ In the meanwhile you'll need to compile this tool.

## Utilization

There are two subcommands in `pga`: `list` and `get`.
There are three subcommands in `pga`: `list`, `get`, and `siva`.

### Listing repositories

Expand Down Expand Up @@ -72,3 +72,33 @@ downloaded match the md5 hash of the files on the server. If that's the case,
the files will not be downloaded.

This provides a simple way to resume failed downloads. Simply run the tool again.

### Extracting files from downloaded siva-s

The following will write the contents of each HEAD revision contained in a siva file to the current
working directory:

```bash
pga siva dump /path/to/siva
```

`-o /output/path` allows setting the output path other than the current working directory.

### Listing the commits and references in a downloaded siva file

```bash
pga siva list /path/to/siva
```

The output format is JSON. In the `"commits"` dictionary, each value is the list of the commit's parents.
In the `"references"` dictionary, each value is the reference's target.

### Dumping the raw siva contents (advanced)

It is possible to extract the raw contents of a siva archive with

```bash
pga siva unpack /path/to/siva
```

It is possible to specify a regular expression for matching specific files to be extracted: `-m/--match`.
File renamed without changes.
2 changes: 1 addition & 1 deletion PublicGitArchive/pga/cmd/list.go
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/src-d/datasets/PublicGitArchive/pga/pga"
)

// listCmd represents the list command
// sivaCmd represents the list command
var listCmd = &cobra.Command{
Use: "list",
Short: "list all the repositories in the index",
Expand Down

0 comments on commit 86d04de

Please sign in to comment.