G-Node / gin-cli

Command line client for GIN
https://gin.g-node.org
Other
12 stars 6 forks source link

Locking and unlocking message only appears when the operation is finished #173

Closed achilleas-k closed 6 years ago

achilleas-k commented 6 years ago

When a large file is being unlocked, nothing is printed until it's done. The client should print

Unlocking <filename>

while the operation is running followed by OK when it's done.

achilleas-k commented 6 years ago

This is tricky. Git annex doesn't provide any progress output for this, so we have no way of knowing which file it's working on while we wait.

We could run a separate git annex unlock command for each file. That way we would be able to print the filename and wait for the success (or failure) message. It would require expanding all arguments into filenames. We could also run each operation concurrently, but then we would change the output to a single line with a percentage progress.

The same can be done for gin lock, which internally is a git annex add, meaning the same could apply to the plain old git annex add that's performed for new files.

achilleas-k commented 6 years ago

Shelling out once per file seems to slow things down, presumably because of multiplying overhead. An upcoming solution is to use status (and similar) commands to count the number of affected files ahead of time and present a progress bar.