unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Adrien Bustany <adrien@bustany.org>
To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 1/2] Add notmuch_database_flush method
Date: Thu, 18 Oct 2012 00:34:08 +0300	[thread overview]
Message-ID: <507F2450.5020005@bustany.org> (raw)
In-Reply-To: <87d30h857w.fsf@betacantrips.com>

Le 17/10/2012 18:53, Ethan Glasser-Camp a écrit :
> Adrien Bustany <adrien@bustany.org> writes:
>
>> This method explicitly flushes the pending modifications to disk. It is
>> useful if your program has various threads, each with a read only DB and
>> one writer thread with a read/write DB. In that case, you most likely
>> want the writer to sync the changes to disk so that the readers can see
>> them, without having to close and reopen the database completely.
>
> These patches are pretty straightforward. But to conform to notmuch style..
>
>> +notmuch_status_t
>> +notmuch_database_flush(notmuch_database_t *notmuch)
>> +{
>> +	notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
>
> Indent is 4 spaces. (You have tabs here, which are 8 spaces, according
> to devel/STYLE.)
>
>> +	try {
>> +	if (notmuch->xapian_db != NULL &&
>
> if should be more indented than try. (So when you pull try back to 4
> spaces, leave if at 8 spaces.)

Sorry about that... I think I copied the style from 
notmuch_database_close, but my editor was set to have 4-space tabs, so I 
got confused. I'll send a fixed version of the patches.

>
>> +	    notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE)
>> +		(static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();
>
> This line is 90 characters, and will remain at 86 once you indent using
> the in-house style. I'm not sure if it's worth reformatting.
> notmuch_database_close calls flush() using exactly the same 86-character
> line. I'd say "don't make it worse", but personally I think breaking
> this line might be worse.
>

Yes, I also think breaking this line will not make things prettier :-/

> Ethan
>

Thanks for the review!

Adrien

  reply	other threads:[~2012-10-17 21:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 18:43 [PATCH 0/2] Add flush/reopen methods to notmuch_database_t Adrien Bustany
2012-07-19 18:43 ` [PATCH 1/2] Add notmuch_database_flush method Adrien Bustany
2012-10-17 15:53   ` Ethan Glasser-Camp
2012-10-17 21:34     ` Adrien Bustany [this message]
2012-07-19 18:43 ` [PATCH 2/2] Add notmuch_database_reopen method Adrien Bustany
2012-10-17 21:52 ` [PATCH v2 0/2] Add flush/reopen methods to notmuch_database_t Adrien Bustany
2012-10-17 21:52   ` [PATCH 1/2] Add notmuch_database_flush method Adrien Bustany
2012-10-17 21:52   ` [PATCH 2/2] Add notmuch_database_reopen method Adrien Bustany
2012-10-19  3:19   ` [PATCH v2 0/2] Add flush/reopen methods to notmuch_database_t Ethan Glasser-Camp
2012-10-19  7:19   ` Jani Nikula
2012-10-20 15:49     ` Ethan Glasser-Camp
2012-10-25 18:39       ` Adrien Bustany
2012-12-12  1:40   ` Michael Forney
2012-12-27  3:23     ` David Bremner

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=507F2450.5020005@bustany.org \
    --to=adrien@bustany.org \
    --cc=ethan.glasser.camp@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /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.
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).