Re: [PATCH] Add git-imap-send.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 9, 2006, 10:35 UTC
- Message-ID
- <7vacbz7vod.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <440C3499.9080000@codeweavers.com>
Mike McCormack <mike@codeweavers.com> writes:
> This probably needs a bit more work, but I'll solicit comments and > flames anyway...
OK, then please work a bit more ;-)
I kind of like this approach and even wish my e-mail workflow involved an imap server with draft folders. Currently I do everything in Gnus and my drafts are on local disk.
Show 6 quoted lines
> The target IMAP folder: > > [imap] > Folder = "INBOX.Drafts" > > A command to open an ssh tunnel to the imap mail server.
The .git/config file is a good choice for storing this information, because you might even use different draft folders for different projects, i.e. the configuration is per-repository.
Show 8 quoted lines
> [imap] > Tunnel = "ssh -q user@imap.server.com /usr/bin/imapd ./Maildir > 2> /dev/null" > [imap] > Host = imap.server.com > User = bob > Password = pwd > Port = 143
These I am not so sure. It _might_ make sense to have something like this under $HOME/. Isn't there an established convention for storing something like this for existing MUAs?
Show 7 quoted lines
> + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + *... > + * As a special exception, mbsync may be linked with the OpenSSL library, > + * despite that library's more restrictive license.
Hmmm.
Show 5 quoted lines
> +#include <sys/types.h> >... > +#include <pwd.h> > + > +#include "cache.h"
If you are including "cache.h", you probably do not need to include many of the standard include files.
> +#define as(ar) (sizeof(ar)/sizeof(ar[0]))
We have something like this in apply.c, exec_cmd.c and git.c; probably we would want a macro in "cache.h".
git.c:326:#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
Show 5 quoted lines
> +static int
> +git_imap_config(const char *key, const char *val)
> +{
>...
> + if (!strcasecmp( "Folder", key )) {git_config calls you after downcasing the keys, so you do not need to do strcasecmp. Just spell things out in lowercase.
> + if (!memcmp( "imaps:", val, 6 )) {
> + if (!memcmp( "imap:", val, 5 ))Is val always longer than 5 or 6 bytes here?