From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Haggerty Subject: Bug: post-receive-email sometimes misses commits Date: Mon, 27 Feb 2012 21:39:37 +0100 Message-ID: <4F4BEA09.90600@alum.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Andy Parkins To: git discussion list X-From: git-owner@vger.kernel.org Mon Feb 27 21:39:56 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S27MR-0000D1-KD for gcvg-git-2@plane.gmane.org; Mon, 27 Feb 2012 21:39:55 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754605Ab2B0Ujv (ORCPT ); Mon, 27 Feb 2012 15:39:51 -0500 Received: from einhorn.in-berlin.de ([192.109.42.8]:35607 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754343Ab2B0Uju (ORCPT ); Mon, 27 Feb 2012 15:39:50 -0500 X-Envelope-From: mhagger@alum.mit.edu Received: from [192.168.100.152] (ssh.berlin.jpk.com [212.222.128.135]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id q1RKdcW7029034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 27 Feb 2012 21:39:48 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: In the following scenario, suppose that commit X is already in the repository (referenced by master), and I push references A and B at the same time: -- master / o---X---*'--*'--* A \ *---* B The commits marked with "*" are new to the repository, and therefore the emails generated by post-receive-email should summarize all five of them. But in fact the commits marked with a prime (i.e., A^ and A^^) are NOT included in any email. The problem is that post-receive-email operates on one reference update at a time, *after* the references have been updated. It generates the "new" commits for A using the equivalent of git rev-list ^master ^B A and it generates the "new" commits for B using the equivalent of git rev-list ^master ^B A Neither of these ranges includes the commits common to branches A and B and therefore those commits do not appear in any of the email notifications. I first observed this problem in a slightly more complicated scenario where a bugfix branch was merged to two release branches, then the two release branches (but not the bugfix reference) were pushed: o---o-------* release-A / / o---o---o---*'--*'--*' bugfix \ \ o---o-------* release-B In this case only the merge commits were included in the commit emails; the bugfixes commits themselves were never mentioned. It seems like this problem can only be fixed by having post-receive-email process all of the reference updates at once so that the email generation for one reference update can take into account the other references that were updated at the same time. I don't plan to work on this problem; locally, we are using a Python script that was derived from post-receive-email and enhanced in several ways rather than using the Shell-script original. So when I have fixed our Python script my own itch will have been scratched. If there is interest in the Python email-notification script please let me know and there is a chance I might clean it up enough to be released. Michael -- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/