From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id CBD301F5AE for ; Fri, 3 Jul 2020 03:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbgGCDif (ORCPT ); Thu, 2 Jul 2020 23:38:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbgGCDie (ORCPT ); Thu, 2 Jul 2020 23:38:34 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD25C08C5C1 for ; Thu, 2 Jul 2020 20:38:33 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id f2so3017535wrp.7 for ; Thu, 02 Jul 2020 20:38:33 -0700 (PDT) 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=t5s1ltNGMpcuEO6GcrOf5U161SBKg5LtyTbXOVytES0=; b=bCPbDErHaoosRwjDLGgXJiTUDFz0kdQeC90dF0UxPzjBgBwjDYnVnK9tzOz5xB5yur 2b3APtayirSixyXjuSJLg2ifdpcNIlaNfNWFtmbotyE9GrdFnktXHw/fAED3GerrFx7T xLSpfK+O9VYk3YU0c5QONNk814Ts2NGGkzJDmadS+gx5OCItkMXnQcR31N+/1y3Q3RMx kB2QfWJ9YYwjLV5cCTaO+ZUi/nmMquYC5PVCzaKPzoOIXGlsGAbUtXbioFlE3kSk3iXB lfOsRFkTxa0i1Yy/P7T3/ufd27D4gHFt3u40XYzxGbBWlTY+1Cc/NycdL9cTVZOlJ+Nw e3sw== 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=t5s1ltNGMpcuEO6GcrOf5U161SBKg5LtyTbXOVytES0=; b=ETT4rk/+SYgwy1+pV0XTVyHWY9hTUG2etokqekkk7pF5kI8YYicMgI2nJGXVCpd2QU pVb6VXl84c2BG8mTgbkIxYkcB7FE3VN9bR/inaqqEFy5Iikevx6eUvBq5UAzQe0EKq0E y/UhMlc39UGT2z2EyqK6ZQtxFP95htBm5ZIhFqkTlWhm2UqldaoH8gTQmymihNipGXid 4iPANE+dZfBgTZoLl99PT/9MpSJIbWOT93zjRaZx7Hz8KppIAC/kDMw7QYCe6WVb4BWd HQ1+PRaYOXu8EJAOT8iMp8rvsgtY09VWEbiId9kBJhxPZ5buwtzYn0K6CRkbiXaeEXaU LuCQ== X-Gm-Message-State: AOAM531KXn33fJYQfpVNPOiSRTze+/38mi+aDzZRsHtH7M5H7nv6WRdL z9ppFpA5Ekv7AvAbMjxxGLXY78nU X-Google-Smtp-Source: ABdhPJx9PfjRESg3IjcfEJ+jSZAsUynU4QkidYWiWN7AmXnaN5Ui3oMZJ1Fp0BpqB3g8aOc5TYmArQ== X-Received: by 2002:adf:9307:: with SMTP id 7mr33757630wro.414.1593747512513; Thu, 02 Jul 2020 20:38:32 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c25sm529490wml.18.2020.07.02.20.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 20:38:32 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Philippe Blain via GitGitGadget" Date: Fri, 03 Jul 2020 03:38:28 +0000 Subject: [PATCH v2 3/4] git-log.txt: include rev-list-description.txt Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: Lawrence Siebert , Denton Liu , Junio C Hamano , Taylor Blau , Philippe Blain , Philippe Blain Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain The `git log` synopsis mentions ``, and the description of this option links to gitrevisions(7), but a nice explanation of how a revision range can be constructed from individual commits, optionnally prefixed with `^`, also exists in `rev-list-description.txt`. Include this description in the man page for `git log`. Add Asciidoc 'ifdef's to `rev-list-description.txt` so that either `git rev-list` or `git log` appears in the respective man pages. Signed-off-by: Philippe Blain --- Documentation/git-log.txt | 3 +++ Documentation/git-rev-list.txt | 1 + Documentation/rev-list-description.txt | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt index 04ea18d1c0..d34d101255 100644 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -15,6 +15,9 @@ DESCRIPTION ----------- Shows the commit logs. +:git-log: 1 +include::rev-list-description.txt[] + The command takes options applicable to the linkgit:git-rev-list[1] command to control what is shown and how, and options applicable to the linkgit:git-diff[1] family of commands to control how the changes diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt index b06e11ae56..5da66232dc 100644 --- a/Documentation/git-rev-list.txt +++ b/Documentation/git-rev-list.txt @@ -14,6 +14,7 @@ SYNOPSIS DESCRIPTION ----------- +:git-rev-list: 1 include::rev-list-description.txt[] 'rev-list' is a very essential Git command, since it diff --git a/Documentation/rev-list-description.txt b/Documentation/rev-list-description.txt index aa6bbd8cec..dce78561be 100644 --- a/Documentation/rev-list-description.txt +++ b/Documentation/rev-list-description.txt @@ -12,9 +12,16 @@ to further limit the result. Thus, the following command: +ifdef::git-rev-list[] ----------------------------------------------------------------------- $ git rev-list foo bar ^baz ----------------------------------------------------------------------- +endif::git-rev-list[] +ifdef::git-log[] +----------------------------------------------------------------------- + $ git log foo bar ^baz +----------------------------------------------------------------------- +endif::git-log[] means "list all the commits which are reachable from 'foo' or 'bar', but not from 'baz'". @@ -23,16 +30,32 @@ A special notation "''..''" can be used as a short-hand for "{caret}'' ''". For example, either of the following may be used interchangeably: +ifdef::git-rev-list[] ----------------------------------------------------------------------- $ git rev-list origin..HEAD $ git rev-list HEAD ^origin ----------------------------------------------------------------------- +endif::git-rev-list[] +ifdef::git-log[] +----------------------------------------------------------------------- + $ git log origin..HEAD + $ git log HEAD ^origin +----------------------------------------------------------------------- +endif::git-log[] Another special notation is "''...''" which is useful for merges. The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent: +ifdef::git-rev-list[] ----------------------------------------------------------------------- $ git rev-list A B --not $(git merge-base --all A B) $ git rev-list A...B ----------------------------------------------------------------------- +endif::git-rev-list[] +ifdef::git-log[] +----------------------------------------------------------------------- + $ git log A B --not $(git merge-base --all A B) + $ git log A...B +----------------------------------------------------------------------- +endif::git-log[] -- gitgitgadget