gitext-rs / git-stack

Stacked branch management for Git
Apache License 2.0
491 stars 19 forks source link

Caching support for `git run` #263

Open epage opened 1 year ago

epage commented 1 year ago

Please complete the following tasks

Version

0.10

Use Case

Run faster by skipping runs where the result is the same as the past

Requirements

Possible Solutions

Cache successful command runs by commit and command flags in a json file in the .git directory

Report in the output that we are skipping due to prior success.

Disable with --no-cache

arxanas commented 1 year ago

For test runs, a user would likely want to re-run the command and see the output, so probably not caching failures

For what it's worth, I cache failures too for my run implementation. It's oftentimes expensive to go back to a commit and rebuild and rerun tests, so having the cached output is useful for me. I'm also guilty of running a test and then immediately forgetting the output and having to run it again.

epage commented 1 year ago

I was wanting to avoid capturing stdin/stdout/stderr but to leave them as-is to avoid limitations around that (correctly detecting color, etc). When caching "success" I was just going to capture the status and report that.