From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.58.247.3 with SMTP id ya3csp855021vec; Thu, 23 Aug 2012 11:52:14 -0700 (PDT) Received: by 10.50.15.202 with SMTP id z10mr2716185igc.50.1345747933533; Thu, 23 Aug 2012 11:52:13 -0700 (PDT) Return-Path: Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com. [50.56.192.79]) by mx.google.com with ESMTP id e5si394344igp.4.2012.08.23.11.52.13; Thu, 23 Aug 2012 11:52:13 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) client-ip=50.56.192.79; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id B88122E06C; Thu, 23 Aug 2012 18:52:12 +0000 (UTC) Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU [18.7.68.35]) by rubyforge.org (Postfix) with ESMTP id 3776E2E05D for ; Thu, 23 Aug 2012 18:20:26 +0000 (UTC) X-AuditID: 12074423-b7fcb6d0000008c8-b5-5036746a0a07 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id 6E.B9.02248.A6476305; Thu, 23 Aug 2012 14:20:26 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q7NIKQo1003307; Thu, 23 Aug 2012 14:20:26 -0400 Received: from localhost ([64.119.153.34]) (authenticated bits=0) (User authenticated as ezyang@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q7NIKJGA026103; Thu, 23 Aug 2012 14:20:25 -0400 (EDT) To: Alvaro Herrera In-reply-to: <1345733453-sup-9957@alvh.no-ip.org> References: <1345559230-sup-5105@javelin> <1345614331-17294-1-git-send-email-ezyang@mit.edu> <1345614564-sup-5523@javelin> <1345665956-sup-4988@javelin> <1345732781-sup-2983@javelin> <1345733453-sup-9957@alvh.no-ip.org> From: "Edward Z. Yang" Date: Thu, 23 Aug 2012 14:20:18 -0400 Message-Id: <1345745979-sup-7676@javelin> User-Agent: Sup/git X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsUixCmqrZtVYhZg8HayisWFyX/YLR5P38Pu wORx5ddEdo99+yYyBzBFcdmkpOZklqUW6dslcGX0b1nCUnCHp+Lpi5vMDYxPObsYOTgkBEwk bj9W6GLkBDLFJC7cW8/WxcjFISSwj1Hi36kfTBDOBkaJ5YdPsUM4zxglFjx5wwTSzSygLrF+ nhBIt4iAjsTS9bfZQWxOAUOJXS/PMoLYzAJmEv1TnrJC9N5mlDg//yZYERtQ76NjIAkODmGB RImVkzxBwiwCqhLr3m5iAbF5BTQlmh7OYAKxRQWEJZ4caWaGmCkv0bx1NvMERoFZCFfMQpJZ wMi0ilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdMLzezRC81pXQTIygY2V2UdzD+Oah0iFGAg1GJ h/eFuWmAEGtiWXFl7iFGSQ4mJVHe8wVmAUJ8SfkplRmJxRnxRaU5qcWHGCU4mJVEeL04gXK8 KYmVValF+TApaQ4WJXHeayk3/YUE0hNLUrNTUwtSi2CyMhwcShK8SsCoExIsSk1PrUjLzClB SDNxcIIM5wEafr4YZHhxQWJucWY6RP4Uo6KUOG8tSEIAJJFRmgfXC0sWrxjFgV4R5p0KUsUD TDRw3a+ABjMBDVa7agwyuCQRISXVwKjVHufZ2Ljr54YZL3SnLWbXLDD2PGmgY1x6wuCzvH7M BbaYnBV9qy4vsss8Wj6zrM7l2bHrKo+uZU63E95r5O20KK5sWcbvu3O12B8duG2sUrpWqc7r Rfmyz6WfZl0v/MzLV8gUlneoJL86Ra3a5ELw6ycznyxsf/RIOd/in+FpEYG/4V76q5VYijMS DbWYi4oTAZFOFzTxAgAA Cc: Sup developer discussion Subject: Re: [sup-devel] [PATCH] Implement moving message between Maildir sources based on label. X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org With pleasure, I report that Sup is actually doing this! So solving the "hooks run too many times" is as easy as this: commit ec3afe7ac01741bc67f68009193d2d2e73f05529 Author: Edward Z. Yang Date: Thu Aug 23 14:19:24 2012 -0400 Don't run before-add-message hook for messages already in index. Signed-off-by: Edward Z. Yang diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index 1b64098..7d5aaa2 100644 --- a/lib/sup/poll.rb +++ b/lib/sup/poll.rb @@ -184,7 +184,7 @@ EOS m.labels.each { |l| LabelManager << l } m.labels = old_m.labels + (m.labels - [:unread, :inbox]) if old_m m.locations = old_m.locations + m.locations if old_m - HookManager.run "before-add-message", :message => m + HookManager.run "before-add-message", :message => m if not old_m yield :add, m, old_m, args[:progress] if block_given? Index.sync_message m, true Excerpts from Alvaro Herrera's message of Thu Aug 23 10:52:21 -0400 2012: > Excerpts from Edward Z. Yang's message of jue ago 23 10:40:22 -0400 2012: > > It looks like the current patchset will *destroy* all labels you have > > on messages, so be careful! (This was masked for me since most of my > > labels are from before-add-message.rb, and that hook gets reapplied) > > Thanks for the notice. Most of my labels come from that hook too, but a > few do not, so I could easily lose some! I was planning on trying out > your patch, but with this caveat I'm likely to refrain. Are you > planning on submitting a fixed version? > _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel