From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: [PATCH v2 09/18] fsck: Handle multiple authors in commits specially Date: Mon, 19 Jan 2015 16:51:01 +0100 Organization: gmx Message-ID: <065ce6d5053d3aca7860ea88c1a1742bd9c656bd.1421682369.git.johannes.schindelin@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org To: gitster@pobox.com X-From: git-owner@vger.kernel.org Mon Jan 19 16:59:47 2015 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 1YDEjt-0006J3-LZ for gcvg-git-2@plane.gmane.org; Mon, 19 Jan 2015 16:59:42 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbbASP7a (ORCPT ); Mon, 19 Jan 2015 10:59:30 -0500 Received: from s15462909.onlinehome-server.info ([87.106.4.80]:35068 "EHLO s15462909.onlinehome-server.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbbASP73 (ORCPT ); Mon, 19 Jan 2015 10:59:29 -0500 X-Greylist: delayed 563 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Jan 2015 10:59:22 EST Received: from s15462909.onlinehome-server.info (localhost.localdomain [127.0.0.1]) by s15462909.onlinehome-server.info (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t0JFp14I026351; Mon, 19 Jan 2015 16:51:01 +0100 Received: (from www-data@localhost) by s15462909.onlinehome-server.info (8.14.4/8.14.4/Submit) id t0JFp1nW026350; Mon, 19 Jan 2015 16:51:01 +0100 X-Authentication-Warning: s15462909.onlinehome-server.info: www-data set sender to johannes.schindelin@gmx.de using -f X-PHP-Originating-Script: 1000:rcube.php In-Reply-To: X-Sender: johannes.schindelin@gmx.de User-Agent: Roundcube Webmail/1.1-git Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: This problem has been detected in the wild, and is the primary reason to introduce an option to demote certain fsck errors to warnings. Let's offer to ignore this particular problem specifically. Technically, we could handle such repositories by setting receive.fsck.warn = missing-committer, but that could hide missing tree objects in the same commit because we cannot continue verifying any commit object after encountering a missing committer line, while we can continue in the case of multiple author lines. Signed-off-by: Johannes Schindelin --- fsck.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fsck.c b/fsck.c index a3b1429..ed0a669 100644 --- a/fsck.c +++ b/fsck.c @@ -38,6 +38,7 @@ FUNC(MISSING_TREE, ERROR) \ FUNC(MISSING_TYPE, ERROR) \ FUNC(MISSING_TYPE_ENTRY, ERROR) \ + FUNC(MULTIPLE_AUTHORS, ERROR) \ FUNC(NOT_SORTED, ERROR) \ FUNC(NUL_IN_HEADER, ERROR) \ FUNC(TAG_OBJECT_NOT_TAG, ERROR) \ @@ -545,6 +546,14 @@ static int fsck_commit_buffer(struct commit *commit, const char *buffer, err = fsck_ident(&buffer, &commit->object, options); if (err) return err; + while (skip_prefix(buffer, "author ", &buffer)) { + err = report(options, &commit->object, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines"); + if (err) + return err; + err = fsck_ident(&buffer, &commit->object, options); + if (err) + return err; + } if (!skip_prefix(buffer, "committer ", &buffer)) return report(options, &commit->object, FSCK_MSG_MISSING_COMMITTER, "invalid format - expected 'committer' line"); err = fsck_ident(&buffer, &commit->object, options); -- 2.0.0.rc3.9669.g840d1f9