[PATCH 1/2] test: date_relative in notmuch search json output

2011-12-07 Thread David Bremner
On Sat, 23 Jul 2011 10:54:03 +0100, pazz  
wrote:
> expect the date_relative field for thread entries
> in notmuch search's json output
> ---

I pushed an amended version of this one (explaining why the date won't
change in the future), and the next patch as well.

d




Re: [PATCH 1/2] test: date_relative in notmuch search json output

2011-12-07 Thread David Bremner
On Sat, 23 Jul 2011 10:54:03 +0100, pazz patricktot...@googlemail.com wrote:
 expect the date_relative field for thread entries
 in notmuch search's json output
 ---

I pushed an amended version of this one (explaining why the date won't
change in the future), and the next patch as well.

d


___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] test: date_relative in notmuch search json output

2011-07-23 Thread pazz
expect the date_relative field for thread entries
in notmuch search's json output
---
 test/json |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/test/json b/test/json
index 5a2544c..d54bf25 100755
--- a/test/json
+++ b/test/json
@@ -12,6 +12,7 @@ add_message "[subject]=\"json-search-subject\"" 
"[date]=\"Sat, 01 Jan 2000 12:00
 output=$(notmuch search --format=json "json-search-message" | 
notmuch_search_sanitize)
 test_expect_equal "$output" "[{\"thread\": \"XXX\",
 \"timestamp\": 946728000,
+\"date_relative\": \"2000-01-01\",
 \"matched\": 1,
 \"total\": 1,
 \"authors\": \"Notmuch Test Suite\",
@@ -28,6 +29,7 @@ add_message "[subject]=\"json-search-utf8-body-s?bj?ct\"" 
"[date]=\"Sat, 01 Ja
 output=$(notmuch search --format=json "js?n-search-m?ssage" | 
notmuch_search_sanitize)
 test_expect_equal "$output" "[{\"thread\": \"XXX\",
 \"timestamp\": 946728000,
+\"date_relative\": \"2000-01-01\",
 \"matched\": 1,
 \"total\": 1,
 \"authors\": \"Notmuch Test Suite\",
-- 
1.7.4.1



[PATCH 1/2] test: date_relative in notmuch search json output

2011-07-23 Thread pazz
expect the date_relative field for thread entries
in notmuch search's json output
---
 test/json |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/test/json b/test/json
