From patchwork Mon May 25 21:57:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Oakley X-Patchwork-Id: 11569505 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25E9A90 for ; Mon, 25 May 2020 21:58:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1797C20776 for ; Mon, 25 May 2020 21:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730062AbgEYV6D (ORCPT ); Mon, 25 May 2020 17:58:03 -0400 Received: from smtp-out-6.talktalk.net ([62.24.135.70]:64145 "EHLO smtp-out-6.talktalk.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727842AbgEYV6C (ORCPT ); Mon, 25 May 2020 17:58:02 -0400 Received: from localhost.localdomain ([89.243.191.101]) by smtp.talktalk.net with SMTP id dL6djC8oOIndsdL6ejhPZn; Mon, 25 May 2020 22:58:00 +0100 X-Originating-IP: [89.243.191.101] X-Spam: 0 X-OAuthority: v=2.3 cv=QYIYQfTv c=1 sm=1 tr=0 a=5KGm1Kp77X3djDixdaHiLg==:117 a=5KGm1Kp77X3djDixdaHiLg==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=ldyaYNNxDcoA:10 a=ZZnuYtJkoWoA:10 a=ZCRl24wqHeiA8RQ32E4A:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Philip Oakley To: git@vger.kernel.org Subject: [PATCH 2/4] blame: add option to show only blamed commits `--blame-only` Date: Mon, 25 May 2020 22:57:49 +0100 Message-Id: <20200525215751.1735-3-philipoakley@iee.email> X-Mailer: git-send-email 2.26.2.windows.1.13.g9dddff6983 In-Reply-To: <20200525215751.1735-1-philipoakley@iee.email> References: <20200525215751.1735-1-philipoakley@iee.email> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfIegZ2fgzUsizcTil/8DQ9rxdXgn30ulXqPed8sdVaX5AGlnLCLsAxoyfzuPPPTlx0QnZ+VfjWe06qkWsio26m2cwdRq1DFDY9hya0+lP8KkZP5uZlJY cYpzWw5KCkMFrT+6RxZhFdYX3Cv3+fQj0KgwR48YoedDizgTnUZhy6rbrMeqAJhVR6vKAdQDCEb9EA== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org For large files the will be many lines which are not blamed with the revision range or date period which clutter the output. Add an option to suppress the display of boundary commits lines, not just the object id (`-b` option). This is non-functional at this stage. The next commit will add functionality, tests, and documenation. Signed-off-by: Philip Oakley --- Documentation/blame-options.txt | 4 ++++ Documentation/git-blame.txt | 2 +- builtin/blame.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt index 5d122db6e9..b4b27033a6 100644 --- a/Documentation/blame-options.txt +++ b/Documentation/blame-options.txt @@ -2,6 +2,10 @@ Show blank SHA-1 for boundary commits. This can also be controlled via the `blame.blankboundary` config option. +--blame-only:: + Do not show any boundary commit lines created by revision range + specifiers. Only show blamed lines. + --root:: Do not treat root commits as boundaries. This can also be controlled via the `blame.showRoot` config option. diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt index 02f9ad6fe9..74b6344c7b 100644 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] - [-L ] [-S ] [-M] [-C] [-C] [-C] [--since=] + [-L ] [-S ] [-M] [-C] [-C] [-C] [--since=] [--blame-only] [--ignore-rev ] [--ignore-revs-file ] [--progress] [--abbrev=] [ | --contents | --reverse ..] [--] diff --git a/builtin/blame.c b/builtin/blame.c index bf1cecdf3f..b699c777c4 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -45,6 +45,7 @@ static int max_score_digits; static int show_root; static int reverse; static int blank_boundary; +static int blame_only; static int incremental; static int xdl_opts; static int abbrev = -1; @@ -843,6 +844,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix) const struct option options[] = { OPT_BOOL(0, "incremental", &incremental, N_("Show blame entries as we find them, incrementally")), OPT_BOOL('b', NULL, &blank_boundary, N_("Show blank SHA-1 for boundary commits (Default: off)")), + OPT_BOOL(0, "blame-only", &blame_only, N_("Only show blamed commits (Default: off)")), OPT_BOOL(0, "root", &show_root, N_("Do not treat root commits as boundaries (Default: off)")), OPT_BOOL(0, "show-stats", &show_stats, N_("Show work cost statistics")), OPT_BOOL(0, "progress", &show_progress, N_("Force progress reporting")),