G-Node / gin-cli

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

Automatically `gin get-content` #296

Open brenthuisman opened 3 years ago

brenthuisman commented 3 years ago

When I make a fresh checkout of a repo, files checked into annex are not automatically downloaded. gin download also does not retrieve them. It would be nice if gin get-content is not a separate command but is included in gin get and gin download.

achilleas-k commented 3 years ago

Thanks for the request. I think this behaviour wouldn't be appropriate for the client by default. A major feature of git annex (and by extension the GIN CLI) is the selective downloading of large file content. Repositories can sometimes be tens or hundreds of gigabytes in size. Pulling the entire content on gin get would prevent a lot of users from downloading and exploring such repositories. It would also prevent users with large repositories from making quick changes to a subset of files (for instance on a laptop on the go where they don't need access to the entire data store).

Your request however makes me consider adding more information to the command output. It can perhaps offer to download all data, though I consider prompts to be a bit disruptive to command line workflow and it might be best to simply add a message at the end of the gin get output that informs the user of the state of the repository, how much data is in annexed files and how to get them.

As for the gin download command, I think the problem with that is the name. I wanted a command that updates the local clone with changes from the remote server, but again, it shouldn't pull all annexed content unless the user really wants it to. Perhaps we should have stuck with the push and pull commands from git. I would prefer to make the same change to gin download that I suggested for gin get: Inform the user of the new state of the repository and how to get the annexed content.

brenthuisman commented 3 years ago

Some feedback on whether or not the repo contains annexed files on a fresh gin get would indeed be a good alternative, together with a mention of the appropriate command to retrieve those files. Right now there is no feedback at all, and I had to search a bit before I found git get-content.

Still, while I do see the usecase of not automatically getting annexed files, knowing about the difference, which gin hides pretty well (and that's probably kind of the point of gin, right?), would mean users need some education on the difference between the two kinds of files. Whether or not want you want to do that, decides whether or not this is done automatically.

achilleas-k commented 3 years ago

Yes, that's essentially the source of a lot of the issues with the GIN CLI (admittedly, a problem of our own making). We want to hide or abstract away a lot of the details of working with git and git-annex, but at the same time, the user should know what's going on. It's impossible to do without educating the user to a certain point and it requires a delicate balance.

There's documentation on the website, but users who want to quickly start using the client to download repositories should get some feedback about what's going on.