Control: found -1 6.20160719-1

Reviving an old thread:

Joey Hess wrote on Wed, May 02, 2012 at 12:14:59 -0400:
> Enrico Zini wrote:
> > first of all, thank you for git-annex.
> > 
> > I have three repositories:
> > 
> >   laptop (my laptop)
> >   archive (the big 2T archive USB disk)
> >   desktop (my old desktop, which I'm using mostly as a backup)
> > 
> > And a file I care about:
> > 
> >   laptop:/store$ git annex whereis file.ext
> >   whereis file.ext (1 copy) 
> >             xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -- archive (Archivio 2T 
> > usb drive)
> >   ok
> > 
> > I'm on my laptop and I'd like a copy of file.ext to be backed up to my old
> > desktop:
> > 
> >   laptop:/store$ git annex copy file.ext --to=desktop
> >   laptop:/store$ echo $?
> >   0
> > 
> > This said nothing and did nothing, successfully :(
> 
> Yes, all git-annex commands silenty skip files they can't or don't need
> to act on. This is done because it's not uncommon to have a lot of files
> in a tree, many of which are really present, and many not; it's then
> nice to be able to copy/drop all the ones that are present, or get all
> the ones that are not without manually specifying, and without drowning
> in warning messages.
> 
> I think that this becomes clear once you get used to it and see that
> it always says what it's doing, so a silent output like this
> was a no-op. I can see how it can be initially confusing though.
> 
> Perhaps you can suggest some documentation improvements in this area?

Yes, I do have a docs change to suggest: I believe the "quite please"
paragraph in the walkthrough updated is inaccurate, as it currently says
no output means "nothing needs to be done".  It would be more accurate
for that paragraph to say say what your email says: that no output means
that either nothing needs to be done, or the file is not present in the
current repository.

However, I would like to suggest a behaviour change, that I believe will
address your concern about not drowning the user in warnings: warn only
once per invocation of git-annex, rather than once per file.  For
example:

    % git annex list
    here
    |remote
    ||elsewhere
    |||web
    ||||bittorrent
    |||||
    X____ foo1.txt
    __X__ foo2.txt
    __X__ foo3.txt
    __X__ foo4.txt
    __X__ foo5.txt
    __X__ foo6.txt
    __X__ foo7.txt
    X____ foo8.txt
    % git annex copy foo{1,2,3,4,5,6,7,8}.txt --to=remote
    move foo1.txt (to remote...) ok
    move foo8.txt (to remote...) ok
    (Recording state in git...)
    git-annex: some files weren't copied because they are not present in this 
repository

The warning would only be generated if, following the copy operation, at
least one of the files named on the command line is not present in the
remote repository (the destination of the copy).

WDYT?

Cheers,

Daniel

[1] http://git-annex.branchable.com/walkthrough/#index14h2

Reply via email to