This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 139312 - Better email notification from Hg repos
Summary: Better email notification from Hg repos
Status: NEW
Alias: None
Product: www
Classification: Unclassified
Component: Builds & Repositories (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: pgebauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-08 21:06 UTC by Jesse Glick
Modified: 2011-06-02 14:06 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-07-08 21:06:09 UTC
The current mail notification system for Hg changes is not good. Specifically:

1. Merge changesets are skipped, but this means bad merges, or even correct but nontrivial merges, are not reported to
anyone.

2. Diffs are truncated at just 300 lines, which is inadequate.

3. The same message can be sent to many lists. If you subscribe to several, you get duplicates.

4. A change to 500 files in web.core and 1 file in nbbuild will result in a message to cvs@web and cvs@nbbuild with the
complete (but truncated) patch. Probably the cvs@nbbuild subscriber is interested just in the changes made in nbbuild.

5. There is no clear way how mail notification for clones should be configured.

6. If a branch is merged, dozens of messages may be sent, but it is hard to review the changes because you see the
history of every mistake, rather than a summary of the final result.

7. Diffs do not use --git, so renames do not appear correctly.

My proposal:

Stop keeping .hgmail in the same repo. Have a separate repo (or just nb-hooks?) containing e.g.

hgmail/main
hgmail/core-main
hgmail/some-random-branch

etc., where each file configures mail notification for that repo independently.

Change the email notification hook to behave as follows:

1. Collect a list of all changesets being pushed in this block. Just record their IDs, authors, and messages for later.

2. Perform a diff from the original tip to the new tip and examine the list of all files mentioned in the diff. Or
otherwise create a list of all files changed between original and new tip.

3. Collect a list of all email aliases corresponding to those files in hgmail/$repo.

4. For each alias, say "cvs@web=web.*/*":

4a. Run diff --git -r oldtip -r tip web.*/*

4b. Truncate diff to, say, 5000 lines.

4c. Send message to the alias with the diff preceded by a list of all the changesets, hyperlinked with message and
author info. (Ideally would restrict list to changesets which affect the files in e.g. web.*/*, though this might be
tricky in the case of merges, and must be checked carefully to make sure it works for renames and deletes too.)

Now everyone subscribed to (say) cvs@nbbuild will see exactly what changed in nbbuild/* with each push, regardless of
how that was distributed across different changesets.
Comment 1 Jesse Glick 2008-07-11 21:25:48 UTC
We might also want to include the output of '| diffstat -p1' in the header of the message to give you a quick feel for
what was changed and by how much.
Comment 2 Jesse Glick 2009-08-31 16:49:02 UTC
Any progress? Can I help?

#2 and #7 have since been fixed and we have diffstats. #5 is hacked up with an overly complex and inflexible set of
.hgmail-* files. #1, #3, #4, and #6 are still valid.

See also: http://kenai.com/jira/browse/KENAI-1093
Comment 3 Jesse Glick 2011-06-02 14:06:21 UTC
(In reply to comment #0)
> My proposal:

Talked about this subject with Petr in person a few weeks ago.

> might be
> tricky in the case of merges, and must be checked carefully to make sure it
> works for renames and deletes too.

And file copies, and file mode changes.