unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Pieter Praet <pieter@praet.org>
To: David Bremner <david@tethera.net>,
	Thomas Schwinge <thomas@schwinge.name>
Cc: notmuch <notmuch@notmuchmail.org>
Subject: Re: [PATCH] Repeatability when copying a whole directory into a new one.
Date: Thu, 03 Nov 2011 17:49:59 +0100	[thread overview]
Message-ID: <878vnxp2vc.fsf@praet.org> (raw)
In-Reply-To: <8739e88s4a.fsf@zancas.localnet>

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

On Mon, 31 Oct 2011 23:59:49 -0300, David Bremner <david@tethera.net> wrote:
> On Fri, 30 Sep 2011 01:26:46 +0200, Thomas Schwinge <thomas@schwinge.name> wrote:
> > This new test currently fails -- but it shouldn't.
> > ---
> > 
> > Hi!
> > 
> > I found this while manually copying directories and running notmuch new.
> > 
> > Am I just too sleepy at this time, or is it another DB vs. directory
> > mtime issue?
> > 
> >      BROKEN Repeatability when copying a whole directory into a new one
> >             --- new.18.expected     2011-09-29 23:23:39.000000000 +0000
> >             +++ new.18.output       2011-09-29 23:23:39.000000000 +0000
> >             @@ -1,2 +1 @@
> >             -Processed 51 total files in almost no time.
> >              No new mail.
> 
> I'm a bit confused here too. When the files are removed, the "notmuch new"
> sent to /dev/null in your test detects the deletes as renames. Shouldn't
> the copies be detected as duplicates or something?
> 

They should.

Applying any one of the attached patches makes the test pass;
I vote "directory mtime issue".



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: update-dir-mtime.patch --]
[-- Type: text/x-patch, Size: 329 bytes --]

diff --git a/test/new b/test/new
index 0afb04c..32b058f 100755
--- a/test/new
+++ b/test/new
@@ -168,6 +168,7 @@ notmuch new > /dev/null
 # This was quite enjoyable.  Let's do it again.
 mkdir "$MAIL_DIR"/2nd
 cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+touch "$MAIL_DIR"/2nd/cur
 output2=$(notmuch new)
 
 test_subtest_known_broken

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: cp-without-archive-opt.patch --]
[-- Type: text/x-patch, Size: 612 bytes --]

diff --git a/test/new b/test/new
index 0afb04c..0627d69 100755
--- a/test/new
+++ b/test/new
@@ -159,7 +159,7 @@ test_begin_subtest 'Repeatability when copying a whole directory into a new one'
 add_email_corpus
 
 mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+cp "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
 output1=$(notmuch new)
 
 rm -rf "$MAIL_DIR"/2nd
@@ -167,7 +167,7 @@ notmuch new > /dev/null
 
 # This was quite enjoyable.  Let's do it again.
 mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+cp "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
 output2=$(notmuch new)
 
 test_subtest_known_broken

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: cp-to-other-dir.patch --]
[-- Type: text/x-patch, Size: 391 bytes --]

diff --git a/test/new b/test/new
index 0afb04c..a3c270c 100755
--- a/test/new
+++ b/test/new
@@ -166,8 +166,8 @@ rm -rf "$MAIL_DIR"/2nd
 notmuch new > /dev/null
 
 # This was quite enjoyable.  Let's do it again.
-mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+mkdir "$MAIL_DIR"/3rd
+cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/3rd/
 output2=$(notmuch new)
 
 test_subtest_known_broken

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: cp-dir-content.patch --]
[-- Type: text/x-patch, Size: 622 bytes --]

diff --git a/test/new b/test/new
index 0afb04c..f600983 100755
--- a/test/new
+++ b/test/new
@@ -159,7 +159,7 @@ test_begin_subtest 'Repeatability when copying a whole directory into a new one'
 add_email_corpus
 
 mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+cp -a "$MAIL_DIR"/cur/* "$MAIL_DIR"/2nd/
 output1=$(notmuch new)
 
 rm -rf "$MAIL_DIR"/2nd
@@ -167,7 +167,7 @@ notmuch new > /dev/null
 
 # This was quite enjoyable.  Let's do it again.
 mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+cp -a "$MAIL_DIR"/cur/* "$MAIL_DIR"/2nd/
 output2=$(notmuch new)
 
 test_subtest_known_broken

[-- Attachment #6: Type: text/plain, Size: 175 bytes --]



> d
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Peace

-- 
Pieter

  reply	other threads:[~2011-11-03 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 23:26 [PATCH] Repeatability when copying a whole directory into a new one Thomas Schwinge
2011-11-01  2:59 ` David Bremner
2011-11-03 16:49   ` Pieter Praet [this message]
2011-11-05 17:26 ` Austin Clements
2016-04-13 19:50   ` Jani Nikula
2011-12-18 13:08 ` Tomi Ollila

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=878vnxp2vc.fsf@praet.org \
    --to=pieter@praet.org \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=thomas@schwinge.name \
    /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).