unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* remote-notmuch.sh
@ 2011-10-26 10:04 Tomi Ollila
  2011-10-26 15:58 ` remote-notmuch.sh Jesse Rosenthal
  2011-10-26 17:48 ` remote-notmuch.sh Jani Nikula
  0 siblings, 2 replies; 4+ messages in thread
From: Tomi Ollila @ 2011-10-26 10:04 UTC (permalink / raw)
  To: notmuch

Hi

The remote-notmuch.sh script on page http://notmuchmail.org/remoteusage/
starts to show it's age. As the notmuch command line interface has evolved
(and emacs ui followed) it is not working in many cases anymore.

I took the script and modified it to work in my cases so far.

If you have problems with remote-notmuch.sh take a look this modified
version. For the time being it is located at 
http://www.iki.fi/too/nottoomuch/remote-notmuch.sh

If this proves to be working better in other users use then I can
update the script on the remoteusage page also.

Changes:

Changed shebang to '#!/bin/sh' -- tested the script works with /bin/bash &
/bin/dash -- It should also work with http://heirloom.sourceforge.net/sh.html
but I did not test.

Changed sha1sum to 'openssl sha1' -- should work identically everywhere
where openssl is installed (Linux, *BSD, Mac OS X, ...).

Changed arg quote mangling for ssh command line: Every arg is encapsulated
between ':s and ':s in args replaced with '\'' construct. Note that shell
builtin echo expansions cannot be handled here but in this case this
doesn't cause problems; example: foo=-n bar='\n'; echo "$foo" x "$bar" y 
(but see at the end of this email..)

'notmuch show' checks that first arg is --format=raw and last begins with id:
-- and in this case uses the whole command line as hash key.

'case' used to choose internal command and shifts there removed.


Tomi

PS: I tested replacement for "'`echo "$arg" | sed "s/'/'\\\\\\''/"`'":

for a
do	x=`awk -v arg="$a" "BEGIN { while (index(\"'\", arg)) 
		sub(\"'\", \"'\\\\\\''\", arg); printf \"'%s'\", arg }"`
	echo "$x"
done

on command line. I include this into my script and test first before putting
to the 'released' version.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remote-notmuch.sh
  2011-10-26 10:04 remote-notmuch.sh Tomi Ollila
@ 2011-10-26 15:58 ` Jesse Rosenthal
  2011-10-26 17:48 ` remote-notmuch.sh Jani Nikula
  1 sibling, 0 replies; 4+ messages in thread
From: Jesse Rosenthal @ 2011-10-26 15:58 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Hi Tomi,

> If this proves to be working better in other users use then I can
> update the script on the remoteusage page also.

I actually wrote the original script, and updated it as I changed it,
without much sense for who, if anyone, was using it. Please feel free to
update the version on the official wiki as you see fit. It's stagnated,
I think, because recently I've been playing around with alternate
methods (some zeromq/paramiko monstrosity that I built mainly as an
exercise in other stuff, but which works well enough that I haven't had
cause to switch back in a while).

Of course, if anyone else is using the script and has an objection, they
should chime in.

Best,
Jesse

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remote-notmuch.sh
  2011-10-26 10:04 remote-notmuch.sh Tomi Ollila
  2011-10-26 15:58 ` remote-notmuch.sh Jesse Rosenthal
@ 2011-10-26 17:48 ` Jani Nikula
  2011-10-27  9:20   ` remote-notmuch.sh Tomi Ollila
  1 sibling, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2011-10-26 17:48 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

On Wed, 26 Oct 2011 13:04:55 +0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> The remote-notmuch.sh script on page http://notmuchmail.org/remoteusage/
> starts to show it's age. As the notmuch command line interface has evolved
> (and emacs ui followed) it is not working in many cases anymore.
> 
> I took the script and modified it to work in my cases so far.

There are many scripts like this; I wonder if it would be a good idea to
include some of them in the notmuch repository? A "contrib" subdirectory
comes to mind.

As to the script, I'll have a look at it one of these days...


BR,
Jani.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remote-notmuch.sh
  2011-10-26 17:48 ` remote-notmuch.sh Jani Nikula
@ 2011-10-27  9:20   ` Tomi Ollila
  0 siblings, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2011-10-27  9:20 UTC (permalink / raw)
  To: Jani Nikula; +Cc: notmuch

On Wed 26 Oct 2011 20:48, Jani Nikula <jani@nikula.org> writes:

> On Wed, 26 Oct 2011 13:04:55 +0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
>> The remote-notmuch.sh script on page http://notmuchmail.org/remoteusage/
>> starts to show it's age. As the notmuch command line interface has evolved
>> (and emacs ui followed) it is not working in many cases anymore.
>> 
>> I took the script and modified it to work in my cases so far.
>
> There are many scripts like this; I wonder if it would be a good idea to
> include some of them in the notmuch repository? A "contrib" subdirectory
> comes to mind.

I was thinking of adding this (and -- Jani: you're gonna like this ;), the
perl version of remote-notmuch) to the notmuch-wiki repo and then point
these in the remoteusage.mdwn there. Making contrib directory there could
be good option (and each of the contributed script there should
documentation of it available in these .mdwn files).

How does this idea feels like ?

>
> BR,
> Jani.
>

Tomi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-27  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-26 10:04 remote-notmuch.sh Tomi Ollila
2011-10-26 15:58 ` remote-notmuch.sh Jesse Rosenthal
2011-10-26 17:48 ` remote-notmuch.sh Jani Nikula
2011-10-27  9:20   ` remote-notmuch.sh Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).