diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-31 10:05:00 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-04 20:56:09 +0100 |
| commit | 663a4fda12ab008a052c459902436d80c090fc4c (patch) | |
| tree | 03527af5f1000fb9128256385cc50c6d8031a640 | |
| parent | a71ecda45611b37aa53e8a5e34f08f561fd6fbd4 (diff) | |
Watch expressions documentation
Changelog: Added flexible expressions to select or watch commit ranges and tags.
| -rw-r--r-- | README.md | 52 |
1 files changed, 47 insertions, 5 deletions
@@ -62,10 +62,8 @@ To run jobs for a git commit range: minici run <commit>..<commit> ``` -or: -``` -minici run --range=<commit>..<commit> -``` +See [watch expressions](#watch-expressions) below for details of supported expressions. + To run jobs for commits that are in local `<branch>`, but not yet in its upstream: ``` @@ -88,12 +86,56 @@ To watch changes on given `<branch>` and run jobs for each new commit: minici run --new-commits-on=<branch> ``` +or equivalently: +``` +minici run '<branch>..watch(<branch>)' +``` + To watch new tags and run jobs for each tag matching given pattern: ``` minici run --new-tags=<pattern> ``` -The above options `--range`, `--since-upstream`, etc can be arbitrarily combined. +or equivalently: +``` +minici run 'newtags(<pattern>)' +``` + +The above expressions and options can be arbitrarily combined. + + +Watch expressions +----------------- + +The `run` command accepts `<range-expr>` to describe set of commits for which +to execute the jobs, potentially watching for changes in repository branches or +tags. The `<range-expr>` can be of the form: + +* `<commit-expr>..<commit-expr>` giving range of commits; + +* `<commit-expr>` giving single commit; + +* `tags(<pattern>)` denoting list of all tags matching given `<pattern>`; + +* `watch(<range-expr>)` is an expression initially equivalent to its parameter, + but `minici` continues to watch the repository for changes affecting the + expression and creates or cancels additional jobs as the value of the + expression changes. + +Where `<commit-expr>` can be: + +* `<commit>`, e.g. the git commit hash; + +* `highesttag(<pattern>)`, which from all the tags matching `<pattern>`, selects + the highest one as given by natural/version sort (e.g. `v10.2` > `v9.4`); + +* `lasttag(<pattern>)`, which from all the tags matching `<pattern>`, selects + the last created one (as given by the `tagger` date in tag object); + +* `watch(<commit-expr>)` is analogous to `watch` for `<range-expr>`. + +And `<pattern>` is a shell glob pattern, as implemented +by the [Glob package](https://hackage.haskell.org/package/Glob/docs/System-FilePath-Glob.html#v:compile). Explicit script file |