When using --notify-start or --notify-finish with many files that are able to be downloaded quickly, the desktop notifications can cover the whole screen (in xfce at least).
It's possible to update a desktop notification to contain some new information. That's done when a transfer is finished, to update the start notification. Also, if the notification has been closed, updating causes it to re-display.
So, it would be possible to reuse desktop notifications, so only one is displayed, and it runs through all the files that are being processed.
When only --notify-start or --notify-finish is used, the notification would show the last thing started or finished. When both are used, the finish notification would be quickly overwritten by the next thing started. That seems ok?
The complication to this is jobs. With -J, it seems like it ought to display one notification per transfer thread, so the user knows git-annex is working on multiple things. Implementing that would need some way to get the notification handle associated with a given Transferrer. As the code is structured, notifyTransfer is run before the Transferrer that will be used is known. So this would need some refactoring.
Maybe that complexity is unwarranted though? Desktip notifications only are displayed for a short amount of time (again on xfce). So if a long-duration download is run, the notification will appear for a short time, and then vanish while it continues downloading. So the user is not likely to see notifications for all the -J jobs that are running be displayed at the same time. So reusing a single notification does not seem much worse? --Joey
git config annex.notification-max-items
with a default of 5 or so).-J
Worker threads would just add to that notification, I don't see a need for one notification per worker thread (that can easily go up to another 16 with--jobs=cpus
on modern CPUs, filling the screen again 🙃).I think perhaps the notify options should be revamped as I don't get what their purpose is.
Receiving one desktop notification for each and every transfer sounds like insanity to me. I'd get constant notifications doing anything at all.
To me, notifications are for things that require immediate attention. An email for example or an assistant fsck that found corrupted files or perhaps a failed git-annex transfer. That sort of thing.
What's the use-case of constantly requiring immediate attention the entire time for every benign thing happening? In my mind, I might as well just watch the git-annex progress log at that point.
Before reading what the options actually did, I would have expected
--notify-finish
to produce exactly one notification when the git-annex command I set off is done. Perhaps with a summary in it what it had done (successes/errors).If you only want a notification at the end of the command, you can use:
git-annex whatever; notify-send done
So there is more value in git-annex notifying after each transfer than at the end of the command. Just because it would not be valuable in your particular case doesn't mean it's a useless feature. It's not unusual to have files large enough that transferring them takes some time.