Re: [PATCH] remove prefixes from `--output={threads, messages}' results

2011-07-01 Thread Pieter Praet
On Thu, 30 Jun 2011 09:24:12 -0700, Carl Worth cwo...@cworth.org wrote:
Non-text part: multipart/signed
 On Thu, 30 Jun 2011 10:19:49 +0200, Pieter Praet pie...@praet.org wrote:
  Alter `do_search_threads()' and `do_search_messages()'
  to not prepend each result with `thread:' respectively `id:'.
 
 My one concern here is that I've sometimes had a message-id without the
 id prefix and run a command like this:
 
 notmuch search 1309421989-22410-1-git-send-email-pie...@praet.org
 
 And I've gotten confused when I've received no output, (didn't I receive
 that mail? what happened?).

And unfortunately, that's not the only concern.

While this patch removes a mere 10 chars, it has (way too) far-reaching
consequences, not only for the test suite, but for the entire codebase.

Truth be told, this was never intended to be merged. I only sent this
patch to give a ~fair chance to what appears to be the general
consensus, but I much prefer the fix for do_search_tags() [1].

In fact, all the followup patches (the seemingly haphazard reply nesting
is intentional) are intended to be used with the do_search_tags() fix,
which I tentatively consider a much cleaner path.

 But I think this is a separate bug where the right fix is to make any
 search terms with no prefix search through *all* prefixed terms
 generated from email content. This would allow us to also avoid indexing
 some content twice, (currently we store subject, from, and to both with
 a prefix and without a prefix).

Indeed a most desirable (albeit perhaps long-term) goal.

Much as I'd like, I won't be able to make myself useful in that area for
the time being, as the only C I consider myself sufficiently capable of
pushing around is the one ending with offee :

 -Carl
 
 -- 
 carl.d.wo...@intel.com
Non-text part: application/pgp-signature

Peace

-- 
Pieter

[1] id:1309422029-22924-1-git-send-email-pie...@praet.org
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] remove prefixes from `--output={threads, messages}' results

2011-07-01 Thread Carl Worth
On Thu, 30 Jun 2011 10:19:49 +0200, Pieter Praet pie...@praet.org wrote:
 Alter `do_search_threads()' and `do_search_messages()'
 to not prepend each result with `thread:' respectively `id:'.

My one concern here is that I've sometimes had a message-id without the
id prefix and run a command like this:

notmuch search 1309421989-22410-1-git-send-email-pie...@praet.org

And I've gotten confused when I've received no output, (didn't I receive
that mail? what happened?).

But I think this is a separate bug where the right fix is to make any
search terms with no prefix search through *all* prefixed terms
generated from email content. This would allow us to also avoid indexing
some content twice, (currently we store subject, from, and to both with
a prefix and without a prefix).

-Carl

-- 
carl.d.wo...@intel.com


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


[PATCH] remove prefixes from `--output={threads, messages}' results

2011-06-30 Thread Pieter Praet
On Thu, 30 Jun 2011 09:24:12 -0700, Carl Worth  wrote:
Non-text part: multipart/signed
> On Thu, 30 Jun 2011 10:19:49 +0200, Pieter Praet  wrote:
> > Alter `do_search_threads()' and `do_search_messages()'
> > to not prepend each result with `thread:' respectively `id:'.
> 
> My one concern here is that I've sometimes had a message-id without the
> id prefix and run a command like this:
> 
> notmuch search 1309421989-22410-1-git-send-email-pieter at praet.org
> 
> And I've gotten confused when I've received no output, (didn't I receive
> that mail? what happened?).

And unfortunately, that's not the only concern.

While this patch removes a mere 10 chars, it has (way too) far-reaching
consequences, not only for the test suite, but for the entire codebase.

Truth be told, this was never intended to be merged. I only sent this
patch to give a ~fair chance to what appears to be the general
consensus, but I much prefer the fix for do_search_tags() [1].

In fact, all the followup patches (the seemingly haphazard reply nesting
is intentional) are intended to be used with the do_search_tags() fix,
which I tentatively consider a much cleaner path.

> But I think this is a separate bug where the right fix is to make any
> search terms with no prefix search through *all* prefixed terms
> generated from email content. This would allow us to also avoid indexing
> some content twice, (currently we store subject, from, and to both with
> a prefix and without a prefix).

Indeed a most desirable (albeit perhaps long-term) goal.

