From patchwork Thu Feb 4 23:29:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12068943 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 2487FC433E6 for ; Thu, 4 Feb 2021 23:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D428E64FB0 for ; Thu, 4 Feb 2021 23:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbhBDXap (ORCPT ); Thu, 4 Feb 2021 18:30:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbhBDXag (ORCPT ); Thu, 4 Feb 2021 18:30:36 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95342C061786 for ; Thu, 4 Feb 2021 15:29:56 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id a16so6851836wmm.0 for ; Thu, 04 Feb 2021 15:29:56 -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=ZbY7nmQBW+g+yP5O+EFSE62eLwclSdvSIEVGAzBqATR11p5YP9xD4T+Tly/1VdEOtX u6N7JqWgZeRr3GNHuMCBTddqFo7yCk6wyFBWbN1aqT583ejNpbuuEqi7s9D3+JX/DSNx vSbWgX2v/+WDtEBMAwec6rJheisxB+e6DcNRU/mLYAuQZTbRGhQMZov2kic+I40lmzI2 sGHU0mPe1PXqRJN/NGAhq++7TR6tSaDxFooSz5pqkfAe4p7lFUiZKCVC85JYWvGthJLu Ifc54nvln5U3c5YuBLl1cLl30uo+0Hn0UGbT2n7QgEm2tfP1e+tLY7QpmHR0e9WuKBx4 4S2g== 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=by2Z2dZa/A5T8m9j8AhR+gTOBeZyHiTW4lI2gNkro0EfSDakttnl9yuXeMTYxMNe1d e/fik5LauWBONtpQS/THcdwnrjMFN8CsjTvaIBEQlcGAJEMeZhyl759R8YgGUatVJhpL 8tGBOxeajWStSnJ/y0NocFkRNnxwCZkq/HOju9qAFS084w3bow11FHUe+9UMQ+K6191w gLvxtZUAW3T3cAvCHU0iVYjlhyj67n7k1MsidYvZuCCMNYhvuKbgQ12UxlDzBeDa9+bn fTYehonoNmr4MkHA5tH7seIlURVzKHZFZ5pshYXiUDMlaFNFVRLHwbh8fF3Qxo0aIa2z bKWA== X-Gm-Message-State: AOAM532GOC4/tWzy6yPWoMcESF/GDnBz+dZeWBeCdomgDDQLhcJfD+IY FuDGoYT4B+Ip8kN88/IHSK/rPhz3Khw= X-Google-Smtp-Source: ABdhPJyzHmUZJRH9ktJ8/wA7XxSrYMtVznBLNhBKLlInnMwOm9h1ucvBxkx7jbQuQLIyqla4nxcLGA== X-Received: by 2002:a7b:c153:: with SMTP id z19mr1159320wmi.87.1612481395101; Thu, 04 Feb 2021 15:29:55 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w25sm7642670wmc.42.2021.02.04.15.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 15:29:54 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 04 Feb 2021 23:29:50 +0000 Subject: [PATCH v5 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 Thu Feb 4 23:29:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12068945 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 49F74C433DB for ; Thu, 4 Feb 2021 23:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F257664FB2 for ; Thu, 4 Feb 2021 23:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbhBDXa7 (ORCPT ); Thu, 4 Feb 2021 18:30:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbhBDXah (ORCPT ); Thu, 4 Feb 2021 18:30:37 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88CABC06178A for ; Thu, 4 Feb 2021 15:29:57 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id l12so5605336wry.2 for ; Thu, 04 Feb 2021 15:29:57 -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=dd583uWriwG49bIbEUTDscn44jngw72AKmY37eTAGRw=; b=GuIHYwEE4tENl2RBSdu/EmyU3p59EbUYZyLOw8pJYGYF46a3SmgF7zh6p3WmbpG7Zv 7mSinwhvlNBI3CXr1xxORMb41Ew2w+WMNVFtbA4PoLErzrHIjBnHnnH+VFFwUSoNOytW nuDc5IPMalbF/0RPMsL+i+aoZTdegFbh7SBgDzZWx1LmmdtZaMHv/43/ACw5Lee/28Tw pKfJYBmYEjuRq6dJSCr0YVR9VAnHt3AN0F2Fpc+qEvTUQq/3pHoaZREuhg/Q5xMMW/2C 0njry9DbK6RhNsA7o3vN7U2hBQzhlTGUsFmbvB4VtpvmLY8xnw3++x+Ie9c2xu1sC9+4 RvDg== 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=dd583uWriwG49bIbEUTDscn44jngw72AKmY37eTAGRw=; b=o68TIzWFHYoGd1m1s/TAFeQ/K5saFgmDKO43nE1uOijcpi8fsibB3HS7wv0n8acCj8 9LPWNlLp4XfaV9pgosyyjsgA7V2/U1GWn2ZmPvtdiexE/+LxiwaA7CteMWik48i5Hb2c Fn14pBzuWnPRlpqPBsrjWFXHckaXxIZA4mZljVj/4OgBf1tBiRjWi0Zk9iHz8HNdXwz9 zlP3T05CP613II+GZzQKbGmyhGLOmNB7uBL+LSRpewiLc6NzQk5VdWQA/3/sUAw2t/eU nAUYooE2qySVzQBVbx+OR7jvZzbJICJyQbNENnBTS8dqWEyFelPMAHl1h3VXE18XfroT ffRg== X-Gm-Message-State: AOAM531yHzDc30eKDi+ffaV2LTeyD+LNAHYuWGLpepcIMOPs5XYNFy32 R9L71ogvw8Ja/jVNQ9u9DMPV+wP2kxA= X-Google-Smtp-Source: ABdhPJwzA6SrbUx6scv0xiYyyOkxTC1OpqQEVBdmnquLFqVc4QZB8nji4tadIa9FoFLt6H+9/ZPu8Q== X-Received: by 2002:a5d:6311:: with SMTP id i17mr1727617wru.195.1612481396095; Thu, 04 Feb 2021 15:29:56 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l2sm7512556wmf.15.2021.02.04.15.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 15:29:55 -0800 (PST) Message-Id: <04b5d75adbc3d80e9f9cf9cd380294949e7c68e8.1612481392.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 04 Feb 2021 23:29:51 +0000 Subject: [PATCH v5 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 | 24 +++++++++++++++++++++++- range-diff.h | 4 +--- t/t3206-range-diff.sh | 13 +++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/range-diff.c b/range-diff.c index 9b93e08e8407..c307bca9de23 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,26 @@ 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, 0) == 1) + for (i = 0; i < revs.pending.nr; i++) { + struct object *obj = revs.pending.objects[i].item; + + if (obj->flags & UNINTERESTING) + negative++; + else + positive++; + 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..45f21ee215d7 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 rang" error +' + test_expect_success 'trivial reordering' ' git range-diff --no-color master topic reordered >actual && cat >expect <<-EOF && From patchwork Thu Feb 4 23:29:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12068941 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 E1102C433E0 for ; Thu, 4 Feb 2021 23:30:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC66C64FB0 for ; Thu, 4 Feb 2021 23:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhBDXaU (ORCPT ); Thu, 4 Feb 2021 18:30:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbhBDXaO (ORCPT ); Thu, 4 Feb 2021 18:30:14 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBFB4C06178B for ; Thu, 4 Feb 2021 15:29:58 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id o10so6840500wmc.1 for ; Thu, 04 Feb 2021 15:29:58 -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=e4hHf/n4vQZ8MHS5nLS/FU8EId7XN1M6rDJDXBP4em6j/Yn4IOrQWgD1/z4xIP4g1B hFj1s8kyFDVXHL7eg4w5ypAELc9JOUjGaAdAWepKFeLV5qOQ3/JJek+swnYGbG9s6998 xlAmbTSxIF1ZrPm13NNwjtZiLDddYYbnFo7jHd6k+Gv1X4N2LZxJ6qn7sJOebYibiSuN MzkwcXtEdvo8fzaK6MJDWacVYML1110FRhPu4X9c4XEx8eQFkV1RRer1U0jlurj47l7e w7MwFJC0WRE8UAPDtEPjBfVw1OrzqBn2EuvT7Xr5OE9D1xOwL+8PMnw1gweal3Gp9uXt W+MA== 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=bxl2BBC6WHLPizg1yvMc91CymsongnTBax/sLLwZgFqe6s6t1+4xyYubqbsHgc/cuA k+Y1CMJIc8I30M2pakujO61X3c8KbGtQzcm23ib8x21B9JnI8BmqqiOFENlQgWHu6hOg rWbh4Fa071voVsEu0hPvEAHB5N8LOuTXVzUbA8/0+RIUnoy/aSY8ujL7H2s1caR+lCBI 5HQDVW91+YcOS76nNV2mqzlCG2kdoX/a9DOA1IO4aagUrFbYCk8pZn6zGhFERmI0AUFl VhlhPiT+qZ5wfIrwhPlFBPSBuLTQ2hJz9CUYlnmsNlseoAHvzq/ND879Lbv/58rOIOLO rHVQ== X-Gm-Message-State: AOAM531bFGC9CzKzYBXEnMO/NPljKReOizydaNXLPoerA9Y9eZd6qaZn cEIAFIjX5tVQcVCySsajxnKyBK++2r4= X-Google-Smtp-Source: ABdhPJyvcE3iUA8CGfgOSOr8G1NOZTc45QwQHbSCcw71SKnoznMROfiZmW2cR6T02+mEXjYqDMwCCg== X-Received: by 2002:a05:600c:3588:: with SMTP id p8mr1139285wmq.71.1612481397459; Thu, 04 Feb 2021 15:29:57 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a27sm9613608wrc.94.2021.02.04.15.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 15:29:56 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 04 Feb 2021 23:29:52 +0000 Subject: [PATCH v5 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 -------