From patchwork Tue Sep 3 18:51:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11128595 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 76F321398 for ; Tue, 3 Sep 2019 18:52:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5639B2168B for ; Tue, 3 Sep 2019 18:52:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dPg98rQ5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbfICSwC (ORCPT ); Tue, 3 Sep 2019 14:52:02 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:33012 "EHLO mail-lf1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbfICSwC (ORCPT ); Tue, 3 Sep 2019 14:52:02 -0400 Received: by mail-lf1-f50.google.com with SMTP id d10so5863704lfi.0 for ; Tue, 03 Sep 2019 11:52: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=AULD7PLu9SPpQdLLUeec47RhiZ2q3IvEp7NUR1Abzhc=; b=dPg98rQ5ArnuJ58GEOjpfs6wSsL3Pset1ZziIzPszOLOHFtHeyvSobAPqDwDXtTQri 7L7Q5k58eGoY9vQNN4SYFv0SiD0jcd5A4JObr6elgU+gPjCndlEaKszrsNwwwRSzLt1K eP/3hiKicROZHL0DdnbUA6gDZN0Ox3BRhNTbiF0uN+ICoc3OrjPyy6zoJUmX4XEkjEBt lV9GAxfqdTBiEjBKO+vZ2JTTGpwLRpiTP6IegLMvam0VaI1LvrnNZ8VkL3kexhAW4dbM B/FywMJkVydQZ7BJXqbmqxcwfQr1fe+1ZnqrNgoMcGpj7Y0omEy7f9FbtwKqVpJOex93 I3XA== 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=AULD7PLu9SPpQdLLUeec47RhiZ2q3IvEp7NUR1Abzhc=; b=cSA/XtuZDPjiZs4otKTxXRe/Z4L1yGrg6AXA+CYPupZVsNyTURe74wQS0WhPbG4sC5 PuSdql6rTxsdW7url0x+s6VL49cp4F4DVxWbScnEC8hBZdTyaMRyBMl90tcbFxTpO2lh 8js/GoHyylfiYTEQqx79DLZW99IUe42lFaqMB64NAJwXjLsMhpivih2oaMAnDfPUAm9v gwLRExT+NWR4Dw8FsBuxLEQpY7CIiI74hzNAp8ppx4cIvF/cH8gDdnyd7kTy7ZXobDgj Ok12d8YyoULm7Cbk+MRyRTDL3xnn0ZVCnIwqPOVjjEV+mc77Gf1jpXrRZlTZZew/n+nF synw== X-Gm-Message-State: APjAAAXGoPYcvv6PbpyUKVo34oefsx7zbUL83i/4TEHTNfu2X+gNqa8k JrHqj9ZMfwVNgtY80tH/6hSA51sJ X-Google-Smtp-Source: APXvYqyJLBwooxdpbQ/bMSQnt/A+96DskuNNS0ulyNsScPa0cdtQUnjvyFrK5LRo8bm2+FAbWyZ1gg== X-Received: by 2002:ac2:531b:: with SMTP id c27mr9179048lfh.107.1567536719516; Tue, 03 Sep 2019 11:51:59 -0700 (PDT) Received: from localhost.localdomain (31-211-229-121.customers.ownit.se. [31.211.229.121]) by smtp.gmail.com with ESMTPSA id s21sm2971443ljm.28.2019.09.03.11.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 11:51:58 -0700 (PDT) From: =?utf-8?q?Martin_=C3=85gren?= To: git@vger.kernel.org Cc: Todd Zullinger , Jeff King , =?utf-8?q?SZE?= =?utf-8?q?DER_G=C3=A1bor?= , "brian m. carlson" , Junio C Hamano Subject: [PATCH v2 2/2] doc-diff: replace --cut-header-footer with --cut-footer Date: Tue, 3 Sep 2019 20:51:21 +0200 Message-Id: <40f3c4c3a9ce5e9152477b66016831be0b040310.1567534373.git.martin.agren@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org After the previous commit, AsciiDoc and Asciidoctor render the manpage headers identically, so we no longer need the "cut the header" part of our `--cut-header-footer` option. We do still need the "cut the footer" part, though. The previous commit improved the rendering of the footer in Asciidoctor by quite a bit, but the two programs still disagree on how to format the date in the footer: 01/01/1970 vs 1970-01-01. We could keep using `--cut-header-footer`, but it would be nice if we had a slightly smaller hammer `--cut-footer` that would be less likely to hide regressions. Rather than simply adding such an option, let's also drop `--cut-header-footer`, i.e., rework it to lose the "header" part of its name and functionality. `--cut-header-footer` is just a developer tool and it probably has no more than a handful of users, so we can afford be aggressive. Signed-off-by: Martin Ă…gren --- Documentation/doc-diff | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Documentation/doc-diff b/Documentation/doc-diff index 3355be4798..88a9b20168 100755 --- a/Documentation/doc-diff +++ b/Documentation/doc-diff @@ -21,7 +21,7 @@ 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-header-footer cut away header and footer +cut-footer cut away footer " SUBDIRECTORY_OK=1 . "$(git --exec-path)/git-sh-setup" @@ -31,7 +31,7 @@ force= clean= from_program= to_program= -cut_header_footer= +cut_footer= while test $# -gt 0 do case "$1" in @@ -55,8 +55,8 @@ do --asciidoc) from_program=-asciidoc to_program=-asciidoc ;; - --cut-header-footer) - cut_header_footer=-cut-header-footer ;; + --cut-footer) + cut_footer=-cut-footer ;; --) shift; break ;; *) @@ -118,8 +118,8 @@ construct_makemanflags () { from_makemanflags=$(construct_makemanflags "$from_program") && to_makemanflags=$(construct_makemanflags "$to_program") && -from_dir=$from_oid$from_program$cut_header_footer && -to_dir=$to_oid$to_program$cut_header_footer && +from_dir=$from_oid$from_program$cut_footer && +to_dir=$to_oid$to_program$cut_footer && # generate_render_makefile generate_render_makefile () { @@ -169,12 +169,11 @@ render_tree () { make -j$parallel -f - && mv "$tmp/rendered/$dname+" "$tmp/rendered/$dname" - if test "$cut_header_footer" = "-cut-header-footer" + if test "$cut_footer" = "-cut-footer" then for f in $(find "$tmp/rendered/$dname" -type f) do - tail -n +3 "$f" | head -n -2 | - sed -e '1{/^$/d}' -e '${/^$/d}' >"$f+" && + head -n -2 "$f" | sed -e '${/^$/d}' >"$f+" && mv "$f+" "$f" || return 1 done