[PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Dmitry Kurochkin
On Wed, 15 Jun 2011 10:00:36 -0700, Carl Worth  wrote:
> On Wed, 15 Jun 2011 18:25:14 +0400, Dmitry Kurochkin  gmail.com> wrote:
> > I know you prefer tests to go before patches and I agree with that.
> 
> Great!
> 
> > But most of the time I do tests after coding.
> 
> Yes, I do that order almost exclusively as well.
> 
> > I do not know an easy way to reorder patches in git.  (Also I do not
> > know how to amend an old patch
> 
> Fortunately, git has a great feature here for both use cases, (git
> rebase -i). Here's the simple recipe:
> 
> * Find a bug, fix a bug, commit
> 
> * Write a test case, commit
> 
> * Run the following command:
> 
>   git rebase -i origin/master
> 
> At this point you'll be presented with an editor window giving one line
> for each commit that you have made since origin/master. You can reorder
> these lines however you'd like. When you save and exit the editor, the
> commits will be applied in the order you saved.
> 
> If there are any conflicts due to the re-ordering, then git rebase will
> stop and tell you what to do, which will be:
> 
> * Resolve the conflict
> 
> * Run "git add" on the files you edited
> 
> * Run "git rebase --continue"
> 
> Also, back when editing the original list of commits, you can change the
> word "apply" next to any particular commit to change what happens when
> applying it. If you change that to "reword" you'll be given an editor
> window to edit the commit message. If you use "edit" then you'll be
> dropped to a shell where you can:
> 
> * Edit the code
> 
> * Test as necessary
> 
> * Run "git commit --amend"
> 
> * Run "git rebase --continue"
> 
> I absolutely love "git rebase -i". It's one of my favorite
> user-interface features in git.
> 

Thanks for this.  I did not know about interactive mode in rebase.

This is some sort of replacement for darcs amend (which allows editing
any patch, not just the last one).

> > wish more darcs features in git.
> 
> I don't know about "git rebase -i", but I think I heard that "git add
> -i", (interactively add some portions of the dirty working tree to the
> index to be committed). I think the menu-based interface of "git add -i"
> is particularly clunky. But I love the trimmed-down interface of "git
> add -p" which simply prompts one-patch-hunk-at-a-time for pieces to add
> to the next commit. It even supports splitting a hunk, (or even manually
> editing the patch to trim it down!). It's pretty slick stuff.
> 

Yes, "add -i" is ugl... confusing, but "add -p" is very nice.  A great
feature of darcs picked up by git.

> So there are some git tips that might be useful.
> 

They will be useful indeed.  Thanks!

Regards,
  Dmitry

> > Thanks.
> 
> You're quite welcome. Thanks for all the great work. Please keep it up!
> 
> -Carl
> 
> -- 
> carl.d.worth at intel.com


[PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Dmitry Kurochkin
On Wed, 15 Jun 2011 07:06:40 -0700, Carl Worth  wrote:
> On Fri, 27 May 2011 01:42:22 +0400, Dmitry Kurochkin  gmail.com> wrote:
> > I have just send two more patches to this thread.  One with new tests.
> > Another with a workaround for the bug.  The workaround should not break
> > anything since it affects only notmuch-show mode.
> 
> Thanks!
> 
> I love committing tests that demonstrate broken code before committing
> fixes. As it happened here, I committed these two new patches thinking I
> had previously committed the earlier patches in the series. Fortunately,
> the failure of the test pointed out that I was missing the actual fix.
> 

I know you prefer tests to go before patches and I agree with that.  But
most of the time I do tests after coding.  I do not know an easy way to
reorder patches in git.  (Also I do not know how to amend an old patch,
wish more darcs features in git.)  Hopefully it is not a big trouble for
you to reorder the patches when applying.

> I also really like the workaround to avoid regressing functionality
> because of an emacs bug.
> 

indeed

> Well done, Dmitry. I've now pushed out everything in this series.
> 

Thanks.

Regards,
  Dmitry

> -Carl
> 
> -- 
> carl.d.worth at intel.com


[PATCH 3/3] Fix indentation in guess_from_received_header().

2011-06-15 Thread Dmitry Kurochkin
---
 notmuch-reply.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 64f70bf..27ef37b 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -427,13 +427,13 @@ guess_from_received_header (notmuch_config_t *config, 
notmuch_message_t *message

if (strcasestr(primary, domain)) {
free(mta);
-   return primary;
-   }
-   for (i = 0; i < other_len; i++)
-   if (strcasestr (other[i],domain)) {
-   free(mta);
-   return other[i];
+   return primary;
}
+   for (i = 0; i < other_len; i++)
+   if (strcasestr (other[i],domain)) {
+   free(mta);
+   return other[i];
+   }
}
free (mta);
 }
-- 
1.7.5.4



[PATCH 2/3] Fix memory leak in guess_from_received_header().

2011-06-15 Thread Dmitry Kurochkin
Mta variable was not free()d in one case.
---
 notmuch-reply.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index dab69e6..64f70bf 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -401,8 +401,10 @@ guess_from_received_header (notmuch_config_t *config, 
notmuch_message_t *message
break;
mta = xstrdup (by);
token = strtok(mta," \t");
-   if (token == NULL)
+   if (token == NULL) {
+   free (mta);
break;
+   }
/* Now extract the last two components of the MTA host name
 * as domain and tld.
 */
-- 
1.7.5.4



[PATCH 1/3] Fix double free in guess_from_received_header().

2011-06-15 Thread Dmitry Kurochkin
Before the change, the last loop in guess_from_received_header()
did not reset domain and tld variables to NULL.  This leads to
double free error in some cases and possibly other bugs.
---
 notmuch-reply.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 514bbc6..dab69e6 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -406,6 +406,7 @@ guess_from_received_header (notmuch_config_t *config, 
notmuch_message_t *message
/* Now extract the last two components of the MTA host name
 * as domain and tld.
 */
+   domain = tld = NULL;
while ((ptr = strsep (, delim)) != NULL) {
if (*ptr == '\0')
continue;
-- 
1.7.5.4



[PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Carl Worth
On Wed, 15 Jun 2011 18:25:14 +0400, Dmitry Kurochkin  wrote:
> I know you prefer tests to go before patches and I agree with that.

Great!

> But most of the time I do tests after coding.

Yes, I do that order almost exclusively as well.

> I do not know an easy way to reorder patches in git.  (Also I do not
> know how to amend an old patch

Fortunately, git has a great feature here for both use cases, (git
rebase -i). Here's the simple recipe:

* Find a bug, fix a bug, commit

* Write a test case, commit

* Run the following command:

git rebase -i origin/master

At this point you'll be presented with an editor window giving one line
for each commit that you have made since origin/master. You can reorder
these lines however you'd like. When you save and exit the editor, the
commits will be applied in the order you saved.

If there are any conflicts due to the re-ordering, then git rebase will
stop and tell you what to do, which will be:

* Resolve the conflict

* Run "git add" on the files you edited

* Run "git rebase --continue"

Also, back when editing the original list of commits, you can change the
word "apply" next to any particular commit to change what happens when
applying it. If you change that to "reword" you'll be given an editor
window to edit the commit message. If you use "edit" then you'll be
dropped to a shell where you can:

* Edit the code

* Test as necessary

* Run "git commit --amend"

* Run "git rebase --continue"

I absolutely love "git rebase -i". It's one of my favorite
user-interface features in git.

> wish more darcs features in git.

I don't know about "git rebase -i", but I think I heard that "git add
-i", (interactively add some portions of the dirty working tree to the
index to be committed). I think the menu-based interface of "git add -i"
is particularly clunky. But I love the trimmed-down interface of "git
add -p" which simply prompts one-patch-hunk-at-a-time for pieces to add
to the next commit. It even supports splitting a hunk, (or even manually
editing the patch to trim it down!). It's pretty slick stuff.

So there are some git tips that might be useful.

> Thanks.

You're quite welcome. Thanks for all the great work. Please keep it up!

-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: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110615/49ba95ec/attachment.pgp>


[PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Jameson Graef Rollins
On Wed, 15 Jun 2011 18:25:14 +0400, Dmitry Kurochkin  wrote:
> I know you prefer tests to go before patches and I agree with that.  But
> most of the time I do tests after coding.  I do not know an easy way to
> reorder patches in git.  (Also I do not know how to amend an old patch,
> wish more darcs features in git.)  Hopefully it is not a big trouble for
> you to reorder the patches when applying.

Hey, Dmitry.  I usually just pop in to a new branch rooted before my new
patch series, and then cherry-pick the new patches onto the branch in
the order I want (eg. tests first, etc.).

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110615/ba05a100/attachment.pgp>


[PATCH 1/3] Fix double free in guess_from_received_header().

2011-06-15 Thread Carl Worth
On Wed, 15 Jun 2011 15:12:12 +0400, Dmitry Kurochkin  wrote:
> Before the change, the last loop in guess_from_received_header()
> did not reset domain and tld variables to NULL.  This leads to
> double free error in some cases and possibly other bugs.

Thanks for the fixes. These are all pushed now.

-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: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110615/628ecd30/attachment.pgp>


[PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Carl Worth
On Fri, 27 May 2011 01:42:22 +0400, Dmitry Kurochkin  wrote:
> I have just send two more patches to this thread.  One with new tests.
> Another with a workaround for the bug.  The workaround should not break
> anything since it affects only notmuch-show mode.

Thanks!

I love committing tests that demonstrate broken code before committing
fixes. As it happened here, I committed these two new patches thinking I
had previously committed the earlier patches in the series. Fortunately,
the failure of the test pointed out that I was missing the actual fix.

I also really like the workaround to avoid regressing functionality
because of an emacs bug.

Well done, Dmitry. I've now pushed out everything in this series.

-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: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110615/ebf7d689/attachment.pgp>


[PATCH] emacs: Add callback functions to crypto sigstatus button.

2011-06-15 Thread Jameson Graef Rollins
On Tue, 31 May 2011 10:07:13 -0700, Jameson Graef Rollins  wrote:
> This adds two callback functions to the sigstatus button.  If the sig
> status is "good", then clicking the button displays the output of "gpg
> --list-keys" on the key fingerprint.  If the sigstatus is "bad", then
> clicking the button will retrieve the key from the keyserver, and
> redisplay the current buffer.
> 
> Thanks to David Bremner  for help with this.

I just want to point out for the record that this patch depends on the
patch series starting at:

id:"1306627784-3401-1-git-send-email-jrollins at finestructure.net"

Sorry for the mixup.

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



Re: [PATCH] emacs: Add callback functions to crypto sigstatus button.

2011-06-15 Thread Jameson Graef Rollins
On Tue, 31 May 2011 10:07:13 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
 This adds two callback functions to the sigstatus button.  If the sig
 status is good, then clicking the button displays the output of gpg
 --list-keys on the key fingerprint.  If the sigstatus is bad, then
 clicking the button will retrieve the key from the keyserver, and
 redisplay the current buffer.
 
 Thanks to David Bremner brem...@unb.ca for help with this.

I just want to point out for the record that this patch depends on the
patch series starting at:

id:1306627784-3401-1-git-send-email-jroll...@finestructure.net

Sorry for the mixup.

jamie.


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


[PATCH 2/3] Fix memory leak in guess_from_received_header().

2011-06-15 Thread Dmitry Kurochkin
Mta variable was not free()d in one case.
---
 notmuch-reply.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index dab69e6..64f70bf 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -401,8 +401,10 @@ guess_from_received_header (notmuch_config_t *config, 
notmuch_message_t *message
break;
mta = xstrdup (by);
token = strtok(mta, \t);
-   if (token == NULL)
+   if (token == NULL) {
+   free (mta);
break;
+   }
/* Now extract the last two components of the MTA host name
 * as domain and tld.
 */
-- 
1.7.5.4

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


[PATCH 3/3] Fix indentation in guess_from_received_header().

2011-06-15 Thread Dmitry Kurochkin
---
 notmuch-reply.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 64f70bf..27ef37b 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -427,13 +427,13 @@ guess_from_received_header (notmuch_config_t *config, 
notmuch_message_t *message
 
if (strcasestr(primary, domain)) {
free(mta);
-   return primary;
-   }
-   for (i = 0; i  other_len; i++)
-   if (strcasestr (other[i],domain)) {
-   free(mta);
-   return other[i];
+   return primary;
}
+   for (i = 0; i  other_len; i++)
+   if (strcasestr (other[i],domain)) {
+   free(mta);
+   return other[i];
+   }
}
free (mta);
 }
-- 
1.7.5.4

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


Re: [PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Carl Worth
On Fri, 27 May 2011 01:42:22 +0400, Dmitry Kurochkin 
dmitry.kuroch...@gmail.com wrote:
 I have just send two more patches to this thread.  One with new tests.
 Another with a workaround for the bug.  The workaround should not break
 anything since it affects only notmuch-show mode.

Thanks!

I love committing tests that demonstrate broken code before committing
fixes. As it happened here, I committed these two new patches thinking I
had previously committed the earlier patches in the series. Fortunately,
the failure of the test pointed out that I was missing the actual fix.

I also really like the workaround to avoid regressing functionality
because of an emacs bug.

Well done, Dmitry. I've now pushed out everything in this series.

-Carl

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


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


Re: [PATCH 1/3] Fix double free in guess_from_received_header().

2011-06-15 Thread Carl Worth
On Wed, 15 Jun 2011 15:12:12 +0400, Dmitry Kurochkin 
dmitry.kuroch...@gmail.com wrote:
 Before the change, the last loop in guess_from_received_header()
 did not reset domain and tld variables to NULL.  This leads to
 double free error in some cases and possibly other bugs.

Thanks for the fixes. These are all pushed now.

-Carl

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


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


Re: [PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Dmitry Kurochkin
On Wed, 15 Jun 2011 07:06:40 -0700, Carl Worth cwo...@cworth.org wrote:
 On Fri, 27 May 2011 01:42:22 +0400, Dmitry Kurochkin 
 dmitry.kuroch...@gmail.com wrote:
  I have just send two more patches to this thread.  One with new tests.
  Another with a workaround for the bug.  The workaround should not break
  anything since it affects only notmuch-show mode.
 
 Thanks!
 
 I love committing tests that demonstrate broken code before committing
 fixes. As it happened here, I committed these two new patches thinking I
 had previously committed the earlier patches in the series. Fortunately,
 the failure of the test pointed out that I was missing the actual fix.
 

I know you prefer tests to go before patches and I agree with that.  But
most of the time I do tests after coding.  I do not know an easy way to
reorder patches in git.  (Also I do not know how to amend an old patch,
wish more darcs features in git.)  Hopefully it is not a big trouble for
you to reorder the patches when applying.

 I also really like the workaround to avoid regressing functionality
 because of an emacs bug.
 

indeed

 Well done, Dmitry. I've now pushed out everything in this series.
 

Thanks.

Regards,
  Dmitry

 -Carl
 
 -- 
 carl.d.wo...@intel.com
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Jameson Graef Rollins
On Wed, 15 Jun 2011 18:25:14 +0400, Dmitry Kurochkin 
dmitry.kuroch...@gmail.com wrote:
 I know you prefer tests to go before patches and I agree with that.  But
 most of the time I do tests after coding.  I do not know an easy way to
 reorder patches in git.  (Also I do not know how to amend an old patch,
 wish more darcs features in git.)  Hopefully it is not a big trouble for
 you to reorder the patches when applying.

Hey, Dmitry.  I usually just pop in to a new branch rooted before my new
patch series, and then cherry-pick the new patches onto the branch in
the order I want (eg. tests first, etc.).

jamie.


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


Re: [PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Carl Worth
On Wed, 15 Jun 2011 18:25:14 +0400, Dmitry Kurochkin 
dmitry.kuroch...@gmail.com wrote:
 I know you prefer tests to go before patches and I agree with that.

Great!

 But most of the time I do tests after coding.

Yes, I do that order almost exclusively as well.

 I do not know an easy way to reorder patches in git.  (Also I do not
 know how to amend an old patch

Fortunately, git has a great feature here for both use cases, (git
rebase -i). Here's the simple recipe:

* Find a bug, fix a bug, commit

* Write a test case, commit

* Run the following command:

git rebase -i origin/master

At this point you'll be presented with an editor window giving one line
for each commit that you have made since origin/master. You can reorder
these lines however you'd like. When you save and exit the editor, the
commits will be applied in the order you saved.

If there are any conflicts due to the re-ordering, then git rebase will
stop and tell you what to do, which will be:

* Resolve the conflict

* Run git add on the files you edited

* Run git rebase --continue

Also, back when editing the original list of commits, you can change the
word apply next to any particular commit to change what happens when
applying it. If you change that to reword you'll be given an editor
window to edit the commit message. If you use edit then you'll be
dropped to a shell where you can:

* Edit the code

* Test as necessary

* Run git commit --amend

* Run git rebase --continue

I absolutely love git rebase -i. It's one of my favorite
user-interface features in git.

 wish more darcs features in git.

I don't know about git rebase -i, but I think I heard that git add
-i, (interactively add some portions of the dirty working tree to the
index to be committed). I think the menu-based interface of git add -i
is particularly clunky. But I love the trimmed-down interface of git
add -p which simply prompts one-patch-hunk-at-a-time for pieces to add
to the next commit. It even supports splitting a hunk, (or even manually
editing the patch to trim it down!). It's pretty slick stuff.

So there are some git tips that might be useful.

 Thanks.

You're quite welcome. Thanks for all the great work. Please keep it up!

-Carl

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


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


Re: [PATCH 3/5] Fix hiding a message while some citations are shown in notmuch-show view.

2011-06-15 Thread Dmitry Kurochkin
On Wed, 15 Jun 2011 10:00:36 -0700, Carl Worth cwo...@cworth.org wrote:
 On Wed, 15 Jun 2011 18:25:14 +0400, Dmitry Kurochkin 
 dmitry.kuroch...@gmail.com wrote:
  I know you prefer tests to go before patches and I agree with that.
 
 Great!
 
  But most of the time I do tests after coding.
 
 Yes, I do that order almost exclusively as well.
 
  I do not know an easy way to reorder patches in git.  (Also I do not
  know how to amend an old patch
 
 Fortunately, git has a great feature here for both use cases, (git
 rebase -i). Here's the simple recipe:
 
 * Find a bug, fix a bug, commit
 
 * Write a test case, commit
 
 * Run the following command:
 
   git rebase -i origin/master
 
 At this point you'll be presented with an editor window giving one line
 for each commit that you have made since origin/master. You can reorder
 these lines however you'd like. When you save and exit the editor, the
 commits will be applied in the order you saved.
 
 If there are any conflicts due to the re-ordering, then git rebase will
 stop and tell you what to do, which will be:
 
 * Resolve the conflict
 
 * Run git add on the files you edited
 
 * Run git rebase --continue
 
 Also, back when editing the original list of commits, you can change the
 word apply next to any particular commit to change what happens when
 applying it. If you change that to reword you'll be given an editor
 window to edit the commit message. If you use edit then you'll be
 dropped to a shell where you can:
 
 * Edit the code
 
 * Test as necessary
 
 * Run git commit --amend
 
 * Run git rebase --continue
 
 I absolutely love git rebase -i. It's one of my favorite
 user-interface features in git.
 

Thanks for this.  I did not know about interactive mode in rebase.

This is some sort of replacement for darcs amend (which allows editing
any patch, not just the last one).

  wish more darcs features in git.
 
 I don't know about git rebase -i, but I think I heard that git add
 -i, (interactively add some portions of the dirty working tree to the
 index to be committed). I think the menu-based interface of git add -i
 is particularly clunky. But I love the trimmed-down interface of git
 add -p which simply prompts one-patch-hunk-at-a-time for pieces to add
 to the next commit. It even supports splitting a hunk, (or even manually
 editing the patch to trim it down!). It's pretty slick stuff.
 

Yes, add -i is ugl... confusing, but add -p is very nice.  A great
feature of darcs picked up by git.

 So there are some git tips that might be useful.
 

They will be useful indeed.  Thanks!

Regards,
  Dmitry

  Thanks.
 
 You're quite welcome. Thanks for all the great work. Please keep it up!
 
 -Carl
 
 -- 
 carl.d.wo...@intel.com
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch