From patchwork Wed Aug 5 01:19:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 11701119 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 0A97F13B6 for ; Wed, 5 Aug 2020 01:19:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F31842075D for ; Wed, 5 Aug 2020 01:19:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BpP1zUMC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727098AbgHEBTQ (ORCPT ); Tue, 4 Aug 2020 21:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbgHEBTM (ORCPT ); Tue, 4 Aug 2020 21:19:12 -0400 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 B7816C061756 for ; Tue, 4 Aug 2020 18:19:11 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id z18so35505583wrm.12 for ; Tue, 04 Aug 2020 18:19:11 -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=djD/3SIoEHw+iUsL/AdbKgn+UWa7uq1S8vjdmn3IL3w=; b=BpP1zUMCPYz5VWmq4eoD7CDvxnJFoQePLWhNhRGXZywS10Ga9lI3GYFcEqFn1OKM7N d4rrZu0zTJjGPlRo4wo8d23ul5hscfZoAY+8A7I8YoapQHnq3wpYLJelPn8JfRAuQmNf nUa5118GZCAYJ0649Ib1sOwOZRI8+lUPKWQFNihkk07weC7lufgAg6zzOlFe//6Wn4lh onShr4sVc3+ShqweW+sqRcOC7UZ6F8QWv2cZvla8XZvBEUfiLvszKa97KM5fG404weQz asgZtFMp7C+xCiIuETi3jEvmystalQ5ZDTsqXLgHv0jg7zmSQVhJ/QW93x0wz3ROlIst PqFQ== 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=djD/3SIoEHw+iUsL/AdbKgn+UWa7uq1S8vjdmn3IL3w=; b=BBxhiVHZSTy/lLVDfyHiplinnX2ryZl3OYIWIYN7534Pz8+ZET9ic7pzmu+SBK+fpI vzuVahIMQfa+y9h/TK3XexFXiExjmtKVPNv0hVYuYaFmO8p7wRvk0RKwWuVpLwyFTxbw 8cXtP+Tc7DHbeclUpQoGMD1WOCiY8f0NU5o2unbVTY8Hhydq6qTeTXQd5riJF65L26D/ zdGKzFN3hvHAOBv4IAX0E6TAILnqON2ZaVwH4ySzHtXqGvKj7oDFbesi2PrYUQwuPTej BqkWf9SV8QJRYuIeu16kDTCkRYW0vidoE6nMgL5dAx8aoTS2a/9tSFN7KWbAioiwllOT 8vIg== X-Gm-Message-State: AOAM5331o2AdLnGXE3Svl6KYjSrc0Bf+lqp9XZtjzrvpZzEtxN3PlMb1 u2EoYz7a5/HSz4YF1BzWZY4N8LT3 X-Google-Smtp-Source: ABdhPJyT4PNoPO+HvahzPE4a/9YlepySfb8Z9nJc3+RQ9W44mUR5R5+33WSsO+7mBmUNoE49PeYwiw== X-Received: by 2002:adf:bbca:: with SMTP id z10mr449968wrg.425.1596590350338; Tue, 04 Aug 2020 18:19:10 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g126sm618756wme.16.2020.08.04.18.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 18:19:09 -0700 (PDT) Message-Id: <2bd473e0aa963c6e883a6fcaf01f3137c5e6a2e8.1596590347.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Philippe Blain via GitGitGadget" Date: Wed, 05 Aug 2020 01:19:04 +0000 Subject: [PATCH v3 1/4] command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers' Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy , Philip Oakley , Eric Sunshine , SZEDER =?utf-8?b?R8OhYm9y?= , 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 guides 'gitcredentials' and 'gitremote-helpers' do not currently appear in command-list.txt. 'gitcredentials' was forgotten back when guides were added to command-list.txt in 1b81d8cb19 (help: use command-list.txt for the source of guides, 2018-05-20). 'gitremote-helpers' was moved to section 7 in 439cc74632 (docs: move gitremote-helpers into section 7, 2019-03-25), but command-list.txt was not updated at the time. Add these two guides to the list of guides in 'command-list.txt', so that they appear in the output of 'git help --guides', and capitalize the first word of the description of 'gitcredentials', as was done in 1b81d8c (help: use command-list.txt for the source of guides, 2018-05-20) for the other guides. While at it, add a comment in Documentation/Makefile to remind developers to update command-list.txt if they add a new guide. Signed-off-by: Philippe Blain --- Documentation/Makefile | 1 + Documentation/gitcredentials.txt | 2 +- command-list.txt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index ecd0b340b1..39f6fc8de7 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -17,6 +17,7 @@ MAN1_TXT += git.txt MAN1_TXT += gitk.txt MAN1_TXT += gitweb.txt +# man5 / man7 guides (note: new guides should also be added to command-list.txt) MAN5_TXT += gitattributes.txt MAN5_TXT += githooks.txt MAN5_TXT += gitignore.txt diff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt index 9e481aec85..758bf39ba3 100644 --- a/Documentation/gitcredentials.txt +++ b/Documentation/gitcredentials.txt @@ -3,7 +3,7 @@ gitcredentials(7) NAME ---- -gitcredentials - providing usernames and passwords to Git +gitcredentials - Providing usernames and passwords to Git SYNOPSIS -------- diff --git a/command-list.txt b/command-list.txt index 89aa60cde7..e5901f2213 100644 --- a/command-list.txt +++ b/command-list.txt @@ -195,6 +195,7 @@ git-write-tree plumbingmanipulators gitattributes guide gitcli guide gitcore-tutorial guide +gitcredentials guide gitcvs-migration guide gitdiffcore guide giteveryday guide @@ -204,6 +205,7 @@ githooks guide gitignore guide gitmodules guide gitnamespaces guide +gitremote-helpers guide gitrepository-layout guide gitrevisions guide gitsubmodules guide From patchwork Wed Aug 5 01:19:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 11701121 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 07D41913 for ; Wed, 5 Aug 2020 01:19:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F355C207FC for ; Wed, 5 Aug 2020 01:19:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cNXUBltL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727114AbgHEBTR (ORCPT ); Tue, 4 Aug 2020 21:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727055AbgHEBTN (ORCPT ); Tue, 4 Aug 2020 21:19:13 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6981C06174A for ; Tue, 4 Aug 2020 18:19:12 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id l2so28531645wrc.7 for ; Tue, 04 Aug 2020 18:19:12 -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=4ym1IzoRp2NjrKCQfPSxjzCBmGas+7GV3dRMTATrHus=; b=cNXUBltLbXDjl123CaQcUQACDgxtfD//VuCMh3wKhUyag3RZ/uOUncWUjO/5qI2SFv qvWaX3A08TtJrmps7p/eF10IKpEVEkAgTKU1GhzGt4asF4XhA+70YgZAB7Dc++NBMG3e NJVTZVKq07k6HnBR0SJX8XoJKtRv/mO7+iK9UpE0QKhoxuOa/yRSeyaR3q+zMRvtoh/e 0289/baKm0NUtnj3ilgNpCm2NrylU1K3WDN0oXfK6hr4oC7fzH4sLH8XoXPLfEufeacx Vpq1TXF+5q6EgD1AxP+HTSO4JiIZQ0j1Ty58T97eArnKE/a2qulxEY52l5qjU7kK9PxQ IKpQ== 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=4ym1IzoRp2NjrKCQfPSxjzCBmGas+7GV3dRMTATrHus=; b=X0Hgs2x8IPavYyek50l3/xm5sO3krLBRyoaLc/r3zlbDOG7j8XB3geR5ngYLcsCFHc O31MSIb557AbB4trukbezlIi6oe6BOiT/1kqwguTbgKYnGL+1XAmLD5tKxNTqfhf33Sm 93TgVs0DXzyFo7bIiF+KEgIiOUDCPMiOeL7xuXVvPhv96yKdCI7CcDAj/lwcg0p6VSaF cpIfbn1/f9pH5tGUZZJOoPnQacJ4+0ZMz7bDcdQeG+fwqOhsxSTr8+m8aiX6Af+JogPB ThtXcq7qUYNY+4DpBcti/AY7BUthMSOwLad7Fkb1UQRpvUlBhVzDo/qnWuEGfsoyNr5f MuMA== X-Gm-Message-State: AOAM533tyM1KK8hudfNrWHxri+NM/BV4QagqOK9n7POOcXVjejlk//6C impeva9WxQf1TjhWTljzyC2OR5eG X-Google-Smtp-Source: ABdhPJzXefeBF3Gxws2gFLVBaMBfxLCPLY9hHvzfM6prfAjPk203yeL/t2WhxbN6PC24sZ962yfj6g== X-Received: by 2002:adf:f289:: with SMTP id k9mr486583wro.203.1596590351232; Tue, 04 Aug 2020 18:19:11 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id p14sm596548wrx.90.2020.08.04.18.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 18:19:10 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Philippe Blain via GitGitGadget" Date: Wed, 05 Aug 2020 01:19:05 +0000 Subject: [PATCH v3 2/4] help: drop usage of 'common' and 'useful' for guides Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy , Philip Oakley , Eric Sunshine , SZEDER =?utf-8?b?R8OhYm9y?= , Philippe Blain , Philippe Blain Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain Since 1b81d8cb19 (help: use command-list.txt for the source of guides, 2018-05-20), all man5/man7 guides listed in command-list.txt appear in the output of 'git help -g'. However, 'git help -g' still prefixes this list with "The common Git guides are:", which makes one wonder if there are others! In the same spirit, the man page for 'git help' describes the '--guides' option as listing 'useful' guides, which is not false per se but can also be taken to mean that there are other guides that exist but are not useful. Instead of 'common' and 'useful', use 'Git concept guides' in both places. To keep the code in line with this change, rename help.c::list_common_guides_help to list_guides_help. Signed-off-by: Philippe Blain --- Documentation/git-help.txt | 6 +++--- builtin/help.c | 2 +- help.c | 4 ++-- help.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt index 69c0c5c34e..44fe8860b3 100644 --- a/Documentation/git-help.txt +++ b/Documentation/git-help.txt @@ -21,8 +21,8 @@ on the standard output. If the option `--all` or `-a` is given, all available commands are printed on the standard output. -If the option `--guides` or `-g` is given, a list of the useful -Git guides is also printed on the standard output. +If the option `--guides` or `-g` is given, a list of the +Git concept guides is also printed on the standard output. If a command, or a guide, is given, a manual page for that command or guide is brought up. The 'man' program is used by default for this @@ -58,7 +58,7 @@ OPTIONS -g:: --guides:: - Prints a list of useful guides on the standard output. This + Prints a list of the Git concept guides on the standard output. This option overrides any given command or guide name. -i:: diff --git a/builtin/help.c b/builtin/help.c index 299206eb57..bb339f0fc8 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -579,7 +579,7 @@ int cmd_help(int argc, const char **argv, const char *prefix) } if (show_guides) - list_common_guides_help(); + list_guides_help(); if (show_all || show_guides) { printf("%s\n", _(git_more_info_string)); diff --git a/help.c b/help.c index 44cee69c11..d478afb2af 100644 --- a/help.c +++ b/help.c @@ -397,10 +397,10 @@ void list_cmds_by_config(struct string_list *list) } } -void list_common_guides_help(void) +void list_guides_help(void) { struct category_description catdesc[] = { - { CAT_guide, N_("The common Git guides are:") }, + { CAT_guide, N_("The Git concept guides are:") }, { 0, NULL } }; print_cmd_by_category(catdesc, NULL); diff --git a/help.h b/help.h index 500521b908..dc02458855 100644 --- a/help.h +++ b/help.h @@ -21,7 +21,7 @@ static inline void mput_char(char c, unsigned int num) void list_common_cmds_help(void); void list_all_cmds_help(void); -void list_common_guides_help(void); +void list_guides_help(void); void list_all_main_cmds(struct string_list *list); void list_all_other_cmds(struct string_list *list); From patchwork Wed Aug 5 01:19:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 11701127 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 75D0D913 for ; Wed, 5 Aug 2020 01:19:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C16120792 for ; Wed, 5 Aug 2020 01:19:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aHTc2Epw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgHEBTZ (ORCPT ); Tue, 4 Aug 2020 21:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbgHEBTQ (ORCPT ); Tue, 4 Aug 2020 21:19:16 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA760C06174A for ; Tue, 4 Aug 2020 18:19:15 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id a14so39095158wra.5 for ; Tue, 04 Aug 2020 18:19:15 -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=NohGUJkTNz8tQXtFpefX4F1oprCF9XsxPxI3ZjPbScI=; b=aHTc2Epw9WkbpEoYDPnjxhya/2MmJrgEnnY2xBhoxcJCeEf4UbF8E+HLWT+XkoHPos MFVCPtwkWAd9zmyjPqToXR17eD0P+w9bG4PeVpA00WXM+9miclbAn7zJRyMJmvWBsUGE fZC3QAb/kZCLxtaD7cpgEgL5NJ3qRCf5XcnYGuDW7CgzkJZH2UpE58AoL3HwpG/a9X0d 8TSApG3OKw+EJUftkLomOzHPLRTDk73fRLcmOIG9D36sgxSWbp+UrDSSLo5u9md4Tvdl DEdWLTt3Top5l4PntpX0P0FmMKnkkXJy9RtV8X3qeDYv0v5H5FyUaQmk//g0SW3/+Rnb GX1A== 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=NohGUJkTNz8tQXtFpefX4F1oprCF9XsxPxI3ZjPbScI=; b=XSXBXHN9EpFB+j3gM++3ifaVGly3NZPLPMDKosz7HChfEDpqXkRWZqUChz01H3z/l9 60Fp9TNtpf3yRmht1EGnMv9+dha50EBPqFbkdHCh5zVoJcnu7Bar6rtvi41RVXMvPVNY aVwJFTZ8KTAN8zu91lYN1henucAw5yYDLuoJtK8kE2vYdfYpf9e48BBhLYWRWYc9EwWC eSbruD3BVXFwhWu1kPROKHOz8pg3XYDbuGfp41OOh7/5TYP1CK6Ywa9SL0LoLfL0QRLE 6rn9P3MjsrI2iBfA+4nA2w0XaAgodaSgWwvThNp4rfp7bpC4lPUrJvY8fDK+18T1EBud Y0oQ== X-Gm-Message-State: AOAM5311bBPlyTsiJUOeoMOPQgnUvK3e+mrkl+Mvftrqq2N3k5BLKb3U h0P+X978BdtKAdmwvdwSMFssZeVi X-Google-Smtp-Source: ABdhPJzDf8e1Z6IBQ9VzKnBZFhnHnOxQjzfQPuaUfJJnxj2Wr5udhjkZbilIy8vSFkwAu0/6jtRtHg== X-Received: by 2002:adf:e382:: with SMTP id e2mr506333wrm.306.1596590352045; Tue, 04 Aug 2020 18:19:12 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t189sm575489wmf.47.2020.08.04.18.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 18:19:11 -0700 (PDT) Message-Id: <552444a84241d280640c4700f17477a9c297fb73.1596590347.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Junio C Hamano via GitGitGadget" Date: Wed, 05 Aug 2020 01:19:06 +0000 Subject: [PATCH v3 3/4] Documentation: don't hardcode command categories twice Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy , Philip Oakley , Eric Sunshine , SZEDER =?utf-8?b?R8OhYm9y?= , Philippe Blain , Junio C Hamano Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Junio C Hamano Instead of hard-coding the list of command categories in both `Documentation/Makefile` and `Documentation/cmd-list.perl`, make the Makefile the authoritative source and tweak `cmd-list.perl` so that it receives the list of command categories as argument. Signed-off-by: Philippe Blain --- Documentation/Makefile | 2 +- Documentation/cmd-list.perl | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 39f6fc8de7..eb9c7e2b0e 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -302,7 +302,7 @@ $(cmds_txt): cmd-list.made cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT) $(QUIET_GEN)$(RM) $@ && \ - $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \ + $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \ date >$@ mergetools_txt = mergetools-diff.txt mergetools-merge.txt diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl index 5aa73cfe45..ee96de53db 100755 --- a/Documentation/cmd-list.perl +++ b/Documentation/cmd-list.perl @@ -38,12 +38,15 @@ sub format_one { } } -while (<>) { +my ($input, @categories) = @ARGV; + +open IN, "<$input"; +while () { last if /^### command list/; } my %cmds = (); -for (sort <>) { +for (sort ) { next if /^#/; chomp; @@ -51,17 +54,10 @@ sub format_one { $attr = '' unless defined $attr; push @{$cmds{$cat}}, [$name, " $attr "]; } +close IN; -for my $cat (qw(ancillaryinterrogators - ancillarymanipulators - mainporcelain - plumbinginterrogators - plumbingmanipulators - synchingrepositories - foreignscminterface - purehelpers - synchelpers)) { - my $out = "cmds-$cat.txt"; +for my $out (@categories) { + my ($cat) = $out =~ /^cmds-(.*)\.txt$/; open O, '>', "$out+" or die "Cannot open output file $out+"; for (@{$cmds{$cat}}) { format_one(\*O, $_); From patchwork Wed Aug 5 01:19:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 11701125 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 96692913 for ; Wed, 5 Aug 2020 01:19:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DCF520792 for ; Wed, 5 Aug 2020 01:19:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L8sgVgCF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbgHEBTR (ORCPT ); Tue, 4 Aug 2020 21:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgHEBTO (ORCPT ); Tue, 4 Aug 2020 21:19:14 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D97DC061756 for ; Tue, 4 Aug 2020 18:19:14 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id a15so39059721wrh.10 for ; Tue, 04 Aug 2020 18:19:14 -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=g09DkUyyJitxKLSoaRxuNVFbdB7QVX7Nn2DMOu3eqko=; b=L8sgVgCFXNrAW27B4enJpLkk1aKLM4RdyWIxfrjXLZpJtMPsSA4vDXdL4jaXSO/M32 2KZAztUIgj7+5xO/DEVoYm/BakmjXeTUJKPPzphoa5MowFfs+DnTGYn2Hfdczt3IIv99 cuLBftxtsCEvKKgrXf9a3dPFdKvXZckIkxRv67CaWVK+mkUc5O1hLPfEcHURNjDr5FeB cIyzsilL+DMjPb/tfJh6JUWgmZ5OHkemcBhde6qAgo6gHdQ3MTwjFiQ5UNWsrbo7PBmn eXmlu39GQcG46bEIffJln5OerUJDfrAwWNpvJTxYsuv499vff7qagvdQh9pzJ3/duQbi zQtQ== 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=g09DkUyyJitxKLSoaRxuNVFbdB7QVX7Nn2DMOu3eqko=; b=H/bBDdCsT9LFlpoCeap2oSrY9At3v+tgKO8k92/L4T9957MKc/BETSxdj4juwtRVYq GA+tBUu/90evAozU0xQWQvAdTgSzBq+iFgKwVfwVQrD+mz4fVGm7HnlPuSm3GC9HHgfQ ygDaK/HPM4J24gdl+Srxz8nghxiVZIJlkGuZ/t8N02Q5bZPVeZnpvLDaWDvl2CCC8kfX 64CIFhs6WrDKqDHb4vEiBaCpjuSZVh3kmKHwweIIIQLj77xWzRer3MAEJ9bggwV8iybf enHrQfCK7RJ998k7/Bu/pbG8EnCRaqdxc1TaKt7SvMQk8D/3duOEgi/Rt7nKDEEoDbUH OouA== X-Gm-Message-State: AOAM532X9dbTqmdCBmZkAGpNpda//a/PKDjUj2F0f7lfIY8RunWBiGcv hlgTEvqfGiGleCZ+npuJdAQuwX6G X-Google-Smtp-Source: ABdhPJxLXQG0P2ktSOt5NY1pOu5z7Z/80CqYFKTGXj7SF+hk2qqJX4MMO6n0lyrpaW8iy+repr+27g== X-Received: by 2002:adf:f247:: with SMTP id b7mr542041wrp.128.1596590352761; Tue, 04 Aug 2020 18:19:12 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 130sm594429wme.26.2020.08.04.18.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 18:19:12 -0700 (PDT) Message-Id: <840371fb4b7ec5ae5c5876be25f27008359dab9e.1596590347.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Philippe Blain via GitGitGadget" Date: Wed, 05 Aug 2020 01:19:07 +0000 Subject: [PATCH v3 4/4] git.txt: add list of guides Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy , Philip Oakley , Eric Sunshine , SZEDER =?utf-8?b?R8OhYm9y?= , Philippe Blain , Philippe Blain Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain Not all man5/man7 guides are mentioned in the 'git(1)' documentation, which makes the missing ones somewhat hard to find. Add a list of the guides to git(1) by leveraging the existing `Documentation/cmd-list.perl` script to generate a file `cmds-guide.txt` which gets included in git.txt. Also, do not hard-code the manual section '1'. Instead, use a regex so that the manual section is discovered from the first line of each `git*.txt` file. This addition was hinted at in 1b81d8cb19 (help: use command-list.txt for the source of guides, 2018-05-20). Helped-by: Junio C Hamano Signed-off-by: Philippe Blain --- Documentation/Makefile | 1 + Documentation/cmd-list.perl | 7 ++++++- Documentation/git.txt | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index eb9c7e2b0e..80d1908a44 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \ cmds-plumbingmanipulators.txt \ cmds-synchingrepositories.txt \ cmds-synchelpers.txt \ + cmds-guide.txt \ cmds-purehelpers.txt \ cmds-foreignscminterface.txt diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl index ee96de53db..af5da45d28 100755 --- a/Documentation/cmd-list.perl +++ b/Documentation/cmd-list.perl @@ -6,9 +6,14 @@ sub format_one { my ($out, $nameattr) = @_; my ($name, $attr) = @$nameattr; my ($state, $description); + my $mansection; $state = 0; open I, '<', "$name.txt" or die "No such file $name.txt"; while () { + if (/^git[a-z0-9-]*\(([0-9])\)$/) { + $mansection = $1; + next; + } if (/^NAME$/) { $state = 1; next; @@ -27,7 +32,7 @@ sub format_one { die "No description found in $name.txt"; } if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) { - print $out "linkgit:$name\[1\]::\n\t"; + print $out "linkgit:$name\[$mansection\]::\n\t"; if ($attr =~ / deprecated /) { print $out "(deprecated) "; } diff --git a/Documentation/git.txt b/Documentation/git.txt index 3e50065198..81349a84e7 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -304,6 +304,13 @@ users typically do not use them directly. include::cmds-purehelpers.txt[] +Guides +------ + +The following documentation pages are guides about Git concepts. + +include::cmds-guide.txt[] + Configuration Mechanism -----------------------