KenKundert / emborg

Interactive command line interface to Borg Backup
GNU General Public License v3.0
94 stars 8 forks source link

mount latest - consistency question #22

Closed kewlfft closed 4 years ago

kewlfft commented 4 years ago

There is a new --latest option for mounting the latest archive, however by default other commands like extract and manifest apply to the latest archive while mount by default mounts all archives. Therefore wouldn't it make more sense that mount by default mounts the latest archive and that mount --all mounts all archives? Just a question as I may miss some logic behind.

Related to https://github.com/KenKundert/emborg/issues/21#issue-496777862

KenKundert commented 4 years ago

Yeah, I struggled with that. I actually fully implemented --all before I changed to --latest. My reasoning is as follows:

  1. Those other commands are slightly different in that in those commands --all would not make sense.
  2. Making all the default retains backward compatibility.
  3. In general I tend to prefer all because I it allows me to find the version I want, so it seems like a better default to me.

On the other hand, I really value a simple use model, and implementing --all rather than --latest represents the solution of least surprise, so I can go either way with little persuasion. Now that you have seen my reasoning, what would you suggest I do?

kewlfft commented 4 years ago

I had a second thought about it, my approach is to stick as close as possible to the Borg CLI logic not to introduce some other reasoning and complexity. The objective is to keep the tool intuitive for someone familiar with the CLI.

Here, the original Borg mount applies to both repo and archives. It makes sense therefore that without providing any archive information, emborg applies the command to the repo. To mount an archive, additional information is required: it can be --latest, the --date or the --archive name.

On the contrary Borg extract requires an archive name, I would expect that emborg extract also necessarily requests an additional parameter --latest, the --date or the --archive name. Here you chose to make it --latest by default, for ease of use I suppose, but that would be my approach.

KenKundert commented 4 years ago

I decided to go with --all in an attempt to make emborg consistent with itself. This change was implemented in the latest version (1.4.5).

kewlfft commented 4 years ago

That's a legitimate choice as well, thanks for the implementation of this very useful tool! When do you expect to release it in pypi?

KenKundert commented 4 years ago

I think it is ready now. However, it is my habit to wait a week or two so see if any issues pop up.

kewlfft commented 4 years ago

That's good practice, I could create an additional dev package in Arch Linux based on the latest github commit depending how active the future developments of the tool will be.

KenKundert commented 4 years ago

I just created another version where I cleaned some things up and fixed some small issues. I think it is getting pretty close; I can probably release it anytime. I wanted to thank you again for your help and your interest. Emborg is now quite a bit better than it was a few weeks ago.

No need to create another package. I think this was an unusually large change.

-Ken

kewlfft commented 4 years ago

You can thank me for my interest more than for my help as I have not contributed much at all to the code - partly because you were very quick at implementing all the ideas! I hope I can make some useful PR in the future now that I have the structure of the project in mind. I believe Emborg can become the reference front-end for Borg, it is evolving in a very nice way.

Thanks for sharing with us this great tool!

KenKundert commented 4 years ago

Thanks! I got impatient, so I have released version 1.5 with all of these changes and have pushed it to pypi. I believe I am done for now.

kewlfft commented 4 years ago

Arch Linux package updated https://aur.archlinux.org/packages/emborg/ New version being tested and no issue so far!

KenKundert commented 4 years ago

Thank you!