Please describe the problem.
git annex reports progress the same when when stdout is a terminal or not. This is fine when stdout is actually a terminal, but produce lots of annoying characters when stdout is just a regular file. This is problematic mostly when running git-annex with cron.
What steps will reproduce the problem?
git annex copy --to myrepo > log
then look at the content of log
.
What version of git-annex are you using? On what operating system?
git annex 5.20151019
Mac OS X 10.10.5
Ubuntu 14.04
Please provide any additional information below.
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
# End of transcript or log.
If you have a recent version of git-annex that's built with the ConcurrentOutput flag, pass -J1 and it will do what you want.
Nowadays, -J1 does not have that behavior but eg -J2 still does. But I'd probably just use --quiet in my cron job, or for that matter use
chronic
.I do think it would be better for git-annex to be consistent and not display progress when not at a tty. However, the work required to do that is nontrivial. A lot of commands git-annex runs can themselves display progress. And all that nontrivial work has in fact been done in order to support -J. It's just not enabled by default or for -J1.
The reason git-annex has not yet switched to the concurrent output by default is that it assumes a VT100 compatible terminal.