From patchwork Fri Feb 5 14:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12071137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EADEC433E9 for ; Fri, 5 Feb 2021 22:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3905564FF2 for ; Fri, 5 Feb 2021 22:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232512AbhBEWaB (ORCPT ); Fri, 5 Feb 2021 17:30:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbhBEOTR (ORCPT ); Fri, 5 Feb 2021 09:19:17 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 180FCC061223 for ; Fri, 5 Feb 2021 07:47:24 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id w2so12550932ejk.13 for ; Fri, 05 Feb 2021 07:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=lWl5oMZywpdSWlIVHWwdXwp1SyJVtsfWXZNH7AT7K4Y=; b=sMtPz1UHOAsvyiYxjsmDQ7kFQMqCdz4Euj9eCzs4837U/+4EAmaaSUolBTtaPA+W9l a1M0pi0ZY54dUF0FmnaNTytCQO34NAfYJFONIZnRV/+sEWTjQmDbgW2FA4Bq9hR6Y9Jj pE3lMkaSnSfxi8epGXUQKZPwa+NVU0BQ6FLI3FizxQ63kevXST9MeNwM66FyFXLK3n5T umv+7+MYYxb1+hwMM1o/eAl3wSbA3gL8SIJ6wv+/zxMb9CWniF9PYfL4UjzgV/jlYeo7 IgVIQVQilIhLq211OP+Qd+3GPFJm1fYivxbM4aH4XcY42sdTeT4WevlzhjQvI3GBolMO 81ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=lWl5oMZywpdSWlIVHWwdXwp1SyJVtsfWXZNH7AT7K4Y=; b=NSyumdbQOXfQNQ30BhC+rWvSIvapSstXAqg7pne91eInZ4ljhlR6/50xCwiGh4UqhC mFgq34V3T7lBd/FVhq06A9FxYAYEWtiQ2ax+xIg8zvqdiYuaPOHlIiweXBX50zmKVhQn dU2fi+ORNtGHFlUYovT2Iow+u9a5DSrX3Be46f0zmD1FfiGat1AEqQmlDOyK2cH51Ta0 zXemV0v+n1srsLbb8YFJmrFqMtOG/qRzvuNEerHrpNNrYlMSasjT5e8J4Yb7axizzwAT 8K/24uo4zEOkDQYmMofAZgPinAglCFAVJSJVbqG2B5rOrhIKHMUZBH2Sfl0gvFhxZS36 MEZQ== X-Gm-Message-State: AOAM533hAd5lb+jUeESQXll69dQPD3MkVwcR4e1p0+gP8AQeW23c7cE4 XlAL2JyeLg+YzwltVCUUVBxqU9wNjl8= X-Google-Smtp-Source: ABdhPJwu8F7QTRqQS9veNxq9fog4hYsQgKaKAHOHkCIGNLI84PoLF43xe8fAz5tEIkMheOPZeNQRLw== X-Received: by 2002:a5d:4203:: with SMTP id n3mr5376681wrq.49.1612536292475; Fri, 05 Feb 2021 06:44:52 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s4sm11792751wrt.85.2021.02.05.06.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 06:44:51 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 05 Feb 2021 14:44:47 +0000 Subject: [PATCH v6 1/3] range-diff/format-patch: refactor check for commit range Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin Currently, when called with exactly two arguments, `git range-diff` tests for a literal `..` in each of the two. Likewise, the argument provided via `--range-diff` to `git format-patch` is checked in the same manner. However, `^!` is a perfectly valid commit range, equivalent to `^..` according to the `SPECIFYING RANGES` section of gitrevisions[7]. In preparation for allowing more sophisticated ways to specify commit ranges, let's refactor the check into its own function. Signed-off-by: Johannes Schindelin --- builtin/log.c | 2 +- builtin/range-diff.c | 9 +++++---- range-diff.c | 5 +++++ range-diff.h | 8 ++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index bd6ff4f9f956..aeece57e86a2 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1680,7 +1680,7 @@ static void infer_range_diff_ranges(struct strbuf *r1, struct commit *head) { const char *head_oid = oid_to_hex(&head->object.oid); - int prev_is_range = !!strstr(prev, ".."); + int prev_is_range = is_range_diff_range(prev); if (prev_is_range) strbuf_addstr(r1, prev); diff --git a/builtin/range-diff.c b/builtin/range-diff.c index 24c4162f7446..5b1f6326322f 100644 --- a/builtin/range-diff.c +++ b/builtin/range-diff.c @@ -3,6 +3,7 @@ #include "parse-options.h" #include "range-diff.h" #include "config.h" +#include "revision.h" static const char * const builtin_range_diff_usage[] = { N_("git range-diff [] .. .."), @@ -46,12 +47,12 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix) diffopt.use_color = 1; if (argc == 2) { - if (!strstr(argv[0], "..")) - die(_("no .. in range: '%s'"), argv[0]); + if (!is_range_diff_range(argv[0])) + die(_("not a commit range: '%s'"), argv[0]); strbuf_addstr(&range1, argv[0]); - if (!strstr(argv[1], "..")) - die(_("no .. in range: '%s'"), argv[1]); + if (!is_range_diff_range(argv[1])) + die(_("not a commit range: '%s'"), argv[1]); strbuf_addstr(&range2, argv[1]); } else if (argc == 3) { strbuf_addf(&range1, "%s..%s", argv[0], argv[1]); diff --git a/range-diff.c b/range-diff.c index b9950f10c8c4..9b93e08e8407 100644 --- a/range-diff.c +++ b/range-diff.c @@ -564,3 +564,8 @@ int show_range_diff(const char *range1, const char *range2, return res; } + +int is_range_diff_range(const char *arg) +{ + return !!strstr(arg, ".."); +} diff --git a/range-diff.h b/range-diff.h index 583ced2e8e74..c17dbc2e75a8 100644 --- a/range-diff.h +++ b/range-diff.h @@ -16,4 +16,12 @@ int show_range_diff(const char *range1, const char *range2, const struct diff_options *diffopt, const struct strvec *other_arg); +/* + * Determine whether the given argument is usable as a range argument of `git + * range-diff`, e.g. A..B. Note that this only validates the format but does + * _not_ parse it, i.e. it does _not_ look up the specified commits in the + * local repository. + */ +int is_range_diff_range(const char *arg); + #endif From patchwork Fri Feb 5 14:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12070419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B3CBC433DB for ; Fri, 5 Feb 2021 16:35:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4471564EA1 for ; Fri, 5 Feb 2021 16:35:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232902AbhBEOzu (ORCPT ); Fri, 5 Feb 2021 09:55:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbhBEOw7 (ORCPT ); Fri, 5 Feb 2021 09:52:59 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D0FC06121C for ; Fri, 5 Feb 2021 08:31:04 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id hs11so12915024ejc.1 for ; Fri, 05 Feb 2021 08:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=4vOvP8GvypLyqwVS8j8edlPeLJbqOe1KQrGSvUN46RE=; b=ab6E/089WRPOyiy2HegvLSN7mrjK77w133hgcc6Vc5DAVLGUoU/r3ZYufa2/axRtW2 YvZm051ZYY6QGfvnfbAGj1tFiC5/oUejPdPmrmU/yOuWdfCF06uhrS6ist2vHagsKQJI qPnKee0OnZJqtCPYyuosr58Ehw39d0b6KA5WqkMIjEnUisrzvreyr0v75g1ieDRMfcSw uY7YcT5ZAh1hS7O8TMGKOjDDvIWvI8gAoR6e0ThwafzFd4QJxH3/Fg5YMuC9sgE2wlC0 Mpnmz37DTuQnZbUtl24du+URNHejyBP+t2U2jv86ohxkzHl7TCqUjnHj5CcPb/FnubFz bstA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=4vOvP8GvypLyqwVS8j8edlPeLJbqOe1KQrGSvUN46RE=; b=Yt3WBuFcPMQjH5Yj00V3hKzzsaT3K/V0RQ8Ezehqdo1jgisGfbjTXFwRqNJKs1nDTl ijDMbdaqoyqE6/xqYzzGDp1Eb+sHNVohmaOxg+4xxyUUB/9GNvgr5bh0w/1s0qRR6ESG suB9TZJubwHFMBni5Sg3fsziywgc7V89BfFko+6XTsTRT8wDy+eW1pNnoVN9+njJ0Aaf OYOo16dn3TvF5MBxb/oQYa0TojtoNDjqAJX74U9RiINpNxCElZBgH19GWqRVTlhNhJDv m7skjffMGL6a0zcX2MAZs+NDL+7riHFaJ3LJVSAsfqDi41eziDO9fuJMhk3jey5aqh+V bYmQ== X-Gm-Message-State: AOAM532/GxwBlnhFehSOVW2x55vfLqD15BNuFS8lg7WlqJvgaWqsIGLk fl6rk3KPogXJR/WBkGSGpeLC2JuYqpw= X-Google-Smtp-Source: ABdhPJwu95+DZ1AfnKNYNpoT4AsWdlksigU86nem0L2nwb0AedxEIs6kv6twzI164Ci3+LvyR0A8Jg== X-Received: by 2002:adf:d206:: with SMTP id j6mr5304297wrh.427.1612536293566; Fri, 05 Feb 2021 06:44:53 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c20sm8757126wmb.38.2021.02.05.06.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 06:44:52 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 05 Feb 2021 14:44:48 +0000 Subject: [PATCH v6 2/3] range-diff/format-patch: handle commit ranges other than A..B Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In the `SPECIFYING RANGES` section of gitrevisions[7], two ways are described to specify commit ranges that `range-diff` does not yet accept: "^!" and "^-". Let's accept them, by parsing them via the revision machinery and looking for at least one interesting and one uninteresting revision in the resulting `pending` array. This also finally lets us reject arguments that _do_ contain `..` but are not actually ranges, e.g. `HEAD^{/do.. match this}`. Signed-off-by: Johannes Schindelin --- range-diff.c | 26 +++++++++++++++++++++++++- range-diff.h | 4 +--- t/t3206-range-diff.sh | 13 +++++++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/range-diff.c b/range-diff.c index 9b93e08e8407..a88612cb8923 100644 --- a/range-diff.c +++ b/range-diff.c @@ -11,6 +11,7 @@ #include "pretty.h" #include "userdiff.h" #include "apply.h" +#include "revision.h" struct patch_util { /* For the search for an exact match */ @@ -567,5 +568,28 @@ int show_range_diff(const char *range1, const char *range2, int is_range_diff_range(const char *arg) { - return !!strstr(arg, ".."); + char *copy = xstrdup(arg); /* setup_revisions() modifies it */ + const char *argv[] = { "", copy, "--", NULL }; + int i, positive = 0, negative = 0; + struct rev_info revs; + + init_revisions(&revs, NULL); + if (setup_revisions(3, argv, &revs, NULL) == 1) { + for (i = 0; i < revs.pending.nr; i++) + if (revs.pending.objects[i].item->flags & UNINTERESTING) + negative++; + else + positive++; + for (i = 0; i < revs.pending.nr; i++) { + struct object *obj = revs.pending.objects[i].item; + + if (obj->type == OBJ_COMMIT) + clear_commit_marks((struct commit *)obj, + ALL_REV_FLAGS); + } + } + + free(copy); + object_array_clear(&revs.pending); + return negative > 0 && positive > 0; } diff --git a/range-diff.h b/range-diff.h index c17dbc2e75a8..4abd70c40fed 100644 --- a/range-diff.h +++ b/range-diff.h @@ -18,9 +18,7 @@ int show_range_diff(const char *range1, const char *range2, /* * Determine whether the given argument is usable as a range argument of `git - * range-diff`, e.g. A..B. Note that this only validates the format but does - * _not_ parse it, i.e. it does _not_ look up the specified commits in the - * local repository. + * range-diff`, e.g. A..B. */ int is_range_diff_range(const char *arg); diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index 6eb344be0312..2b518378d4a0 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -150,6 +150,19 @@ test_expect_success 'simple A B C (unmodified)' ' test_cmp expect actual ' +test_expect_success 'A^! and A^- (unmodified)' ' + git range-diff --no-color topic^! unmodified^-1 >actual && + cat >expect <<-EOF && + 1: $(test_oid t4) = 1: $(test_oid u4) s/12/B/ + EOF + test_cmp expect actual +' + +test_expect_success 'A^{/..} is not mistaken for a range' ' + test_must_fail git range-diff topic^.. topic^{/..} 2>error && + test_i18ngrep "not a commit range" error +' + test_expect_success 'trivial reordering' ' git range-diff --no-color master topic reordered >actual && cat >expect <<-EOF && From patchwork Fri Feb 5 14:44:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12070877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 130D7C433E9 for ; Fri, 5 Feb 2021 20:42:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C192764FBB for ; Fri, 5 Feb 2021 20:42:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233143AbhBES7a (ORCPT ); Fri, 5 Feb 2021 13:59:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232938AbhBEPCl (ORCPT ); Fri, 5 Feb 2021 10:02:41 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 028CBC0611C0 for ; Fri, 5 Feb 2021 08:29:16 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id j11so6490320wmi.3 for ; Fri, 05 Feb 2021 08:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=q7cKnUpUO/gDwwMLsD/crPwNAKcy0rWwvfrJg8VmXY8=; b=XQe/QQCCF1c6lWTmQyif2qc9/SnQNqieQVea/zxbMcy/4rH0LNELNz39olP/4UIygU zzEf2/izuQSTbJuS0clQ9R4t7q1DUCQdGDv0GeHiZO5tyROqHnpKIQQCesXdZiMyyPCR YAzmKRqGlnZvCE9NEjzHGp0s2W4b9cAFNYVZkS9QxNOouRp2l2ZcmOpDAKomzuokorkB tzMlxhnmfHgRy7HlbOj9Js7wufW2sb6l4embloBaWMRtDoS0klQ+TSLzd4qODCEj+vXI H4EhsW644COxvzTy3FMEcC13DJSGdM4/QRe3oY9H5H4nKeDqvBDKlBQScRfElziCZO+Z VyTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=q7cKnUpUO/gDwwMLsD/crPwNAKcy0rWwvfrJg8VmXY8=; b=Jz73DTVSz/Op3nt6J7KBj6eELPDAiSgNipp1zoE8GfecVDNthfFLbTZWVX3egTPsFH jjdbnYBWauuOg9YDieOog+0/ILdFx8H0hfTwt697aP6RUrhTJoZ4J9kwhQz7g+M1HK3a rZiWpDUUgnk6O/o38ahd/mWwqC0VsPsTutehuC4WpvvDE8xs17PwL9KPbhxFhRAVm1w5 WXG4H4HjXWPOzA0CPzvU/H4XdWV0P9cYsgJzbdE0gn3VPkIsJN+vdROxlHTnefPDPARx cck6Unx9yq6gOvHeuqisIqz0PFLVFlGeRTlinLl4hm4d2oBPJzaNRqwOkXKVwd7PVyG5 0TEQ== X-Gm-Message-State: AOAM533EbIzsIdd1Jv/YAJsBDJuQSIl7yo7CcmczaaFoZEm90Y2kTSgk tXO8d+/TY8cHGlm0NRmts+VQIBDQkN0= X-Google-Smtp-Source: ABdhPJx2v8w8SX0P1xy7ZpY+c5tAdW7EgQcJAx1Xn6ZbMSomg18nmUK3bclWjIqR3u84MbCDspHu4w== X-Received: by 2002:a7b:cc95:: with SMTP id p21mr3958147wma.22.1612536294475; Fri, 05 Feb 2021 06:44:54 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a132sm9070797wmf.42.2021.02.05.06.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 06:44:53 -0800 (PST) Message-Id: <08c5f8732747de138c6a98322beca95e919ba11d.1612536290.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 05 Feb 2021 14:44:49 +0000 Subject: [PATCH v6 3/3] range-diff(docs): explain how to specify commit ranges Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin There are three forms, depending whether the user specifies one, two or three non-option arguments. We've never actually explained how this works in the manual, so let's explain it. Signed-off-by: Johannes Schindelin --- Documentation/git-range-diff.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt index 9701c1e5fdd5..a968d5237dae 100644 --- a/Documentation/git-range-diff.txt +++ b/Documentation/git-range-diff.txt @@ -28,6 +28,17 @@ Finally, the list of matching commits is shown in the order of the second commit range, with unmatched commits being inserted just after all of their ancestors have been shown. +There are three ways to specify the commit ranges: + +- ` `: Either commit range can be of the form + `..`, `^!` or `^-`. See `SPECIFYING RANGES` + in linkgit:gitrevisions[7] for more details. + +- `...`. This is equivalent to + `.. ..`. + +- ` `: This is equivalent to `.. + ..`. OPTIONS -------