From patchwork Fri May 21 22:44:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274055 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=-15.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,USER_AGENT_GIT 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 C681FC04FF3 for ; Fri, 21 May 2021 22:45:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A448B613AF for ; Fri, 21 May 2021 22:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230014AbhEUWqX (ORCPT ); Fri, 21 May 2021 18:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhEUWqU (ORCPT ); Fri, 21 May 2021 18:46:20 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2B9C061574 for ; Fri, 21 May 2021 15:44:57 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id w127so17288821oig.12 for ; Fri, 21 May 2021 15:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6hrFgomY39D/QRHWLKBpxQmIEKj3msuoBymtjF5aGA0=; b=V75V2QIcr6B7Jo9RrlnbMgv1sNVfDHvnlvy6/5O48+cXD8mnlQ1Ju70NJLF/vYMJGE qUbvtRAYRIYZjckaA8OCjSfQiftPjSHmUmAo2e9JsGAppgbq3Rc7r+Ns2wbgH05sEOeC +bUm1OKoFJryTdeQDwGjc5TgB5OhWdixN2570znrGtrrGq8aOA3HXtQjPBh8yJE2CL7s MXXtbAPdriDa0AeIOlynIU1lVmwaOLLfFlCkp+Q4NKyDqv+grr/GnQ6UIkzc03fxDgAA MvET/Y7ugrZ/xoxomQ8hfo5xEmA0DzBMfQesvLEfyum0QdrNQKkwZVeEjds56LuFTDVH lVGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6hrFgomY39D/QRHWLKBpxQmIEKj3msuoBymtjF5aGA0=; b=qlUIrxHDWw/7c8hcB5fnqankt6qnjsmRZvLK0mTrZn0el6Vc7SaT6RiihL+6uZ3ktt iCc1dTinmKngMQ0TxV3J6pgwTA6bBPPoxMz4wioE6MY13TgF+RKshqgjwMme/RF1jGiL LuYFeWfRPnrHXrQiHopQH8ALgCBGHVqpG9g8RElt2JnUoz7HZkC53ocvxy6vErxWnDFA kd+T00l/sM8wlcKALq7B98wsEkf3TFL4SctytNYWKbvFOW56nrRuZnIjgOPcs9P2QWOe Hh085/v9jUFMUhT11FhTsI34CSYbsjYc3KR8UEuAeqKOsizt85uxQ/CUO5QV6TDX8X7S Ksiw== X-Gm-Message-State: AOAM532xkK8dsyya0VIQckAA4WK15aZgxevvHZDH4S4MIPaDAMpY3bSL r2yRnWtCVh49SfNDCPqP77SDbbLVdOFm6w== X-Google-Smtp-Source: ABdhPJy4FSeLGoCRrd3+CkSg4A42NmujMO7GJvT2So2S5pKiaQnApnAxYrYm59vAqnsmKZyUsk6i/A== X-Received: by 2002:a05:6808:d48:: with SMTP id w8mr3625208oik.141.1621637096383; Fri, 21 May 2021 15:44:56 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id i9sm1463449oog.17.2021.05.21.15.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:44:55 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 01/11] doc: doc-diff: set docdate manually Date: Fri, 21 May 2021 17:44:42 -0500 Message-Id: <20210521224452.530852-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In order to minimize the differences in the footer. Asciidoc automatically generates a date with format '%Y-%m-%d', while asciidoctor '%F'. I personally prefer the latter, so only modify it for diff purposes. Fixes tons of these: -Git omitted 01/01/1970 GIT-ADD(1) +Git omitted 1970-01-01 GIT-ADD(1) Note that we have to add quotes when passing around $makemanflags, as it now may contain whitespace due to multiple arguments (but the dereference inside render_tree must remain unquoted, because it wants to perform whitespace splitting to get the individual arguments back). Comments-by: Jeff King Signed-off-by: Felipe Contreras --- Documentation/Makefile | 2 +- Documentation/doc-diff | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 47053c78f8..b68ab57239 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -136,7 +136,7 @@ ASCIIDOC_EXTRA = ASCIIDOC_HTML = xhtml11 ASCIIDOC_DOCBOOK = docbook ASCIIDOC_CONF = -f asciidoc.conf -ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \ +ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_FLAGS) $(ASCIIDOC_CONF) \ -amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)' ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML) diff --git a/Documentation/doc-diff b/Documentation/doc-diff index 1694300e50..c11b90a6ef 100755 --- a/Documentation/doc-diff +++ b/Documentation/doc-diff @@ -111,7 +111,7 @@ construct_makemanflags () { echo USE_ASCIIDOCTOR= elif test "$1" = "-asciidoctor" then - echo USE_ASCIIDOCTOR=YesPlease + echo USE_ASCIIDOCTOR=YesPlease ASCIIDOC_FLAGS='-adocdate="01/01/1970"' fi } @@ -181,6 +181,6 @@ render_tree () { fi } -render_tree $from_oid $from_dir $from_makemanflags && -render_tree $to_oid $to_dir $to_makemanflags && +render_tree $from_oid $from_dir "$from_makemanflags" && +render_tree $to_oid $to_dir "$to_makemanflags" && git -C $tmp/rendered diff --no-index "$@" $from_dir $to_dir From patchwork Fri May 21 22:44:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274057 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=-15.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,USER_AGENT_GIT 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 7D873C04FF3 for ; Fri, 21 May 2021 22:45:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DFB4613D8 for ; Fri, 21 May 2021 22:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbhEUWqZ (ORCPT ); Fri, 21 May 2021 18:46:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhEUWqX (ORCPT ); Fri, 21 May 2021 18:46:23 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106CEC06138A for ; Fri, 21 May 2021 15:44:59 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id q17-20020a4a33110000b029020ebab0e615so3000926ooq.8 for ; Fri, 21 May 2021 15:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8rOlatWt4JVTIzmy0PIKFwpkSn+lV99PiEz5KG3yTmM=; b=ZU2fPkiicSZ/t4mwKh4e6fKssKRpz90rafEJldAv5UyrQZ8990lBuemasG36S5QYcH h6TgE6maXaZfQXBnmePGyR2h8pBSLskyMiZ0MSdRy+iEhn7vxgqORuZ4wpjjjZWYuf75 mHW4synG3qHoMSE7lTp60dZMlLmeYSqNvHrVH6Es2psLcS1b44Kw1kADOjiQY2tuOTWi MTZF4bAfuoMRkjU22R8fhBZp1b2ILT9EUcogNqkOW7y3Ap65sBq0W1EHTuM7HPJ1oiKU Y2rxvLdBZmPLO7SKehTCwEc2RPg6bEaxUHkTWnxrKtmAP2xrGmmwkPqplDxmT7aJOGrf fCjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8rOlatWt4JVTIzmy0PIKFwpkSn+lV99PiEz5KG3yTmM=; b=mMSueSpn+KL3XqaTmqposYgnNTht1otHkHkGToJeFbQJv+cs+d2HBRJ0tHS6ckm4yS rguCRIHFOmBPtVDzgZrZ4GVyCUZ90q3w0tReF7WeGctJHeO1tO6FLPKeiN9xD0j0JHRn 8Yo7z0gEZYxYvCRFWF3dujl9hp7FHgo9XRmzJwtI5wotlbn6gPUk5gRa3xfdee2UP7fU CwlFi+QU8tz5KzdgEC6EmsasPxdA8lUzo7jIpDq3xKHuc/+jaqinPYGQfzPhhKZ7yqY8 GCPV5kSAas3iLOEFHzfbM8sZci7rzlhY/VbQmavc5GpHaMXR5tiIX/m1zMgHdS+hJocm HK4Q== X-Gm-Message-State: AOAM533ZwVSdjxx/1ORkxrm7MFEKNft8wTZ96l+nkiaNJCoSzo0WifwS GwDIjMrYUDjR+qv3cih25tPtzgTCfMrXgA== X-Google-Smtp-Source: ABdhPJw4mQkNaV1eI8dPOiXm4+ZK9SASYoZi5Naeti4oxmsCPEcs+XSiNMt4wiEtaegZT7hR0cHFvw== X-Received: by 2002:a4a:ab83:: with SMTP id m3mr9982148oon.2.1621637098151; Fri, 21 May 2021 15:44:58 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id q63sm1415407oic.15.2021.05.21.15.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:44:57 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 02/11] doc-diff: drop --cut-footer switch Date: Fri, 21 May 2021 17:44:43 -0500 Message-Id: <20210521224452.530852-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Martin Ågren Now that our doc-diff convinces Asciidoctor to insert the exact same formatted dummy date as AsciiDoc, we can drop the --cut-footer switch. It has been useful to ignore this difference between the two tools, but it's effectively a no-op now. Similar to when we repurposed this from --cut-header-footer in 83b0b8953e ("doc-diff: replace --cut-header-footer with --cut-footer", 2019-09-16), just drop it without worrying about any kind of backwards compatibility or user-base. Signed-off-by: Martin Ågren Signed-off-by: Felipe Contreras --- Documentation/doc-diff | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Documentation/doc-diff b/Documentation/doc-diff index c11b90a6ef..6b6bb444ac 100755 --- a/Documentation/doc-diff +++ b/Documentation/doc-diff @@ -21,7 +21,6 @@ asciidoc use asciidoc with both commits to-asciidoc use asciidoc with the 'to'-commit to-asciidoctor use asciidoctor with the 'to'-commit asciidoctor use asciidoctor with both commits -cut-footer cut away footer " SUBDIRECTORY_OK=1 . "$(git --exec-path)/git-sh-setup" @@ -31,7 +30,6 @@ force= clean= from_program= to_program= -cut_footer= while test $# -gt 0 do case "$1" in @@ -55,8 +53,6 @@ do --asciidoc) from_program=-asciidoc to_program=-asciidoc ;; - --cut-footer) - cut_footer=-cut-footer ;; --) shift; break ;; *) @@ -118,8 +114,8 @@ construct_makemanflags () { from_makemanflags=$(construct_makemanflags "$from_program") && to_makemanflags=$(construct_makemanflags "$to_program") && -from_dir=$from_oid$from_program$cut_footer && -to_dir=$to_oid$to_program$cut_footer && +from_dir=$from_oid$from_program && +to_dir=$to_oid$to_program && # generate_render_makefile generate_render_makefile () { @@ -168,16 +164,6 @@ render_tree () { "$tmp/rendered/$dname+" | make -j$parallel -f - && mv "$tmp/rendered/$dname+" "$tmp/rendered/$dname" - - if test "$cut_footer" = "-cut-footer" - then - for f in $(find "$tmp/rendered/$dname" -type f) - do - head -n -2 "$f" | sed -e '${/^$/d}' >"$f+" && - mv "$f+" "$f" || - return 1 - done - fi fi } From patchwork Fri May 21 22:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274063 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=-15.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,USER_AGENT_GIT 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 5B139C04FF3 for ; Fri, 21 May 2021 22:45:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41451613DF for ; Fri, 21 May 2021 22:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbhEUWq1 (ORCPT ); Fri, 21 May 2021 18:46:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbhEUWqY (ORCPT ); Fri, 21 May 2021 18:46:24 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9F2EC061574 for ; Fri, 21 May 2021 15:45:00 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id s19so21103644oic.7 for ; Fri, 21 May 2021 15:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4RIpdrU1N/77rHbTO+YiD6Wn20KglLZhdWjVGVvUy28=; b=sIh4zDZbiEMyhrd4JqFivmIWBsycDyG2CSqEsQOBfLSfU4rNQieg6NXQKtfec4xZg/ J9gAzNDUwJKvAf1bJfcmZwFi+F9NUrJ2OnBEkDWfQ33njtfRUWwyzzVmBcuL7iE/dt4A dfFHFEC6crOtzejFZ9+FBNj4dTEu2DfiRrNAuuc8EVBOZXsWKTaSkuBv83dCw/O76u9r a707SfuxfSKcI5MgFAE0yE1/huH9kk+ngGuK0sV2RqBQWFPJRK+PhCBCko9tG3LWiEYP y6PU4PB3EcQGWoeL5MKHJMUMlE/NLb+WEAHDyflwkpVD26g8KCIR0vFEQ7vl4CsXMY1t EdTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4RIpdrU1N/77rHbTO+YiD6Wn20KglLZhdWjVGVvUy28=; b=UjPfATkplQtiuPC6lw55Jy8fNywO/fxYpSVi7VK+siZcuGiP1I2ldYw/SBgcdnTTgI OU0c5CKpIMNSybGQFC0Auxy7mfokIreLQxpTGU68kmrlOinQEd+T2sWYmj1MZpsRajhJ RW2HwBVJ8BJKS/BSOYN+epFXFjtDdKbi/vZAAfLff6yVwf+FNb8WGDqv9XSP3rrXaLUX 47K1oxfuI8Sv/+pIo1iXcG8lRZc7P+i/MQCx3+WVqtmqP3Pwkn8Kp/YVcFeqlUMvGIIv NPgPX6HBDfu41bRHB5sa9/r4pg3syb1VnIOjtRAJV3aoCfuTjxNzw80e77rXjoyEywRS C/JQ== X-Gm-Message-State: AOAM5303LY4Iw87USLQQy/KZ2tWwfbB97DaGJ4UfaHiObfZPOX4vVJSk TLt+dT6WLpGj0Ym3hkSigmqx8xbFs/Mf2g== X-Google-Smtp-Source: ABdhPJw/4aX4taKwwjsMxJh2cUObIRQGuhtImZMBf3lrCxcFqbU8+PKoGEblNksnoi10l1aRwyVI1A== X-Received: by 2002:aca:da8b:: with SMTP id r133mr3729816oig.36.1621637100033; Fri, 21 May 2021 15:45:00 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id b81sm1374816oia.19.2021.05.21.15.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:44:59 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras , Bagas Sanjaya Subject: [PATCH v2 03/11] doc: use asciidoctor to build man pages directly Date: Fri, 21 May 2021 17:44:44 -0500 Message-Id: <20210521224452.530852-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's no need to use xmlto to build the man pages when modern asciidoctor can do it by itself. This new mode will be active only when both USE_ASCIIDOCTOR and USE_ASCIIDOCTOR_MANPAGE are set. Suggested-by: Bagas Sanjaya Signed-off-by: Felipe Contreras --- Documentation/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index b68ab57239..0c654f4ec9 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -189,6 +189,9 @@ ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS DBLATEX_COMMON = XMLTO_EXTRA += --skip-validation XMLTO_EXTRA += -x manpage.xsl +ifdef USE_ASCIIDOCTOR_MANPAGE +TXT_TO_MAN = $(ASCIIDOC_COMMON) -b manpage +endif endif SHELL_PATH ?= $(SHELL) @@ -324,7 +327,7 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*) show_tool_names can_merge "* " || :' >mergetools-merge.txt && \ date >$@ -TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK)) +TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK):$(USE_ASCIIDOCTOR_MANPAGE)) GIT-ASCIIDOCFLAGS: FORCE @FLAGS='$(TRACK_ASCIIDOCFLAGS)'; \ @@ -349,8 +352,13 @@ $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS) $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS) $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $< -%.1 %.5 %.7 : %.xml $(wildcard manpage*.xsl) +ifdef TXT_TO_MAN +%.1 %.5 %.7 : %.txt $(ASCIIDOC_DEPS) + $(QUIET_ASCIIDOC)$(TXT_TO_MAN) -o $@ $< +else +%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl) $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< +endif %.xml : %.txt $(ASCIIDOC_DEPS) $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $< From patchwork Fri May 21 22:44:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274059 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=-15.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,USER_AGENT_GIT 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 C8B31C4707A for ; Fri, 21 May 2021 22:45:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75AAA613D8 for ; Fri, 21 May 2021 22:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbhEUWq2 (ORCPT ); Fri, 21 May 2021 18:46:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbhEUWq0 (ORCPT ); Fri, 21 May 2021 18:46:26 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BCBEC061574 for ; Fri, 21 May 2021 15:45:02 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id c196so12924403oib.9 for ; Fri, 21 May 2021 15:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+hZftNoe2wSMaXMca7VYcDt5EqtKBAdkp7dgFYAHy4k=; b=NIjw0sGJy0QAdxMdl5UtTyRMWhyO+uiC7f2v8M2QEN+8/ls5pjoKfiEGpTRaWKgmNV mkPjP56p2t95GYA8vgg9uMP9OIfj3J7YFbR2aVU5Fs+u8ZCMnrzvyYQK1Jq2jtSRlTY/ ShbkpIhN9labKLVT8IuLVEHM4d0eCJxuKrvXdndPNOKTm/73nqQZwB9Ri65My9KGuRmX l2VPO8b/93eRzrzZt++aPgpiC1NI8Mjqy1dTh8nsBikYmDZVIpvviMzqQh5S5XHaQtQy NMn3LRoDKm4sF5TncnlB+NJmvhBYUFFMEUZYBiQ7mNvK4wHzCDbNWmLltOSeFf0wDF6Q NazA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+hZftNoe2wSMaXMca7VYcDt5EqtKBAdkp7dgFYAHy4k=; b=MnyUI3XQ0VJj+WXOAUjUT/DGZgAFIluB13H9NqFukIC5dFM3oXiE/XcowiETrPlpRz uaVQSwXhs9C+PPOwAtmF7JMu3kfCURixqeB4C8zruMcSoT68t9K354ey1bJe07PUt1+2 LEoQs99+DCcirvV8U1p+5fqZYxLdgDHwxLcyj98wfhGrBy9xmraxtFOHYDXAAgincJRZ oX2Rzx2awt3xcfyF/rdJy8k+cZggwFDRAgCRaiTdOzHW0mWRIwUg4rfVtHeTxfY2hyjX FEJi8XlGFndpJN0Z7NjnwLkYeqUPnejhxhjS7srrnbTROJNKfQmwCrNorgaO1Rvyq8MK qkNg== X-Gm-Message-State: AOAM530ZI0Sw9yV9vsnAtG/3gvtCTIXjvnna4uMYXlw0N54bz4k7Rddk ELa4ZoqqRa0mLAt3eS4N9cmLCSp3LIQ4vQ== X-Google-Smtp-Source: ABdhPJzfs7WnxzWQOIMGIE6Mvl9kJeRTvnYm97NmVbup2m1ObBo5gHytDpGy7jRgz4AEJPNTPJBDig== X-Received: by 2002:a05:6808:317:: with SMTP id i23mr3858888oie.50.1621637101745; Fri, 21 May 2021 15:45:01 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id x14sm1416704oic.3.2021.05.21.15.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:01 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 04/11] doc-diff: support asciidoctor man pages Date: Fri, 21 May 2021 17:44:45 -0500 Message-Id: <20210521224452.530852-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King The new option enables both asciidoctor as well as its direct-to-manpage mode that skips xmlto. This lets you view the rendered difference between the two pipelines with something like: ./doc-diff --from-asciidoctor --to-asciidoctor-direct HEAD HEAD Signed-off-by: Jeff King Signed-off-by: Felipe Contreras --- Documentation/doc-diff | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/doc-diff b/Documentation/doc-diff index 6b6bb444ac..52cf639f4d 100755 --- a/Documentation/doc-diff +++ b/Documentation/doc-diff @@ -17,10 +17,14 @@ f force rebuild; do not rely on cached results c,clean cleanup temporary working files from-asciidoc use asciidoc with the 'from'-commit from-asciidoctor use asciidoctor with the 'from'-commit +from-asciidoctor-direct use asciidoctor without xmlto for 'from'-commit asciidoc use asciidoc with both commits to-asciidoc use asciidoc with the 'to'-commit to-asciidoctor use asciidoctor with the 'to'-commit +to-asciidoctor-direct use asciidoctor without xmlto for 'to'-commit asciidoctor use asciidoctor with both commits +asciidoctor-direct use asciidoctor without xml for both commits +cut-footer cut away footer " SUBDIRECTORY_OK=1 . "$(git --exec-path)/git-sh-setup" @@ -53,6 +57,15 @@ do --asciidoc) from_program=-asciidoc to_program=-asciidoc ;; + --cut-footer) + cut_footer=-cut-footer ;; + --from-asciidoctor-direct) + from_program=-asciidoctor-direct ;; + --to-asciidoctor-direct) + to_program=-asciidoctor-direct ;; + --asciidoctor-direct) + from_program=-asciidoctor-direct + to_program=-asciidoctor-direct ;; --) shift; break ;; *) @@ -108,6 +121,10 @@ construct_makemanflags () { elif test "$1" = "-asciidoctor" then echo USE_ASCIIDOCTOR=YesPlease ASCIIDOC_FLAGS='-adocdate="01/01/1970"' + elif test "$1" = "-asciidoctor-direct" + then + echo USE_ASCIIDOCTOR=YesPlease ASCIIDOC_FLAGS='-adocdate="01/01/1970"' + echo USE_ASCIIDOCTOR_MANPAGE=YesPlease fi } From patchwork Fri May 21 22:44:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274061 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=-15.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,USER_AGENT_GIT 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 1FADEC4707A for ; Fri, 21 May 2021 22:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F021D613DF for ; Fri, 21 May 2021 22:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbhEUWqb (ORCPT ); Fri, 21 May 2021 18:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbhEUWq3 (ORCPT ); Fri, 21 May 2021 18:46:29 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E2F2C061574 for ; Fri, 21 May 2021 15:45:04 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id z3so21108486oib.5 for ; Fri, 21 May 2021 15:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=all81ubQzTKgRnk+PwTVcGJCyDf8WHC0oSVvyF6FtsA=; b=JfgM0a/5SvJgKpGQ7aqnmOMzrhJhubbE3UaMVIGTy35c8ssns7IrxB0cguqDOLbo+0 MIjbLdBN8M+M8sndSBKeR7x784JH94tqg/4I8xtSaljA4CyTQ8dyBF1oojjnn+T1ALgv CNZbrbe4cvQWWcDHZLg9IiWiVHukCtdAOR6dzZPGMJXLTEjwCdU1sgmzgz3guK27+wAP DK9+DHuepJl8OM1CfxTzBlu7dfcv4/CSkG9JhjBdWy3+yaNmHpOpxgUO65HqYfw4WwZr oXxU1boaOKbfkoDGsnjU8CmrO0W8vmLIqk3dT1AJ8WFHRkj8awY0XaJvBzkAdW+jnJvU XqBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=all81ubQzTKgRnk+PwTVcGJCyDf8WHC0oSVvyF6FtsA=; b=LMjSn9nGzARoaf613LPFhMOShSDMzggGBSsujtK0rjIm3NJJLccrh6o3/ciPFyVHjW LixV4RU7222K+gSdLq28wk7nzKCm6lp4Uk2CPO5cg8hqrvdJDWyFmUNMrRDxI/MYKr84 EqzN4LeVSLo52zJNE13FaGAGU3h5MRoOnh9CvJiwV+L81zH/Wi7ifsC9Z3BUNjQmkWd7 vbwCc6+JUZuiiPF6/H4NPmGh0Gwj5hX1hdGgBzvpeAhE5fAHQlgfpk4iTMv744LBP0cf e29SDjUHIa45hjstqd6dOnCrpUU/uWmZNXwdY+3297ZH36Ea/JAssepn4Q5uvo7mgax3 Obqg== X-Gm-Message-State: AOAM533+epcPfLnCDnlTYVWmC8L7nFyLeIHDEtTLNen55OXJhe+inY9O 5J1jWjcg0qGNYTe7SVqvsGjMn0P+OYFJuA== X-Google-Smtp-Source: ABdhPJxRQCwwvMO9px+f+kzCFYft3P1EThENQ5hWoK0bCAEquxy2GDgOMPP5fxb5fFsivEosJKt9yw== X-Received: by 2002:aca:670c:: with SMTP id z12mr3081786oix.131.1621637103389; Fri, 21 May 2021 15:45:03 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id i18sm1433185oot.48.2021.05.21.15.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:03 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 05/11] doc: asciidoctor: add linkgit macros in man pages Date: Fri, 21 May 2021 17:44:46 -0500 Message-Id: <20210521224452.530852-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Fixes the doc-diff: - Please see git-commit(1) for alternative ways to add content to a - commit. + Please see for alternative ways to add content to a commit. Comments-by: brian m. carlson Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index b36317e4d2..6c4153f628 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -10,6 +10,8 @@ Asciidoctor::Extensions.register :git do elsif doc.basebackend? 'html' prefix = doc.attr('git-relative-html-prefix') format = %(%1$s(%2$s)) + elsif doc.basebackend? 'manpage' + format = "\e\\fB%s\e\\fP(%s)" elsif doc.basebackend? 'docbook' format = <<~EOF.chomp From patchwork Fri May 21 22:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274065 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=-20.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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 F133FC04FF3 for ; Fri, 21 May 2021 22:45:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D40EF613AF for ; Fri, 21 May 2021 22:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbhEUWqf (ORCPT ); Fri, 21 May 2021 18:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbhEUWqb (ORCPT ); Fri, 21 May 2021 18:46:31 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1354DC06138A for ; Fri, 21 May 2021 15:45:06 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id s19so21103848oic.7 for ; Fri, 21 May 2021 15:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0UHkz8iIyqQOrGKccEIv1QFJPRJOSrxTYI4GYhpVDPM=; b=EgRzlADmgbjQ13HFfTf8gaXy6FID+NF5+U4IoeOXVxg0q/QvbIjeiNjL2RhBxSz10A TwOJ/Fk2gUOCZ3iWbrrCnfGwLIq+xcgkYOSzSo9vyvIkbpfL+fEdioyonjBZGpJ3b+5E 7LwqiuoBwEU900AZ9PrkdhtL5tVF+7Q2T+h5gYw6IQw2zLNlFreXSnNDnjAuQaNX6z2t B4Yxj2SxApPHzNG+PwLWVpP9uSMM5LUuHKftyxep4ZtTdQ66fdhfmKDmI+0mq8SrCdFp Ot/ZNnc0DUBcHotSTVaUPA1k39hYclCiJq3qomTbJaCB2nObQDygj9dHPRgG9ljh0CVx oAgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0UHkz8iIyqQOrGKccEIv1QFJPRJOSrxTYI4GYhpVDPM=; b=Jfex1NJTH3ypQdbZwAIkBYjbQR7JH3EWJ1vcwhuPIHcM0cNgb5H4oK0O3/RQdrxvK1 CeqfIB6RgALEhZjqf8ixWPKF9gTrYOzxN2UxZXYFeHOErW49s0CY9DV3JKUiSl1OFLyG 7/jJijiIpJgEU76pHLE9jb5r4ZWeQAMD63YovcSsE16bgaYB0W3qMhZXvly85JIu3v3M iIKRm1owwDymhntViOrYrRo3bonpavn61sWdQHODkarS1q5whF65d2Afx18t/L2nQlGN Z6t0VSa+I3XSKx0IVVReshVnCy+zBdSVUlaCFeZ/YWYCJiKDZlaTziwIh3HUpXeIjQUF KN/w== X-Gm-Message-State: AOAM533VtUeyCjEavSd6EMd3s8LXQYx2YOU5vZWjXIXgsX8PQC5wNYX/ frURZwl4p2ybiEkX1VxNnAj3pNNYG0jKlg== X-Google-Smtp-Source: ABdhPJyXMRLOpdMXsvCjJOwLOZdqeujCQtfzdftDOZh7uXDmFGkqQONWsP8cljUGX/IcdNcIaF8e9A== X-Received: by 2002:aca:c488:: with SMTP id u130mr3831281oif.0.1621637105207; Fri, 21 May 2021 15:45:05 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id x11sm1555561otr.36.2021.05.21.15.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:04 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 06/11] doc: add man pages workaround for asciidoctor Date: Fri, 21 May 2021 17:44:47 -0500 Message-Id: <20210521224452.530852-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Currently asciidoctor doesn't convert number character references (&#xx;) correctly for man pages. This hack fixes the issue with minimum changes elsewhere so it's easy to remove when fixed. Fixes doc-diffs like: so line count cannot be shown) and there is no difference between indexed copy and the working tree version (if the working tree version were also different, binary would have been shown in place - of nothing). The other file, git-add--interactive.perl, has 403 - lines added and 35 lines deleted if you commit what is in the - index, but working tree file has further modifications (one + of nothing). The other file, git-add--interactive.perl, + has 403 lines added and 35 lines deleted if you commit what is in + the index, but working tree file has further modifications (one addition and one deletion). https://github.com/asciidoctor/asciidoctor/issues/4059 Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 6c4153f628..954acb3e7d 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -4,6 +4,12 @@ Asciidoctor::Extensions.register :git do doc = document + # Override attributes for man pages. + # https://github.com/asciidoctor/asciidoctor/issues/4059 + if doc.backend == 'manpage' + doc.attributes.merge!({ 'litdd' => '\--', 'plus' => '+' }) + end + inline_macro :linkgit do if doc.doctype == 'book' format = '%1$s(%2$s)' From patchwork Fri May 21 22:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274067 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=-15.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,USER_AGENT_GIT 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 06A00C04FF3 for ; Fri, 21 May 2021 22:45:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1569613D9 for ; Fri, 21 May 2021 22:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbhEUWqh (ORCPT ); Fri, 21 May 2021 18:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbhEUWqb (ORCPT ); Fri, 21 May 2021 18:46:31 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E83D0C06138B for ; Fri, 21 May 2021 15:45:07 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id d25-20020a0568300459b02902f886f7dd43so19451920otc.6 for ; Fri, 21 May 2021 15:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xMr/M2H+/xTS3m/c7EfC9R05xf/aVqzTD3RUu/gKXgk=; b=gXcm9Q4zi4FOAavlbLssbx3/x9D2BRmQloO6fgs5vABOiEZ/zJAfeiJkoYfQGXE8Bo CCxdLzuEOVfODM69TydfQflttbSav2cVe8AQjJ63iTbBeuhwUxAVuWZs91uzot9KcFS7 Bcuihf3fpWUcHljY1hc7WtdK44am9SDIC1k327YZfwEtqTB1bkUy1umZWzkRNFgCvPbK /tWVll/ZDmcty7LdeFo78zSAhZ4PrAdmTmeKEDkWZ5WeyMRHzrNKdIWzNDRn4gYq7F22 4WRad871oX2hhEfsLJdVv4wdRzlIqJP0v4d/zPAokOsicF+OiiJu/kSLLdoPAZ5TkZEA /8Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xMr/M2H+/xTS3m/c7EfC9R05xf/aVqzTD3RUu/gKXgk=; b=IYVZpQeKnQN43CEm68NM1TW8NQr1mHY2bTahlB39ax2QYnqqtoVxHuyhBcC0D0hARZ Sh2lewcxLLNwxFuPBxxTPS7ZnbhcDiuAUQafZ2tVoC1D/O7KlveGJdkdvCzuyCJuKdgY xa9MqsrdICkEjPFDFAVIcGjK1DELj+0t0tL+6iXftNKRVi3I0MFDqowSq2gHl/yUJYkN MAbxFhTmk22vYux4Rtwwlc6yQfDWaUzoSVFscVIlw1nl6KK//hI8yyI4d2Br24Y4BkVj OrLAvXS0UtJdvSLLj03ocYTd4XIh8rrNuIp/TsvqE1fkRpmqAXxWfJQZjmyrDgx77syi 0ZWA== X-Gm-Message-State: AOAM532ibOis4duJq/iQj2tWgYQ3qSBtvjZfz4cQQaLEj18BOzmJgm2x G+H7YKRAnwbtWzfARVHbZA1eDbqGligbqw== X-Google-Smtp-Source: ABdhPJwsq533xIQoxT5ohV6j/NA6dRwHTavYrkdL9RH1YaCCYZKaezJkWX4qaNp3wSTP7uOjrU8z8Q== X-Received: by 2002:a05:6830:1556:: with SMTP id l22mr10184373otp.34.1621637107090; Fri, 21 May 2021 15:45:07 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id i2sm1557414oto.66.2021.05.21.15.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:06 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 07/11] doc: asciidoctor: add hack for xrefs Date: Fri, 21 May 2021 17:44:48 -0500 Message-Id: <20210521224452.530852-8-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The docbook manpage stylesheets convert cross-references with format the 'section called “%t”'. I personally prefer the asciidoctor version, but for now add a hack to minimize the diff. Thanks to the extensibility of Ruby we can override corresponding method in the man page converter. This fixes doc-diffs like: --worktree-attributes Look for attributes in .gitattributes files in the working tree as - well (see the section called “ATTRIBUTES”). + well (see ATTRIBUTES). This can easily be removed later once we are confortable with the asciidoctor version. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 954acb3e7d..7561973df6 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -1,4 +1,22 @@ require 'asciidoctor/extensions' +require 'asciidoctor/converter/manpage' + +module Asciidoctor + class Converter::ManPageConverter + alias orig_convert_inline_anchor convert_inline_anchor + def convert_inline_anchor(node) + case node.type + when :xref + return node.text if node.text + refid = node.attributes['refid'] + 'the section called “%s”' % refid.gsub('_', ' ') + else + orig_convert_inline_anchor(node) + end + end + alias inline_anchor convert_inline_anchor # For old versions of asciidoctor + end +end Asciidoctor::Extensions.register :git do From patchwork Fri May 21 22:44:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274069 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=-20.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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 9A7C9C04FF3 for ; Fri, 21 May 2021 22:45:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E858613D8 for ; Fri, 21 May 2021 22:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhEUWqn (ORCPT ); Fri, 21 May 2021 18:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbhEUWqe (ORCPT ); Fri, 21 May 2021 18:46:34 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFC3C0613CE for ; Fri, 21 May 2021 15:45:09 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id j75so21076792oih.10 for ; Fri, 21 May 2021 15:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ah1uZyMfekda9/51uIF9gClbdy4GBKNVOInO4OL5mhY=; b=ScCHMcafpRko3KSNpTfqVr7e71VxPXmbH/l9eblLMdnfHrgjN3Cb/RQS0HFcBLM5Ep hEt8cS1wQTbOvExsw7fBWBcWguNJw/9JR0/GNtVmdsG112k8tguI9TmVp6FYRdfHbs4B lFw1MJ2ekvEGc2JXRb02NT/Louj4mkjBXenS94VOyciWVgy9b6otvnVux+T8EkR5mQUL 0hXt1OqbeRTAdth5qCxmHRlpbZWp+KMSaX46RIZWKwa3MGpFI2gJuBlPgl6sZB50P1xl XKtrw/afvYjE9yhYPm/6Z2zgH8QEmnxth6L5oF5Z04WLaSs51uETLPqQqkO4/KnY9EVm h88w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ah1uZyMfekda9/51uIF9gClbdy4GBKNVOInO4OL5mhY=; b=E1qJE+4St65XbFJ1hC/CsBi/POxrIopUOxuL0tem7TXDIjzNBICARmq6fgoyynnA6+ muDGdNcT8VlEJZF/NTiJDIZOTyku1Gm+uN3OnUHZkvyICG5E5heZ+JyZJAhhhpiTGS3A Bsc54Gi6c8+En5TV+7ImBC76UJCdGPBDpmMtoDBIBPA6s3CVKalV7Rof9P/NFEaDXYHl msX9SK2oMaIcGz+YsJLcm3VkfXp9u1UQjLHQ97Zp1JHiPR+OFw+idfa69DYR7ivYdJCg rrmezWiWf44zcbQuf7aSe9+VoedttrLna41WWB1VY1ZcA5kjhb+KWC9iGdKXhl7Lm5U4 kTRw== X-Gm-Message-State: AOAM530JImstiw56OvSNebF/ouJCDPdRS0VblEOvWBU15udZl0YFEpwp VrrIyT/Q1oPH5166xlAHmLjCetTcD+H4jA== X-Google-Smtp-Source: ABdhPJyzHYK6Zhq5vA9+HwXhiaRKAWbVvwRV69HuhqXal5dPhvBaUsAJPR98W/EY2HFFBqdtw/7P8Q== X-Received: by 2002:aca:1718:: with SMTP id j24mr3679150oii.81.1621637109024; Fri, 21 May 2021 15:45:09 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id v28sm1495945ood.27.2021.05.21.15.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:08 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 08/11] doc: asciidoctor: add hack to improve links Date: Fri, 21 May 2021 17:44:49 -0500 Message-Id: <20210521224452.530852-9-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The way asciidoctor handles links is very primitive compared to docbook. Links are simply presented in the format "#{text} <#{target}>", which may not be all that bad for the future, but pollutes the doc-diff. By adding another modification to convert_inline_anchor() we can present links in a form very similar to docbook, diminishing the doc-diff. This significantly reduces the doc-diff: From: abysmal performance). These safety and performance issues cannot be backward compatibly fixed and as such, its use is not recommended. Please use an alternative history filtering tool such as git - filter-repo[1]. If you still need to use git filter-branch, please - carefully read the section called “SAFETY” (and the section called - “PERFORMANCE”) to learn about the land mines of filter-branch, and then - vigilantly avoid as many of the hazards listed there as reasonably - possible. + filter-repo" . If you + still need to use git filter-branch, please carefully read the section + called “SAFETY” (and the section called “PERFORMANCE”) to learn about + the land mines of filter-branch, and then vigilantly avoid as many of + the hazards listed there as reasonably possible. -NOTES - 1. git filter-repo - https://github.com/newren/git-filter-repo/ - - 2. filter-lamely - https://github.com/newren/git-filter-repo/blob/master/contrib/filter-repo-demos/filter-lamely - To: NOTES - 1. git filter-repo + [1] git filter-repo https://github.com/newren/git-filter-repo/ Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 7561973df6..914e6f64c8 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -10,6 +10,19 @@ module Asciidoctor return node.text if node.text refid = node.attributes['refid'] 'the section called “%s”' % refid.gsub('_', ' ') + when :link + return node.target if node.text == node.target + doc = node.document + + footnote = doc.footnotes.find { |e| e.id == node.target } + if !footnote + footnote_text = "%s\n\e.RS\n\e\\%%%s\n\e.RE" % [node.text, node.target] + index = doc.counter('footnote-number') + footnote = Document::Footnote.new(index, node.target, footnote_text) + doc.register(:footnotes, footnote) + end + + "\e\\fB%s\e\\fR[%d]" % [node.text, footnote.index] else orig_convert_inline_anchor(node) end From patchwork Fri May 21 22:44:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274071 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=-15.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,USER_AGENT_GIT 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 5FD4DC4707E for ; Fri, 21 May 2021 22:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 313B5613AF for ; Fri, 21 May 2021 22:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbhEUWqn (ORCPT ); Fri, 21 May 2021 18:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbhEUWqf (ORCPT ); Fri, 21 May 2021 18:46:35 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E9C4C06138E for ; Fri, 21 May 2021 15:45:11 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id v19-20020a0568301413b0290304f00e3d88so19449182otp.4 for ; Fri, 21 May 2021 15:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b1yCu4/hV2BR/zfanL7W8lWbqh32GElVDBuizt+GdKI=; b=QGRxtl9GC6JhvcIsVe+g4Mv7XtxTzrkReSASDNjLX8ea2cK34z9nTS6Ir8262wOVym W67YAtCYjScHs3Prq2HqYywFpaX8ItUB+EsN5CahmO389Sb0S6NbrADidE1DZmJ/gQdB bFnQKf49Y6OjJyq4pvI2w0zXS52L2qwcwYWvvnc0LyYvdCRFmzmDBaim405Hp+eWLshb udHjP34Q8bsEFofkgShPZnG9Ij5i3LmqbFHPbLK63WkqHbXMe4hEDWXoA3gq58Uf6li/ 4Bv9VVZeZRWPeKdFgVzEbl5oVb8AGkl3Lu9aUjBFFpJBb9ghCraNorWwxg1TFGbyeHhw uokQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b1yCu4/hV2BR/zfanL7W8lWbqh32GElVDBuizt+GdKI=; b=nc9t9lsJHurk8NK0nEk2QhdFWNYZNpsHKs0VR96kDCVbGbcTUY5XVufA0Wli5IA4Fc M7Ku+63ACNa0FCFP5yc5LACHwJFHwntHjX8eToJm84ZguMAUtum0qVQCKqJdoP8msIyZ LzHPQNgJpoZwOX2xJnJsoQITGGyxLdvoGl0oHlxrZP42L3vL/tA1KfoWzh2vLQfWoctL oMasJafsuxYL2viObmN96ffk6s7ii69Rm0BJGQAcnRE6//y3/2EEG1ZVtTxAW8lw0APm OpvmqWvKZSh6LrWft7s0W3NLIPBdO5ZQ36TgL/Pecl28Qvgday1PE49FkHXKu9Ad7UiH lsIQ== X-Gm-Message-State: AOAM530xBC3kFasAOjvObBzofVBz3VLBaQzCn0zmOD/dw56xLv4kxDIS oBYSR7jrbgHaXWv8sRagKu8KTo2KCkbfiQ== X-Google-Smtp-Source: ABdhPJzQwhc+fs8NW8h97GCh7LUqMEdx5icWB/S7Ht2ABUdvV1Gbgi9q3gZSDzH0xFi53m2JsQMFJw== X-Received: by 2002:a9d:77c7:: with SMTP id w7mr10264393otl.364.1621637110640; Fri, 21 May 2021 15:45:10 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id o13sm1556441ote.32.2021.05.21.15.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:10 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 09/11] doc: asciidoctor: add support for baseurl Date: Fri, 21 May 2021 17:44:50 -0500 Message-Id: <20210521224452.530852-10-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org So that we can present relative links correctly. Reduces the doc-diff: NOTES - 1. “Understanding history: What is a branch?” - file:///$HOME/share/doc/git-doc/user-manual.html#what-is-a-branch + [1] “Understanding history: What is a branch?” + user-manual.html#what-is-a-branch NOTES - 1. “Understanding history: What is a branch?” + [1] “Understanding history: What is a branch?” file:///$HOME/share/doc/git-doc/user-manual.html#what-is-a-branch Signed-off-by: Felipe Contreras --- Documentation/Makefile | 1 + Documentation/asciidoctor-extensions.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 0c654f4ec9..c28c49dd7a 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -185,6 +185,7 @@ ASCIIDOC_DOCBOOK = docbook5 ASCIIDOC_EXTRA += -acompat-mode -atabsize=8 ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;' +ASCIIDOC_EXTRA += -abaseurl='$(MAN_BASE_URL)' ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS DBLATEX_COMMON = XMLTO_EXTRA += --skip-validation diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 914e6f64c8..8856f2febd 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -16,7 +16,9 @@ module Asciidoctor footnote = doc.footnotes.find { |e| e.id == node.target } if !footnote - footnote_text = "%s\n\e.RS\n\e\\%%%s\n\e.RE" % [node.text, node.target] + target = node.target + target = doc.attributes['baseurl'] + target unless target.include? ':' + footnote_text = "%s\n\e.RS\n\e\\%%%s\n\e.RE" % [node.text, target] index = doc.counter('footnote-number') footnote = Document::Footnote.new(index, node.target, footnote_text) doc.register(:footnotes, footnote) From patchwork Fri May 21 22:44:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274073 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=-15.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,USER_AGENT_GIT 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 1B10DC4707F for ; Fri, 21 May 2021 22:45:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2B70613AF for ; Fri, 21 May 2021 22:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbhEUWqo (ORCPT ); Fri, 21 May 2021 18:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhEUWqh (ORCPT ); Fri, 21 May 2021 18:46:37 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2349BC061342 for ; Fri, 21 May 2021 15:45:13 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id s19so21104064oic.7 for ; Fri, 21 May 2021 15:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+PF8VNqX3CxWZcWikvCpbjoN5l4qx72eHU1ZnJexGhI=; b=N3mB5LMfXIOHmeqeD3mBtsmH1dfB4VECYix3mImt1uvm+jo2ieIcoP9cjMtiSQMSI+ VKWskP3l5awX4fypURqSf858HHtTNtdlXeG4b5uL5ZRXvBS7gLnQMBqUTnbBSGdSCO0j Swr3/L1swXASpxvyRJVqx1peVZ7stZhRenR+J7x8hyUMSqXKdc3RonXVAwmFlXR3D3RN 7kLMZ1z24Cv8VHc4lQRyFzHylNO0aVZ3l8Of/EAlIASn1WOPf4OQ+Ybiav9zz0TAKaH5 UR+KE5WNmG8Oc7pTx+6rpn5to7T1ZnaVGBtNk8gXoD7LP4XGbuVVKMVXeEOTpmwpdobX rkDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+PF8VNqX3CxWZcWikvCpbjoN5l4qx72eHU1ZnJexGhI=; b=Cj0YPCxBBA+0hBF14C2peS6dRgsOUQL/GfoIelARuDX66P0Hpditve+uFeonOcYUWr FY6Q5gJV91ICdg/djgxpCyctA89CDimhTWVqQ9esYpEYrqdiXMUjKy3TDYaiok4wk9SK /mq5vWRGEpcNFFGfmltPe7S8PjttOrZOm3quzkFnuhLLSZP83DfGxOn8IHezFHIqByNd o4ffSp78UKS5+PA2KX/fPz9sKV7uA4WsNfhY4SWZFxPjxytUutIJ9IYrCcfjUDLQvM9i qGbJzK4oun+Mvt5EY0KNoFWvFEvwb3mQ45+7u8PP1Gqv+jOSogZFL+Az5czf0d+tKEgd t96w== X-Gm-Message-State: AOAM531WnKUjdbuR6+GParVc0Zat8CtFflsOW8ctC0Fe1qQfbjrcMNVR sMvMWz6saSFvE7bd5nfUwDNeBuqF/cPMUg== X-Google-Smtp-Source: ABdhPJzwlUJMuwUxuwq9cOQtvjy8Ta7inUL0neyx4TO+6H6trf1CYDAk3raNH4NZ8MqXeErKzElVxQ== X-Received: by 2002:aca:f207:: with SMTP id q7mr3830068oih.24.1621637112310; Fri, 21 May 2021 15:45:12 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id s76sm1366847oie.50.2021.05.21.15.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:11 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 10/11] doc: asciidoctor: cleanup man page hack Date: Fri, 21 May 2021 17:44:51 -0500 Message-Id: <20210521224452.530852-11-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's basically nothing we need from the original orig_convert_inline_anchor(), so let's remove calls to it. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 8856f2febd..e48a381b8f 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -3,7 +3,6 @@ require 'asciidoctor/converter/manpage' module Asciidoctor class Converter::ManPageConverter - alias orig_convert_inline_anchor convert_inline_anchor def convert_inline_anchor(node) case node.type when :xref @@ -25,8 +24,10 @@ module Asciidoctor end "\e\\fB%s\e\\fR[%d]" % [node.text, footnote.index] + when :ref, :bibref + '' else - orig_convert_inline_anchor(node) + nil end end alias inline_anchor convert_inline_anchor # For old versions of asciidoctor From patchwork Fri May 21 22:44:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274075 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=-20.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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 7C636C4707A for ; Fri, 21 May 2021 22:45:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67195613AF for ; Fri, 21 May 2021 22:45:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbhEUWqp (ORCPT ); Fri, 21 May 2021 18:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbhEUWqi (ORCPT ); Fri, 21 May 2021 18:46:38 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1EE5C061343 for ; Fri, 21 May 2021 15:45:14 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id i23-20020a9d68d70000b02902dc19ed4c15so19512619oto.0 for ; Fri, 21 May 2021 15:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gfbHvtlRq11FJYnsvJy5U489QiIh3UR4mNbnDEZI4T0=; b=r0heu9HZ5SLsMFia3r+9pA3EYW9vLv1YP5YtNKvuN/63+pop05Yj129dAaCeLuY/t/ b/FbFM+D5sOBriVaS+AnQJWrF6fP11gjZ7V68lG0OLCT6etQ0imAxSMbUX7r26V7JwLO lPYlHwB1vH/Mi4cKwHdEbhKCOukTB4Fgv6tkjb4HX5Pkj4esddiZf5rQv2RwJWnCTacF NjGDRRKzrTPpNVqd+cdf9KzPhr/bBmTsGcyXvPp7wtPx3SREf8yIExoQwEBkIXKHVbfz 6SWGQmuH5dOAPFIm37w2dkOpBiUBAPzSp+eFP+3cQF0jTojhgCA/Lt5mFii6N7qGqh7h o3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gfbHvtlRq11FJYnsvJy5U489QiIh3UR4mNbnDEZI4T0=; b=Z2g8hVInctc9j0o8kBncTxMgcSCKa3cdnBW7IC+m8LsSVEkU6siYjWC5vRpXf25Hob hsM+VIgnEFgiosC6cB3c/1U23WNqjdBEvrIuah0quiO+WWZGec9CjaZ45b7Kdtp3So+D yq+QEwZcB6xqCrzHOkuEQdtKoyP5Gbs3NxtWBoM1sn/VidRTV0CqyC7MnOKQfDavNHIA VvYGkK+J6L05MepBwsyscEonZvSH/nUUTbY/O4VmhiVwFmKJWyZd53HSMJwFwdG0YmBw aIJTjnBmtA/H0BBicyGBpEtIGssdQF3WuaN/GW1sIK1aioClqcUmehPQ9WpWAWZco1WI VsGA== X-Gm-Message-State: AOAM5332MyRIHgAXLAlHXC+JxA1/KGezCVidkBMtEtqKY+Dsxjl2ijV5 Ea4ekhTR+3bh2kfA9pXF+R50eAlci5iL7w== X-Google-Smtp-Source: ABdhPJwkYMmEWxuG95JRIfOF5pRKQY8AcgZKg6oYbrbDn02FAI6DUwnYZO268iXpOHk0t3H9/6x9JA== X-Received: by 2002:a9d:4b18:: with SMTP id q24mr10225105otf.88.1621637114133; Fri, 21 May 2021 15:45:14 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id 67sm1516856otp.68.2021.05.21.15.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:45:13 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Felipe Contreras Subject: [PATCH v2 11/11] doc: asciidoctor: add hack for old versions Date: Fri, 21 May 2021 17:44:52 -0500 Message-Id: <20210521224452.530852-12-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521224452.530852-1-felipe.contreras@gmail.com> References: <20210521224452.530852-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org \\ gets converted erroneously. [1] https://github.com/asciidoctor/asciidoctor/issues/3456 Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index e48a381b8f..3ab669dad8 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -38,10 +38,19 @@ Asciidoctor::Extensions.register :git do doc = document - # Override attributes for man pages. - # https://github.com/asciidoctor/asciidoctor/issues/4059 if doc.backend == 'manpage' + # Override attributes for man pages. + # https://github.com/asciidoctor/asciidoctor/issues/4059 doc.attributes.merge!({ 'litdd' => '\--', 'plus' => '+' }) + + # Fix bug with \\ + if Asciidoctor::VERSION < '2.0.11' + postprocessor do + process do |_, output| + output.gsub("\\(rs\\\\", "\\(rs\\(rs\\") + end + end + end end inline_macro :linkgit do