sim visit as first-class command

Allows using it in a sim file.
This commit is contained in:
Joey Hess 2024-09-23 13:09:35 -04:00
parent 6cf9a101b8
commit 7bc8c2bfeb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 48 additions and 34 deletions

View file

@ -8,8 +8,6 @@ git annex sim start [my.sim]
git annex sim command
git annex sim visit repo
git annex sim show
git annex sim end
@ -32,14 +30,6 @@ simulation, and the results of the simulation. Use "git-annex sim show"
to display the log. This allows re-running the same simulation later,
as well as analyzing the results of the simulation.
While a simulation is running, the command "git annex sim visit repo", where
"repo" is the name of one of the repositories in the simulation, will spawn
a subshell in a git repository whose git-annex branch contains the state of
that simulated repository. This allows running any git-annex command, such
as `git-annex whereis` to examine the state of the simulation.
You should avoid making any changes to git-annex state.
Exit the subshell to end the visit.
Use "git annex sim end" to finish the simulation, and clean up.
# THE SIM FILE
@ -109,6 +99,19 @@ as passed to "git annex sim" while a simulation is running.
The repository to use can be specified by remote name, uuid, etc.
Example: "use myrepo here"
* `visit repo [command]`
Runs the specified shell command inside the simulated repository,
and waits for it to exit.
When no shell command is specified, it runs an interactive shell.
The command is run in a git repository whosegit-annex branch contains
the state of that simulated repository. This allows running any
git-annex commands, such as `git-annex whereis` to examine the
state of the simulation. You should avoid making any changes to
git-annex state.
* `connect repo [<-|->|<->] repo [...]`
Add a connection between two or more repositories. The arrow indicates