From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabian Ruch Subject: [PATCH RFC v2 01/19] rebase -i: Failed reword prints redundant error message Date: Wed, 2 Jul 2014 19:47:53 +0200 Message-ID: <10d7fae199e4d8adec537aa377177de652badc07.1404323078.git.bafain@gmail.com> References: <53A258D2.7080806@gmail.com> Cc: Michael Haggerty , Thomas Rast , Jeff King To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Jul 02 19:49:42 2014 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 1X2Of0-0006LP-V4 for gcvg-git-2@plane.gmane.org; Wed, 02 Jul 2014 19:49:35 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932146AbaGBRta (ORCPT ); Wed, 2 Jul 2014 13:49:30 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:63395 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756492AbaGBRt3 (ORCPT ); Wed, 2 Jul 2014 13:49:29 -0400 Received: by mail-wi0-f175.google.com with SMTP id r20so10037148wiv.14 for ; Wed, 02 Jul 2014 10:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ip9f8rGfzHQeaUhrvpUlPnES9z8hLcEzKWy9SX/YkyQ=; b=r4dkr0JR/VKiGgBUhkujz2sKadT6q7biwz2Rg9B95wLTzeX6GASEeZlk0CFlfc+fZg uH7aIKkXFBFB3iMtK1slDvWLwSDuFvwiJOU5mQGbD3zTrxDkF5sJCmfRFLuNjQS7x6Hl fVObaJQL0xK8V2D8QCX2z3HXXV8rXUiVq0HN0VNZ5wEiwNSo93iaUrPOud3ircpXZNuD v+xrc4Y+FuiJUGYBNw9xgurah0L6qUm4w8t2MWalmB+YWXiIg+8s8WYsHrgnszS2NZe8 cdnM7uCeJ5WDKY/2UajDykAPhPz9Z3eL0bBBV/zbGclL40FvVG36k05XcX4kii7ynXb6 Co/g== X-Received: by 10.194.82.198 with SMTP id k6mr9485406wjy.10.1404323368044; Wed, 02 Jul 2014 10:49:28 -0700 (PDT) Received: from puffy.de (nat-wh-nan.rz.uni-karlsruhe.de. [141.70.81.135]) by mx.google.com with ESMTPSA id eo4sm57503504wid.4.2014.07.02.10.49.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jul 2014 10:49:27 -0700 (PDT) X-Mailer: git-send-email 2.0.0 In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The to-do list command `reword` replays a commit like `pick` but lets the user also edit the commit's log message. If the edited log message is empty or is found ill-formatted by one of the commit hooks, git-rebase--interactive prints three error messages to the console. 1. The git-commit output, which contains all the output from hook scripts. 2. A rebase diagnosis saying at which task on the to-do list it got stuck. 3. Generic presumptions about what could have triggered the error. The third message contains redundant information and does not add any enlightenment either, which makes the output unnecessarily longish and different from the other command's output. For instance, this is what the output looks like if the log message is empty (contains duplicate Signed-off-by lines). (1.) Aborting commit due to empty commit message. (Duplicate Signed-off-by lines.) (2.) Could not amend commit after successfully picking fa1afe1... Some change (3.) This is most likely due to an empty commit message, or the pre-commit hook failed. If the pre-commit hook failed, you may need to resolve the issue before you are able to reword the commit. Discard the third message. It is true that a failed hook script might not output any diagnosis but then the generic message is not of much help either. Since this lack of information affects the built-in git commands for commit, merge and cherry-pick first, the solution would be to keep track of the failed hooks in their output so that the user knows which of her hooks require improvement. Signed-off-by: Fabian Ruch --- git-rebase--interactive.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 7e1eda0..e733d7f 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -506,9 +506,6 @@ do_next () { do_pick $sha1 "$rest" git commit --amend --no-post-rewrite ${gpg_sign_opt:+"$gpg_sign_opt"} || { warn "Could not amend commit after successfully picking $sha1... $rest" - warn "This is most likely due to an empty commit message, or the pre-commit hook" - warn "failed. If the pre-commit hook failed, you may need to resolve the issue before" - warn "you are able to reword the commit." exit_with_patch $sha1 1 } record_in_rewritten $sha1 -- 2.0.0