Much as I'd like, I won't be able to make myself useful in that area for
the time being, as the only C I consider myself sufficiently capable of
pushing around is the one ending with "offee" :<

> -Carl
> 
> -- 
> carl.d.worth at intel.com
Non-text part: application/pgp-signature

Peace

-- 
Pieter

[1] id:"1309422029-22924-1-git-send-email-pieter at praet.org"


[PATCH] remove prefixes from `--output={threads,messages}' results

2011-06-30 Thread Pieter Praet
Alter `do_search_threads()' and `do_search_messages()'
to not prepend each result with `thread:' respectively `id:'.

This makes its output consistent with `do_search_tags()'.

See this discussion: id:"871v6b79s0.fsf at yoom.home.cworth.org"



NOTE:

I started adjusting the tests as well, but stopped fairly quickly since
the amount is simply *ludicrous*. Only 9 tests fail initially, but start
ripping out `notmuch_search_sanitize' (as would be sensible) and you'll
see what I mean.

Time isn't the issue (sed flies through it faster than Windoze can BSOD),
but the patch will be so huge and disruptive that even Ubuntu devs might
consider frowning disapprovingly.



Signed-off-by: Pieter Praet 
---
 notmuch-search.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch-search.c b/notmuch-search.c
index faccaf7..c565ae6 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -220,7 +220,7 @@ do_search_threads (const search_format_t *format,
thread = notmuch_threads_get (threads);

if (output == OUTPUT_THREADS) {
-   format->item_id (thread, "thread:",
+   format->item_id (thread, "",
 notmuch_thread_get_thread_id (thread));
} else { /* output == OUTPUT_SUMMARY */
fputs (format->item_start, stdout);
@@ -312,7 +312,7 @@ do_search_messages (const search_format_t *format,
if (! first_message)
fputs (format->item_sep, stdout);

-   format->item_id (message, "id:",
+   format->item_id (message, "",
 notmuch_message_get_message_id (message));
first_message = 0;
}
-- 
1.7.4.1



[PATCH] remove prefixes from `--output={threads, messages}' results

2011-06-30 Thread Carl Worth
On Thu, 30 Jun 2011 10:19:49 +0200, Pieter Praet  wrote:
> Alter `do_search_threads()' and `do_search_messages()'
> to not prepend each result with `thread:' respectively `id:'.

My one concern here is that I've sometimes had a message-id without the
id prefix and run a command like this:

notmuch search 1309421989-22410-1-git-send-email-pieter at praet.org

And I've gotten confused when I've received no output, (didn't I receive
that mail? what happened?).

But I think this is a separate bug where the right fix is to make any
search terms with no prefix search through *all* prefixed terms
generated from email content. This would allow us to also avoid indexing
some content twice, (currently we store subject, from, and to both with
a prefix and without a prefix).

-Carl

-- 
carl.d.worth at intel.com
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



[PATCH] remove prefixes from `--output={threads,messages}' results

2011-06-30 Thread Pieter Praet
Alter `do_search_threads()' and `do_search_messages()'
to not prepend each result with `thread:' respectively `id:'.

This makes its output consistent with `do_search_tags()'.

See this discussion: id:871v6b79s0@yoom.home.cworth.org



NOTE:

I started adjusting the tests as well, but stopped fairly quickly since
the amount is simply *ludicrous*. Only 9 tests fail initially, but start
ripping out `notmuch_search_sanitize' (as would be sensible) and you'll
see what I mean.

Time isn't the issue (sed flies through it faster than Windoze can BSOD),
but the patch will be so huge and disruptive that even Ubuntu devs might
consider frowning disapprovingly.



Signed-off-by: Pieter Praet pie...@praet.org
---
 notmuch-search.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch-search.c b/notmuch-search.c
index faccaf7..c565ae6 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -220,7 +220,7 @@ do_search_threads (const search_format_t *format,
thread = notmuch_threads_get (threads);
 
if (output == OUTPUT_THREADS) {
-   format-item_id (thread, thread:,
+   format-item_id (thread, ,
 notmuch_thread_get_thread_id (thread));
} else { /* output == OUTPUT_SUMMARY */
fputs (format-item_start, stdout);
@@ -312,7 +312,7 @@ do_search_messages (const search_format_t *format,
if (! first_message)
fputs (format-item_sep, stdout);
 
-   format-item_id (message, id:,
+   format-item_id (message, ,
 notmuch_message_get_message_id (message));
first_message = 0;
}
-- 
1.7.4.1

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