index 5a2544c..d54bf25 100755
--- a/test/json
+++ b/test/json
@@ -12,6 +12,7 @@ add_message [subject]=\json-search-subject\ 
[date]=\Sat, 01 Jan 2000 12:00
 output=$(notmuch search --format=json json-search-message | 
notmuch_search_sanitize)
 test_expect_equal $output [{\thread\: \XXX\,
 \timestamp\: 946728000,
+\date_relative\: \2000-01-01\,
 \matched\: 1,
 \total\: 1,
 \authors\: \Notmuch Test Suite\,
@@ -28,6 +29,7 @@ add_message [subject]=\json-search-utf8-body-sübjéct\ 
[date]=\Sat, 01 Ja
 output=$(notmuch search --format=json jsön-search-méssage | 
notmuch_search_sanitize)
 test_expect_equal $output [{\thread\: \XXX\,
 \timestamp\: 946728000,
+\date_relative\: \2000-01-01\,
 \matched\: 1,
 \total\: 1,
 \authors\: \Notmuch Test Suite\,
-- 
1.7.4.1

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: date_relative in notmuch-search

2011-07-18 Thread Jameson Graef Rollins
On Fri, 15 Jul 2011 22:04:59 +0100, Patrick Totzke 
patricktot...@googlemail.com wrote:
 Thanks for the tip with git send-mail.

Hi, Patrick.  You might have noticed my response to Felix a little while
ago.  The git format-patch command outputs an email that is meant to be
sent directly to the list, not as an attachment on another message.  The
git send-email command should actually handle sending the mails
(assuming you have a working sendmail-like MTA on your machine.  I would
recommend using git send-email to send patches to the list.

Try resending these two patches as their own emails.

 I didn't really intend to get this patch accepted. It was more that
 I feel bad asking for features all the time and as I'm not so
 comfortable with hacking on the notmuch code I thought I'd ask if one
 could implement it like this.  Anyhow, attached you'll find a patch
 for the test and another for the proposed change. Feel free to discard
 it :)

But this is exactly how features get added!  If you want a feature added
to notmuch, send in a patch for it.  Otherwise you'll have to just wait
until someone else submits a patch to do the same thing, which may or
may not ever happen.  It's a community-run project, developed by those
that use the program (which includes you!).  Since you've already done
the work to figure out what needed to be changed, all you need to do now
is follow the procedure I've outlined to publish the patch to the list,
and eventually, hopefully, Carl will get around to pulling it in to the
notmuch master repo.

jamie.


pgpvffhVrKmTs.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


date_relative in notmuch-search

2011-07-15 Thread Patrick Totzke
Hi Jason,

Thanks for the tip with git send-mail. I didn't really intend to
get this "patch" accepted. It was more that I feel bad asking for 
features all the time and as I'm not so comfortable with hacking
on the notmuch code I thought I'd ask if one could implement it like this.
Anyhow, attached you'll find a patch for the test and another for
the proposed change. Feel free to discard it :)
Best,
/p

On Fri, Jul 15, 2011 at 08:58:45AM -0700, Jameson Graef Rollins wrote:
> On Thu, 14 Jul 2011 23:22:58 +0100, Patrick Totzke  googlemail.com> wrote:
> > I wodered why "notmuch search --format=json" doesn't provide the 
> > "date_relative" field for
> > results, as the show command does.
> > 
> > I'm not expert on notmuch internals but I got it working like this:
> 
> Hi, Patrick.  I think this is a very reasonable patch.  However, there
> are a couple of things you need to do to get this patch accepted.
> 
> First of all, you should send the patch to the list in a format that
> will allow it to be applied directly to a git repo.  In particular, it
> needs to include a good commit log message.  Look at using git send-mail
> to send it to the list, which will format it correctly.
> 
> Also, I'm quite sure this patch will require a couple of changes to the
> test suite.  You should submit a patch that changes the test suite to
> reflect the desired changes *first*, followed by the patch that fixes
> the issue.
> 
> Thanks!
> 
> jamie.


------ next part --
A non-text attachment was scrubbed...
Name: 0001-test-date_relative-in-notmuch-search-json-output.patch
Type: text/x-diff
Size: 1230 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110715/4747ac30/attachment.patch>
-- next part --
A non-text attachment was scrubbed...
Name: 0002-json-date_relative-for-threads.patch
Type: text/x-diff
Size: 941 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110715/4747ac30/attachment-0001.patch>
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110715/4747ac30/attachment.pgp>


date_relative in notmuch-search

2011-07-15 Thread Jameson Graef Rollins
On Thu, 14 Jul 2011 23:22:58 +0100, Patrick Totzke  wrote:
> I wodered why "notmuch search --format=json" doesn't provide the 
> "date_relative" field for
> results, as the show command does.
> 
> I'm not expert on notmuch internals but I got it working like this:

Hi, Patrick.  I think this is a very reasonable patch.  However, there
are a couple of things you need to do to get this patch accepted.

First of all, you should send the patch to the list in a format that
will allow it to be applied directly to a git repo.  In particular, it
needs to include a good commit log message.  Look at using git send-mail
to send it to the list, which will format it correctly.

Also, I'm quite sure this patch will require a couple of changes to the
test suite.  You should submit a patch that changes the test suite to
reflect the desired changes *first*, followed by the patch that fixes
the issue.

Thanks!

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



date_relative in notmuch-search

2011-07-15 Thread Patrick Totzke
Hi,

I wodered why "notmuch search --format=json" doesn't provide the 
"date_relative" field for
results, as the show command does.

I'm not expert on notmuch internals but I got it working like this:

diff --git a/notmuch-search.c b/notmuch-search.c
index faccaf7..b1adc03 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -176,12 +176,14 @@ format_thread_json (const void *ctx,

 printf ("\"thread\": %s,\n"
"\"timestamp\": %ld,\n"
+   "\"date_relative\": \"%s\",\n"
"\"matched\": %d,\n"
"\"total\": %d,\n"
"\"authors\": %s,\n"
"\"subject\": %s,\n",
json_quote_str (ctx_quote, thread_id),
date,
+   notmuch_time_relative_date (ctx, date),

I'm unsure it it's better to use json_quote_str here but you tell me :)
Best,
/p
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: 



Re: date_relative in notmuch-search

2011-07-15 Thread Jameson Graef Rollins
On Thu, 14 Jul 2011 23:22:58 +0100, Patrick Totzke 
patricktot...@googlemail.com wrote:
 I wodered why notmuch search --format=json doesn't provide the 
 date_relative field for
 results, as the show command does.
 
 I'm not expert on notmuch internals but I got it working like this:

Hi, Patrick.  I think this is a very reasonable patch.  However, there
are a couple of things you need to do to get this patch accepted.

First of all, you should send the patch to the list in a format that
will allow it to be applied directly to a git repo.  In particular, it
needs to include a good commit log message.  Look at using git send-mail
to send it to the list, which will format it correctly.

Also, I'm quite sure this patch will require a couple of changes to the
test suite.  You should submit a patch that changes the test suite to
reflect the desired changes *first*, followed by the patch that fixes
the issue.

Thanks!

jamie.


pgpzq3jR7AMFf.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: date_relative in notmuch-search

2011-07-15 Thread Patrick Totzke
Hi Jason,

Thanks for the tip with git send-mail. I didn't really intend to
get this patch accepted. It was more that I feel bad asking for 
features all the time and as I'm not so comfortable with hacking
on the notmuch code I thought I'd ask if one could implement it like this.
Anyhow, attached you'll find a patch for the test and another for
the proposed change. Feel free to discard it :)
Best,
/p

On Fri, Jul 15, 2011 at 08:58:45AM -0700, Jameson Graef Rollins wrote:
 On Thu, 14 Jul 2011 23:22:58 +0100, Patrick Totzke 
 patricktot...@googlemail.com wrote:
  I wodered why notmuch search --format=json doesn't provide the 
  date_relative field for
  results, as the show command does.
  
  I'm not expert on notmuch internals but I got it working like this:
 
 Hi, Patrick.  I think this is a very reasonable patch.  However, there
 are a couple of things you need to do to get this patch accepted.
 
 First of all, you should send the patch to the list in a format that
 will allow it to be applied directly to a git repo.  In particular, it
 needs to include a good commit log message.  Look at using git send-mail
 to send it to the list, which will format it correctly.
 
 Also, I'm quite sure this patch will require a couple of changes to the
 test suite.  You should submit a patch that changes the test suite to
 reflect the desired changes *first*, followed by the patch that fixes
 the issue.
 
 Thanks!
 
 jamie.


From 9a0260e36e36af94bed695e713bbc1be0a069fce Mon Sep 17 00:00:00 2001
From: pazz patricktot...@gmail.com
Date: Fri, 15 Jul 2011 21:36:54 +0100
Subject: [PATCH 1/2] test: date_relative in notmuch search json output

expect the date_relative field for thread entries
in notmuch search's json output
---
 test/json |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/test/json b/test/json
index 5a2544c..d54bf25 100755
--- a/test/json
+++ b/test/json
@@ -12,6 +12,7 @@ add_message [subject]=\json-search-subject\ [date]=\Sat, 01 Jan 2000 12:00
 output=$(notmuch search --format=json json-search-message | notmuch_search_sanitize)
 test_expect_equal $output [{\thread\: \XXX\,
 \timestamp\: 946728000,
+\date_relative\: \2000-01-01\,
 \matched\: 1,
 \total\: 1,
 \authors\: \Notmuch Test Suite\,
@@ -28,6 +29,7 @@ add_message [subject]=\json-search-utf8-body-sübjéct\ [date]=\Sat, 01 Ja
 output=$(notmuch search --format=json jsön-search-méssage | notmuch_search_sanitize)
 test_expect_equal $output [{\thread\: \XXX\,
 \timestamp\: 946728000,
+\date_relative\: \2000-01-01\,
 \matched\: 1,
 \total\: 1,
 \authors\: \Notmuch Test Suite\,
-- 
1.7.4.1

From 1a796b09eb4c6171ddaf5f847df56d1a0181cb7c Mon Sep 17 00:00:00 2001
From: pazz patricktot...@gmail.com
Date: Fri, 15 Jul 2011 21:41:02 +0100
Subject: [PATCH 2/2] json: date_relative for threads

include the date_relative field in the
json formated output of notmuch search
---
 notmuch-search.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/notmuch-search.c b/notmuch-search.c
index faccaf7..b1adc03 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -176,12 +176,14 @@ format_thread_json (const void *ctx,
 
 printf (\thread\: %s,\n
 	\timestamp\: %ld,\n
+	\date_relative\: \%s\,\n
 	\matched\: %d,\n
 	\total\: %d,\n
 	\authors\: %s,\n
 	\subject\: %s,\n,
 	json_quote_str (ctx_quote, thread_id),
 	date,
+	notmuch_time_relative_date (ctx, date),
 	matched,
 	total,
 	json_quote_str (ctx_quote, authors),
-- 
1.7.4.1



signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


date_relative in notmuch-search

2011-07-14 Thread Patrick Totzke
Hi,

I wodered why notmuch search --format=json doesn't provide the 
date_relative field for
results, as the show command does.

I'm not expert on notmuch internals but I got it working like this:

diff --git a/notmuch-search.c b/notmuch-search.c
index faccaf7..b1adc03 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -176,12 +176,14 @@ format_thread_json (const void *ctx,
 
 printf (\thread\: %s,\n
\timestamp\: %ld,\n
+   \date_relative\: \%s\,\n
\matched\: %d,\n
\total\: %d,\n
\authors\: %s,\n
\subject\: %s,\n,
json_quote_str (ctx_quote, thread_id),
date,
+   notmuch_time_relative_date (ctx, date),

I'm unsure it it's better to use json_quote_str here but you tell me :)
Best,
/p


signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch