From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manos Pitsidianakis Subject: [PATCH v3] log: forbid log --graph --no-walk Date: Sun, 15 Mar 2015 02:43:14 +0200 Message-ID: <5504D5A2.2070405@norn.io> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: me@ikke.info, sandals@crustytoothpaste.net, gitster@pobox.com, peff@peff.net To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Mar 15 01:42:04 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 1YWwcz-00029c-P4 for gcvg-git-2@plane.gmane.org; Sun, 15 Mar 2015 01:42:02 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbbCOAl5 (ORCPT ); Sat, 14 Mar 2015 20:41:57 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:58360 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbbCOAl4 (ORCPT ); Sat, 14 Mar 2015 20:41:56 -0400 Received: from mfilter12-d.gandi.net (mfilter12-d.gandi.net [217.70.178.129]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 8131E172077; Sun, 15 Mar 2015 01:41:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter12-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter12-d.gandi.net (mfilter12-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id SWTle43ISiwx; Sun, 15 Mar 2015 01:41:54 +0100 (CET) X-Originating-IP: 5.54.110.208 Received: from [192.168.2.2] (ppp005054110208.access.hol.gr [5.54.110.208]) (Authenticated sender: epilys@norn.io) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id F26C1172074; Sun, 15 Mar 2015 01:41:52 +0100 (CET) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: X-Forwarded-Message-Id: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: In git-log, --graph shows a graphical representation of a continuous commit history, and --no-walk shows discrete specified commits without continuity. Using both doesn't make sense, so we forbid the combined use of these flags. Signed-off-by: Manos Pitsidianakis --- This is a microproject intended to complement my GSoC application. builtin/log.c | 2 ++ t/t4202-log.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/builtin/log.c b/builtin/log.c index dd8f3fc..5aaf964 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, memset(&w, 0, sizeof(w)); userformat_find_requirements(NULL, &w); + if (rev->graph && rev->no_walk) + die("--graph and --no-walk are incompatible"); if (!rev->show_notes_given && (!rev->pretty_given || w.notes)) rev->show_notes = 1; if (rev->show_notes) diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 5f2b290..5d72713 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' ' grep "^| | gpg: Good signature" actual ' +test_expect_success 'forbid log --graph --no-walk' ' + test_must_fail git log --graph --no-walk +' + test_done -- 2.1.4