notmuchsync: handling of the deleted tag

Carl Worth cworth at cworth.org
Mon Nov 15 11:58:33 PST 2010


On Sun, 14 Nov 2010 22:01:09 -0500, Jameson Rollins <jrollins at finestructure.net> wrote:
> On Fri, 12 Nov 2010 16:52:51 -0800, Carl Worth <cworth at cworth.org> wrote:
> > This one is a simple one-liner as of notmuch 0.4:
> > 
> >     notmuch search --output=files tag:deleted -print0 | xargs -0 rm
> 
> Is -print0 actually a command that notmuch accepts?  It's not documented
> as far as I can tell.  And it doesn't seem to affect the output of the
> command, i.e. whether or not it's used the output is still newline
> delimited.  I'm not seeing it in the source either.

No, it's not something implemented. I'm surprised I spouted such
nonsense above. I think what happened is that I first typed a command
line which would actually work, (for filenames without embedded newline
characters):

        notmuch search --output=files tag:deleted | xargs rm

And then a habit kicked in from typing many find/xargs commands and I
retrofitted the command with -print0 and -0 as I originally sent it out.

Should we perhaps add a -0 option so that one could actually reliably
handle filenames with newlines in a case like this? Or can we just
assert that such filenames are insane and *should* cause problems?

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20101115/92ebd3fa/attachment.pgp>


More information about the notmuch mailing list