From: "Fernando J. Pereda" <ferdy@gentoo.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Teach mailsplit about Maildir's
Date: Thu, 24 May 2007 21:56:08 +0200 [thread overview]
Message-ID: <20070524195608.GA4714@ferdyx.org> (raw)
In-Reply-To: <7vd50qvwaz.fsf@assigned-by-dhcp.cox.net>
On Thu, May 24, 2007 at 12:47:00PM -0700, Junio C Hamano wrote:
> "Fernando J. Pereda" <ferdy@gentoo.org> writes:
> > [--whitespace=<option>] [-C<n>] [-p<n>]
> > - <mbox>...
> > + <mbox>|<Maildir>...
> > +
> > 'git-am' [--skip | --resolved]
>
> Does the document still format Ok if you add a blank line there
> (not a rhetorical question -- I haven't checked)?
I think I tried when I first sent it, will try.
> > +
> > + if ((dir = opendir(path)) == NULL) {
> > + error("cannot diropen %s (%s)", path, strerror(errno));
> > + return -1;
> > + }
>
> Didn't you just fail opendir, not diropen?
Ouch, will fix
> > + return 1;
> > +}
>
> Usually we signal success by returning 0.
Ok. Fair enough.
>
> > +static int split_maildir(const char *maildir, const char *dir,
> > + int nr_prec, int skip)
> > +{
> > + char file[PATH_MAX];
> > + char curdir[PATH_MAX];
> > + char name[PATH_MAX];
> > int ret = -1;
> > + struct path_list list = {NULL, 0, 0, 1};
> >
> > + snprintf(curdir, sizeof(curdir), "%s/cur", maildir);
> > + if (populate_maildir_list(&list, curdir) < 0)
> > + goto out;
> >
> > + int i;
>
> Decl-after-statement.
I did it because other parts of the file do it too. Do you want me to
fix the rest of them?
>
> > + for (i = 0; i < list.nr; i++) {
> > + snprintf(file, sizeof(file), "%s/%s", curdir, list.items[i].path);
> > + FILE *f = fopen(file, "r");
>
> Likewise.
Again, because we were already doing it in other parts of the file. Will
fix.
>
> > @@ -186,9 +249,39 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
> > ...
> > + if (ret < 0) {
> > + error("cannot split patches from %s", arg);
> > + return 1;
> > + }
> > + num += ret;
> > + }
> > +
> > + printf("%d\n", num);
> >
> > - return ret == -1;
> > + return 0;
> > }
>
> We do not signal error anymore from the command?
If we reached that part of the code, there is no error to signal about.
We signal error when either split_mbox or split_maildir fail by
returning 1.
Will fix those issues and send a new patch. Thanks for reviewing it.
- ferdy
--
Fernando J. Pereda Garcimartín
20BB BDC3 761A 4781 E6ED ED0B 0A48 5B0C 60BD 28D4
next prev parent reply other threads:[~2007-05-24 19:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-20 18:14 [PATCH] Teach mailsplit about Maildir's Fernando J. Pereda
2007-05-20 18:36 ` Junio C Hamano
2007-05-20 18:49 ` Alex Riesen
2007-05-20 19:00 ` Fernando J. Pereda
2007-05-20 20:35 ` Alex Riesen
2007-05-20 20:44 ` Fernando J. Pereda
2007-05-20 18:53 ` Johan Herland
2007-05-20 19:18 ` Fernando J. Pereda
2007-05-20 19:27 ` Johan Herland
2007-05-21 12:55 ` Johannes Schindelin
2007-05-21 3:15 ` Junio C Hamano
2007-05-21 12:56 ` Johannes Schindelin
2007-05-21 18:17 ` Fernando J. Pereda
2007-05-21 18:20 ` Fernando J. Pereda
2007-05-21 23:05 ` [PATCH] Allow user to specify mailbox format for mailsplit Alex Riesen
2007-05-21 23:19 ` Junio C Hamano
2007-05-22 22:04 ` Alex Riesen
2007-05-24 19:47 ` [PATCH] Teach mailsplit about Maildir's Junio C Hamano
2007-05-24 19:56 ` Fernando J. Pereda [this message]
2007-05-24 20:12 ` Junio C Hamano
2007-05-24 22:15 ` Fernando J. Pereda
-- strict thread matches above, loose matches on Subject: below --
2007-04-26 19:24 Fernando J. Pereda
2007-04-27 8:30 ` Fernando J. Pereda
2007-04-27 8:54 ` Junio C Hamano
2007-04-27 8:59 ` Fernando J. Pereda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070524195608.GA4714@ferdyx.org \
--to=ferdy@gentoo.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).