All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: "git discussion list" <git@vger.kernel.org>,
	"Andy Parkins" <andyparkins@gmail.com>,
	"Sitaram Chamarty" <sitaramc@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Marc Branchaud" <mbranchaud@xiplink.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Chris Hiestand" <chiestand@salk.edu>
Subject: Re: [RFC v2] git-multimail: a replacement for post-receive-email
Date: Fri, 15 Feb 2013 06:07:24 +0100	[thread overview]
Message-ID: <511DC28C.1080104@alum.mit.edu> (raw)
In-Reply-To: <vpq7gmbdpi2.fsf@grenoble-inp.fr>

On 02/14/2013 01:55 PM, Matthieu Moy wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
> 
>> On 02/13/2013 03:56 PM, Matthieu Moy wrote:
>>
>>> Installation troubles:
>>>
>>> I had an old python installation (Red Hat package, and I'm not root),
>>> that did not include the email.utils package, so I couldn't use my
>>> system's python. I found no indication about python version in README,
>>> so I installed the latest python by hand, just to find out that
>>> git-multimail wasn't compatible with Python 3.x. 2to3 can fix
>>> automatically a number of 3.x compatibility issues, but not all of them
>>> so I gave up and installed Python 2.7.
>>
>> What version of Python was it that caused problems?
> 
> Python 2.4.3, installed with RHEL 5.9.
> 
>> I just discovered that the script wouldn't have worked with Python
>> 2.4, where "email.utils" used to be called "email.Utils".
> 
> Indeed, "import email.Utils" works with this Python.
> 
>> But I pushed a fix to GitHub:
>>
>>     ddb1796660 Accommodate older versions of Python's email module.
> 
> Not sufficient, but I added a pull request that works for me with 2.4.
> 
>>> @@ -835,6 +837,17 @@ class ReferenceChange(Change):
>>>                  for line in self.expand_lines(NO_NEW_REVISIONS_TEMPLATE):
>>>                      yield line
>>>  
>>> +            if adds and self.showlog:
>>> +                yield '\n'
>>> +                yield 'Detailed log of added commits:\n\n'
>>> +                for line in read_lines(
>>> +                        ['git', 'log']
>>> +                        + self.logopts
>>> +                        + ['%s..%s' % (self.old.commit, self.new.commit,)],
>>> +                        keepends=True,
>>> +                        ):
>>> +                    yield line
>>> +
>>>              # The diffstat is shown from the old revision to the new
>>>              # revision.  This is to show the truth of what happened in
>>>              # this change.  There's no point showing the stat from the
>>>
>>
>> Thanks for the patch.  I like the idea, but I think the implementation
>> is incorrect.  Your code will not only list new commits but will also
>> list commits that were already in the repository on another branch
>> (e.g., if an existing feature branch is merged into master, all of the
>> commits on the feature branch will be listed).  (Or was that your
>> intention?)
> 
> I did not think very carefully about this case, but the behavior of my
> code seems sensible (although not uncontroversial): it's just showing
> the detailed log for the same commits as the summary at the top of the
> email. I have no personnal preferences.

I guess it depends a lot on what logopts are used.  If the user
configures logopts to emit full patches, then the repeated reporting of
the same commits would cause a big increase in the bulk of notification
emails.  But if the logopts are set to just emit a brief summary (e.g.,
author and log message), then a bit of repetition might be acceptable.
But since I wouldn't use this feature, I don't personally have a preference.

>> But even worse, it will fail to list commits that were
>> added at the same time that a branch was created (e.g., if I create a
>> feature branch with a number of commits on it and then push it for the
>> first time).
> 
> Right.
> 
>> Probably the Push object has to negotiate with its constituent
>> ReferenceChange objects to figure out which one is responsible for
>> summarizing each of the commits newly added by the push (i.e., the ones
>> returned by push.get_new_commits(None)).
> 
> I updated the pull request with a version that works for new branches,
> and takes the list of commits to display from the call to
> get_new_commits (which were already there for other purpose). Then, it
> essentially calls "git log --no-walk $list_of_sha1s".
> 
> This should be better.

I will check it out.

Thanks!

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

  reply	other threads:[~2013-02-15  5:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27  8:37 [RFC v2] git-multimail: a replacement for post-receive-email Michael Haggerty
2013-01-29 15:25 ` Ævar Arnfjörð Bjarmason
2013-01-30  2:27   ` Chris Hiestand
2013-02-13 14:56 ` Matthieu Moy
2013-02-13 15:26   ` Andy Parkins
2013-02-13 16:12     ` Matthieu Moy
2013-02-13 21:42   ` Michael Haggerty
2013-02-14 12:55     ` Matthieu Moy
2013-02-15  5:07       ` Michael Haggerty [this message]
2013-02-20 12:28 ` Matthieu Moy
2013-02-24  5:31   ` Michael Haggerty
2013-02-25  9:54     ` Matthieu Moy
2013-02-25 10:50       ` Michael Haggerty
2013-03-09  5:32         ` Michael Haggerty
2013-02-24  5:53   ` Michael Haggerty
2013-02-25 10:01     ` Matthieu Moy
2013-03-04  8:56   ` Matthieu Moy

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=511DC28C.1080104@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=andyparkins@gmail.com \
    --cc=avarab@gmail.com \
    --cc=chiestand@salk.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mbranchaud@xiplink.com \
    --cc=sitaramc@gmail.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.