Stu icon indicating copy to clipboard operation
Stu copied to clipboard

A new CLI which can snapshot N copies of a directory using git

Open stevebuik opened this issue 7 years ago • 1 comments

Question: how has my javascript artifact grown over the past N weeks?

Answer: configurable CLI to select specific commits and generate Shadow snapshots for them.

Following the technique seen here https://github.com/Datomic/codeq/blob/master/src/datomic/codeq/core.clj#L422

it should be possible to build a CLI/main fn using tools.cli which accepts args:

  • target directory
  • number (N) of commits to generate
  • interval (maybe in days) between commits. default is subsequent commits i.e. no interval

It can then cycle through the N most recent commits, checking out each one and generating a shadow snapshot with the git hash as the tag name.

Running this tool in CI, before the Stu illumination CLI, will allow full automation.

stevebuik avatar Apr 24 '18 00:04 stevebuik

The commit selection fn can be implemented as a multi-method with a CLI arg to select it. this allows a couple of includes strategies (last-N and last-N-days) but allows projects to write a custom strategy and select it via the CLI.

The naming for the tags would be best to be "YYYY-MM-DD" so alpha sort makes sense.

stevebuik avatar Apr 27 '18 11:04 stevebuik