From patchwork Fri Apr 12 12:00:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5779E17E6 for ; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35CB928E5D for ; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2ACAF28E61; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D12028E5D for ; Fri, 12 Apr 2019 12:00:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbfDLMAe (ORCPT ); Fri, 12 Apr 2019 08:00:34 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42098 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbfDLMAe (ORCPT ); Fri, 12 Apr 2019 08:00:34 -0400 Received: by mail-ed1-f66.google.com with SMTP id x61so8074879edc.9 for ; Fri, 12 Apr 2019 05:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:mime-version :content-transfer-encoding:fcc:content-transfer-encoding:to:cc; bh=fsRXmxsHknzStyOSzfru5tYTFJds2VIn7azXyKABgfM=; b=KmSXFKFpzrn9mlWp350XEamIu9Oq8nJRYjmFyYDkahJzo+XCl/ZtzOB6TTLIdRApoA lhNkKB2lXFJcH0Rthgs3KKjiARkiiFlg3apV0sReydy78UaZ4XVs0/NWuNZz7ZDm2OyS t8viWBIUJkY52Gm4cR664D/YyqNUjAmXuOrJCtQiMaDMNq284kkKkyYDLB0c/k32g20p krwVHOugXt8bEG1Al9y/RwYnrTImPYi8e4woYHTZ2SI/iw5JN8oSVIDjnf0QRMMo0TsP g1SBE0k21gf1tmsrsT86TpHUH5gpdvwirZkccY1lJv02mXuep7LS0CZVLRkYEi1TlDxB hWsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:mime-version:content-transfer-encoding:fcc :content-transfer-encoding:to:cc; bh=fsRXmxsHknzStyOSzfru5tYTFJds2VIn7azXyKABgfM=; b=Je1OaEp+PDlrmH6y6OWKgLNlgcr6vD1UTBGqLrA0PE/mGkW/6XXrhswTpj8VWw2xq8 PC2M0N6XbpXxTXKwE5TbbxhrEvF6lkmGEnOHXtwCcaFQB9o3mlptDadh+WCkO5kpGN83 tNwkQZnusrpw+KzXgh/v1LwzPKqvar+aWIQ4JFPmSvGmvih+vRE5jNjIy614p1qvQ5bs c9sEaXdTsa3RSOHg7nXJNx2dcTNUYftgdifjk+RWlVkfsrbghUsa2lAcVnxfdG5DDtF/ 5rdKMu9gax1EpxQiLnUCBJKsSq3TmsqGLtwdZgMrXjLrB0Zoo9N6pxBVq2PXIYFASSlG U3mw== X-Gm-Message-State: APjAAAUqHrO2JSJ2NfY77JyWbhizjyg30GPUo/BCGUecwNkc1UBfMsZe fj3Vyqjq4PlyhRZvXJKP/Viuk7US X-Google-Smtp-Source: APXvYqz/yiBRIY62zGTmnWXMecikFq9bpBi/EkqUU7M95Wc7g8/KDE8ejMQPkXsSOG+xhWgCV5UR8A== X-Received: by 2002:a17:906:4c4e:: with SMTP id d14mr22335932ejw.127.1555070432370; Fri, 12 Apr 2019 05:00:32 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 25sm7437116ejv.27.2019.04.12.05.00.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:31 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:31 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:24 GMT Message-Id: <81c08b178be6329d51586fa9d615063d3c6f9625.1555070430.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 1/7] remote-testgit: move it into the support directory for t5801 MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin The `git-remote-testgit` script is really only used in `t5801-remote-helpers.sh`. It does not even contain any `@@@@` placeholders that would need to be interpolated via `make git-remote-testgit`. Let's just move it to a new home, decluttering the top-level directory and clarifying that this is just a test helper, not an official Git command that we would want to ever support. Suggested by Ævar Arnfjörð Bjarmason. Signed-off-by: Johannes Schindelin --- .gitignore | 1 - Makefile | 3 --- t/t5801-remote-helpers.sh | 2 ++ git-remote-testgit.sh => t/t5801/git-remote-testgit | 0 4 files changed, 2 insertions(+), 4 deletions(-) rename git-remote-testgit.sh => t/t5801/git-remote-testgit (100%) diff --git a/.gitignore b/.gitignore index 7374587f9d..de8fc2f5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -135,7 +135,6 @@ /git-remote-ftps /git-remote-fd /git-remote-ext -/git-remote-testgit /git-remote-testpy /git-remote-testsvn /git-repack diff --git a/Makefile b/Makefile index 8654c130f8..26f8ed2228 100644 --- a/Makefile +++ b/Makefile @@ -633,7 +633,6 @@ SCRIPT_SH += git-merge-resolve.sh SCRIPT_SH += git-mergetool.sh SCRIPT_SH += git-quiltimport.sh SCRIPT_SH += git-legacy-rebase.sh -SCRIPT_SH += git-remote-testgit.sh SCRIPT_SH += git-request-pull.sh SCRIPT_SH += git-stash.sh SCRIPT_SH += git-submodule.sh @@ -657,8 +656,6 @@ SCRIPT_PERL += git-svn.perl SCRIPT_PYTHON += git-p4.py -NO_INSTALL += git-remote-testgit - # Generated files for scripts SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH)) SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL)) diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index aaaa722cca..d04f8007e0 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -8,6 +8,8 @@ test_description='Test remote-helper import and export commands' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh +PATH="$TEST_DIRECTORY/t5801:$PATH" + compare_refs() { git --git-dir="$1/.git" rev-parse --verify $2 >expect && git --git-dir="$3/.git" rev-parse --verify $4 >actual && diff --git a/git-remote-testgit.sh b/t/t5801/git-remote-testgit similarity index 100% rename from git-remote-testgit.sh rename to t/t5801/git-remote-testgit From patchwork Fri Apr 12 12:00:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FA7517E6 for ; Fri, 12 Apr 2019 12:00:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C4C28E58 for ; Fri, 12 Apr 2019 12:00:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AD6528E61; Fri, 12 Apr 2019 12:00:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 086A328E60 for ; Fri, 12 Apr 2019 12:00:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbfDLMAf (ORCPT ); Fri, 12 Apr 2019 08:00:35 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46425 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbfDLMAe (ORCPT ); Fri, 12 Apr 2019 08:00:34 -0400 Received: by mail-ed1-f67.google.com with SMTP id d1so8069888edd.13 for ; Fri, 12 Apr 2019 05:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=pDAzqZgidp9Ac8078IjNUa202C1/co4UXZSblVoI2mI=; b=VS3MlpsY2pYhibKUAlucqBqhf8u2SknVP7BdzXDXghg436ryvgeGB+zVelGlgiBRJ1 oNIADhHj1gdVBcZaAqMRI0sotHbkrBZu6H/bHOApdtLLNu85gmXw/qYW/VEHdZ4MJKn8 u6o2WsTCVoLN4x+a3LpS95RDOCuSN3KE6B5QLvh5MxcQyvRG87TcfVdFAx3bhycEKdmg YSBsFu5TYUwsWbgyziincMRGlOtkZf9z47Ltuvx9KoRoH2DKwRSjOraLsxxYhTZbBTtX dNgw7jB/fRTDs+SfXvn4SGXTZJO9ndvJvGCqZVhAcjFkSo6F6AchgS3hU9/8cq5U0jWa hFuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=pDAzqZgidp9Ac8078IjNUa202C1/co4UXZSblVoI2mI=; b=XVoBjXDb9/d9lip0+hTJAGvlbMaqEWNhGm9C4lnMOBC1XJvVHu1FICu2uZjklNmNL/ +kWxag1Y4p6P8rcgwXWMj9lEFG+1AHrN0NmDyvlq25boc59a/FzE6eZBATv6yHX+5FPU NJPsbndX8Wn/HBte7dx6qsybuBVubvu6m+145NKB2Kq16Ym7b7UFbA2qZaAbU7o+7Cq4 9WiFMRZ9B8eLMlMZz9DmQMaCP32KSRO99AVynmILJUI9m8N0Mm1dKUNpS5hZiqdhpO8T NQp611dz+kyKZ+tH+jQibibXev4UD8AW0YjZi06Uz20/foc5TqYJqy69AwQpOkQaMa+7 WMJA== X-Gm-Message-State: APjAAAWowxpy4+iE5qauK105wY8+NCEkwtS+gIuazEGsE5bc/2tnWXx5 t/600pN5QsX5WN+F31dDAzdidIMl X-Google-Smtp-Source: APXvYqyK4jOOyoOy1ValeOXCdFLasSz5mNKX6beMix7uocN+K0uskRPVITR41yLo7ztYLm2uQUs9kA== X-Received: by 2002:aa7:d39a:: with SMTP id x26mr13197810edq.48.1555070433296; Fri, 12 Apr 2019 05:00:33 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b2sm10944eds.15.2019.04.12.05.00.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:32 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:32 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:25 GMT Message-Id: <7dc5293e9e0f8997674b1273393f22954e72c4cd.1555070430.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 2/7] help -a: do not list commands that are excluded from the build Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin When built with NO_CURL or with NO_UNIX_SOCKETS, some commands are skipped from the build. It does not make sense to list them in the output of `git help -a`, so let's just not. Signed-off-by: Johannes Schindelin --- Makefile | 14 ++++++++++++-- generate-cmdlist.sh | 10 +++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 26f8ed2228..8f3c477ab3 100644 --- a/Makefile +++ b/Makefile @@ -611,6 +611,7 @@ FUZZ_PROGRAMS = LIB_OBJS = PROGRAM_OBJS = PROGRAMS = +EXCLUDED_PROGRAMS = SCRIPT_PERL = SCRIPT_PYTHON = SCRIPT_SH = @@ -1323,6 +1324,7 @@ ifdef NO_CURL REMOTE_CURL_PRIMARY = REMOTE_CURL_ALIASES = REMOTE_CURL_NAMES = + EXCLUDED_PROGRAMS += git-http-fetch git-http-push else ifdef CURLDIR # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. @@ -1347,7 +1349,11 @@ endif ifeq "$(curl_check)" "070908" ifndef NO_EXPAT PROGRAM_OBJS += http-push.o + else + EXCLUDED_PROGRAMS += git-http-push endif + else + EXCLUDED_PROGRAMS += git-http-push endif curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p) ifeq "$(curl_check)" "072200" @@ -1593,7 +1599,9 @@ ifdef NO_INET_PTON LIB_OBJS += compat/inet_pton.o BASIC_CFLAGS += -DNO_INET_PTON endif -ifndef NO_UNIX_SOCKETS +ifdef NO_UNIX_SOCKETS + EXCLUDED_PROGRAMS += git-credential-cache git-credential-cache--daemon +else LIB_OBJS += unix-socket.o PROGRAM_OBJS += credential-cache.o PROGRAM_OBJS += credential-cache--daemon.o @@ -2112,7 +2120,9 @@ $(BUILT_INS): git$X command-list.h: generate-cmdlist.sh command-list.txt command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt Documentation/config/*.txt - $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@ + $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \ + $(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \ + command-list.txt >$@+ && mv $@+ $@ SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\ $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index 709d67405b..7867b99d19 100755 --- a/generate-cmdlist.sh +++ b/generate-cmdlist.sh @@ -6,7 +6,7 @@ die () { } command_list () { - grep -v '^#' "$1" + eval grep -ve '^#' $exclude_programs "$1" } get_categories () { @@ -93,6 +93,14 @@ EOF EOF } +exclude_programs= +while test "a$1" = "a--exclude-program" +do + shift + exclude_programs="$exclude_programs -e \"^$1 \"" + shift +done + echo "/* Automatically generated by generate-cmdlist.sh */ struct cmdname_help { const char *name; From patchwork Fri Apr 12 12:00:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0CCF186E for ; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E6328E58 for ; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76BAC28E60; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27E4028E58 for ; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbfDLMAj (ORCPT ); Fri, 12 Apr 2019 08:00:39 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:44216 "EHLO mail-ed1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbfDLMAg (ORCPT ); Fri, 12 Apr 2019 08:00:36 -0400 Received: by mail-ed1-f45.google.com with SMTP id d11so8074094edp.11 for ; Fri, 12 Apr 2019 05:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=a6HInrpazxG+ZyyT+ukU+pYjlFBdRKEAQDUrtHtpFz0=; b=A3rlgVCHmGboLA7T42G3h43zv9dUYYHxmZLo32/TXZ9auK8lY6oejO4W0NcZ2EAZYU YqbKfpkmJVZwqiEIkJa8xKv/uyi4rq4w9p3yUkd+dxdbmo/g7xBs6/RG9ROHBHIx50se ZXtCxBC7NXHecC+Mq6y1p6UKeNhBIkDRjFwfi0d5rzQte8sWRzLiJH9eyMNTFvca+XlL C2VW12A34BjvknsnIg1WxpLGkOgOupcqyG9EVxo/gg5e4R2MiOC5BuxacJCFrLSJYzvp yLiulU5aepIXFdNwMYv7HlvKbbbaRa2lyj/mgzHez5KnlvJ0WepCDPfcCK6O6fcuaHrF t59A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=a6HInrpazxG+ZyyT+ukU+pYjlFBdRKEAQDUrtHtpFz0=; b=ssbILj8yxTtXLiRZ5L+mxN8K07mUWYnwZ5zrBfyCcYVbK1UzdwkNNNlgn4QoXTGjR5 MeJb8ZcxFR/85H56ShNECHo658WwTdbUwnQdsAqJDGa9IJBB5bisuc0uXrISPyjf2GOb +I8Cbb3Ar16jo81uU7wpwqsGGAgRqYIi4M2bL0yVtyD0MBOBYKpgzddH6fRjZGnkRIxL sxSef1NaMxJ6Mtcm6wACnCpuRMvv3nyF2TM7E8sED1unsmkf0jFbzCl32vTx+L9+jHsI NlGv09t06oVgK5sMTDiXJy2rFH1sqg0AWRdz+KnmbZKjuP1nf9Xlq9jgm65qjhlRr9Tx +OHQ== X-Gm-Message-State: APjAAAUIpnaLxPGy5czN4bWgc6MeShSwUC/bpGzJ6XyXALZSDxRM5jlM YS9zqP4j96AE1OS8lfuOa7rG/5CH X-Google-Smtp-Source: APXvYqxIuPsoVwljJWP+ognKkYj19Nb3G1aOJJby1HzcGjLBmzQXZJ8wFAtVxRJ0AnhEB5FWf1lgEw== X-Received: by 2002:a17:906:1545:: with SMTP id c5mr31431442ejd.135.1555070434259; Fri, 12 Apr 2019 05:00:34 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m10sm397644edl.62.2019.04.12.05.00.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:33 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:33 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:26 GMT Message-Id: <96ced7e17cb40c4d0f15955c482857196862ab80.1555070430.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 3/7] check-docs: do not pretend that commands are listed which are excluded Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin In the previous commit, we taught `git help -a` to stop listing commands that are excluded from the build. In this commit, we stop `check-docs` from claiming that those commands are listed. Signed-off-by: Johannes Schindelin --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 8f3c477ab3..5880d4d3a9 100644 --- a/Makefile +++ b/Makefile @@ -3085,6 +3085,7 @@ check-docs:: ( \ sed -e '1,/^### command list/d' \ -e '/^#/d' \ + $(patsubst %,-e '/^% /d',$(EXCLUDED_PROGRAMS)) \ -e '/guide$$/d' \ -e 's/[ ].*//' \ -e 's/^/listed /' command-list.txt; \ From patchwork Fri Apr 12 12:00:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1503F14DB for ; Fri, 12 Apr 2019 12:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E924728E58 for ; Fri, 12 Apr 2019 12:00:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD89928E61; Fri, 12 Apr 2019 12:00:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F60028E58 for ; Fri, 12 Apr 2019 12:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727381AbfDLMAj (ORCPT ); Fri, 12 Apr 2019 08:00:39 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:42108 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727104AbfDLMAi (ORCPT ); Fri, 12 Apr 2019 08:00:38 -0400 Received: by mail-ed1-f68.google.com with SMTP id x61so8075019edc.9 for ; Fri, 12 Apr 2019 05:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=TK+BqPyov7hMK2nEAVYNtDmgaj2D2pd0bnVLeYSYIpI=; b=BZutH9qNC8QFaZk9lMs/Z1K7TKn0XNye/xTwkJ+ILooFINxp4nes/4QYAPfivuaCfO LvNUaRVqwjA6CtQd66fL2KbwJTBKNTNAHSyvzfIpVMK5quY8JrYcRQbzZwihjfcyrQdF 7nI/MwOv92JnWj85y+N+Zo68sasQkIwkT0kXj5MEkD78TIC2PvseclMxWMDuPhR2haMQ t4mg4+FXsnyjyBv5Hvr1hQJzjqACzbBauB0HJ6z6HbMBK5XNqg6C72V9n6mhSa60naW4 iCqgJk1DCaJVLlToZqzTF1quSat4GUDERlPeZhTCrU5i53C4W/keNGNWH4TL8dWHIzBQ ldnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=TK+BqPyov7hMK2nEAVYNtDmgaj2D2pd0bnVLeYSYIpI=; b=Fmg5Ny34/QzeUyMuE5X1uelueFTNTW1y9Crpyum+qAw609K26/MlHbjsTY11CnQjkC i1+dUvwu+UYap6fUKUhKDaRnrYKJgFGBlyajydL7GV2u9pxo8papwptlfICrXn9DcmUr laNaAutOb/JhnTPze45VizuNb5QWNOrCJMX5WXsfRG3O88w53GyXhi5BZxi0mQlUm1M9 D6zX6uKmOTicHBpR5t6ByD6Klpuin2DUcrUChrJjUXuuuyoTATrfxS0NO0uriZvPaQl0 SGlaI4OiFBzMOAAjU1/QODKCeraBkPZxz4L1Jdvm1Vd1c2ZUCyzrbUFvfNOOsCVXvJX7 pvyg== X-Gm-Message-State: APjAAAV1zTc+t3WIAPfyPeYsTAR9HTBaZibRtZJvhQA/XiN76nSQdOic lTbvD/tYoafkBfm2BZ+gSAmpM856 X-Google-Smtp-Source: APXvYqx/zBvI3psoAmkTrCC9R9QqatV7RQAQ9rP57polYhOMPtujfdcnW92DNBQwgUSbIEtC2OUk0g== X-Received: by 2002:a17:906:6406:: with SMTP id d6mr7023174ejm.103.1555070435262; Fri, 12 Apr 2019 05:00:35 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 59sm1806369edy.60.2019.04.12.05.00.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:34 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:34 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:27 GMT Message-Id: <31d8e43cbfaec36f662006a711b64bca47009e59.1555070430.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 4/7] docs: exclude documentation for commands that have been excluded Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin When building with certain build options, some commands are excluded from the build. For example, `git-credential-cache` is skipped when building with `NO_UNIX_SOCKETS`. Let's not build or package documentation for those excluded commands. This issue was pointed out rightfully when running `make check-docs` on Windows, where we do not yet have Unix sockets, and therefore the `credential-cache` command is excluded (yet its documentation was built and shipped). Note: building the documentation via `make -C Documentation` leaves the build system with no way to determine which commands have been excluded. If called thusly, we gracefully fail to exclude their documentation. Only when building the documentation via the top-level Makefile will it get excluded properly, or after building `Documentation/GIT-EXCLUDED-PROGRAMS` manually. Signed-off-by: Johannes Schindelin --- Documentation/.gitignore | 1 + Documentation/Makefile | 3 +++ Makefile | 36 ++++++++++++++++++++---------------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Documentation/.gitignore b/Documentation/.gitignore index 3ef54e0adb..ea27148c59 100644 --- a/Documentation/.gitignore +++ b/Documentation/.gitignore @@ -13,3 +13,4 @@ mergetools-*.txt manpage-base-url.xsl SubmittingPatches.txt tmp-doc-diff/ +/GIT-EXCLUDED-PROGRAMS diff --git a/Documentation/Makefile b/Documentation/Makefile index af0e2cf11a..e22ea2f57c 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -7,7 +7,10 @@ ARTICLES = SP_ARTICLES = OBSOLETE_HTML = +-include GIT-EXCLUDED-PROGRAMS + MAN1_TXT += $(filter-out \ + $(patsubst %,%.txt,$(EXCLUDED_PROGRAMS)) \ $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ $(wildcard git-*.txt)) MAN1_TXT += git.txt diff --git a/Makefile b/Makefile index 5880d4d3a9..a5212c64bf 100644 --- a/Makefile +++ b/Makefile @@ -2455,22 +2455,25 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS) export DEFAULT_EDITOR DEFAULT_PAGER +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ + .PHONY: doc man man-perl html info pdf -doc: man-perl +doc: man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation all -man: man-perl +man: man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation man man-perl: perl/build/man/man3/Git.3pm -html: +html: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation html -info: +info: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation info -pdf: +pdf: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation pdf XGETTEXT_FLAGS = \ @@ -2907,33 +2910,33 @@ endif install-gitweb: $(MAKE) -C gitweb install -install-doc: install-man-perl +install-doc: install-man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install -install-man: install-man-perl +install-man: install-man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-man -install-man-perl: man-perl +install-man-perl: man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3' (cd perl/build/man/man3 && $(TAR) cf - .) | \ (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -) -install-html: +install-html: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-html -install-info: +install-info: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-info -install-pdf: +install-pdf: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-pdf -quick-install-doc: +quick-install-doc: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation quick-install -quick-install-man: +quick-install-man: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation quick-install-man -quick-install-html: +quick-install-html: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation quick-install-html @@ -2988,7 +2991,7 @@ artifacts-tar:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) \ htmldocs = git-htmldocs-$(GIT_VERSION) manpages = git-manpages-$(GIT_VERSION) .PHONY: dist-doc distclean -dist-doc: +dist-doc: Documentation/GIT-EXCLUDED-PROGRAMS $(RM) -r .doc-tmp-dir mkdir .doc-tmp-dir $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc @@ -3035,6 +3038,7 @@ clean: profile-clean coverage-clean cocciclean $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz $(RM) $(htmldocs).tar.gz $(manpages).tar.gz $(MAKE) -C Documentation/ clean + $(RM) Documentation/GIT-EXCLUDED-PROGRAMS ifndef NO_PERL $(MAKE) -C gitweb clean $(RM) -r perl/build/ @@ -3062,7 +3066,7 @@ ALL_COMMANDS += gitweb ALL_COMMANDS += git-gui git-citool .PHONY: check-docs -check-docs:: +check-docs:: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation lint-docs @(for v in $(patsubst %$X,%,$(ALL_COMMANDS)); \ do \ From patchwork Fri Apr 12 12:00:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB7BD14DB for ; Fri, 12 Apr 2019 12:00:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A015B28E61 for ; Fri, 12 Apr 2019 12:00:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9429028E64; Fri, 12 Apr 2019 12:00:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 422B828E61 for ; Fri, 12 Apr 2019 12:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbfDLMAj (ORCPT ); Fri, 12 Apr 2019 08:00:39 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:32962 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbfDLMAi (ORCPT ); Fri, 12 Apr 2019 08:00:38 -0400 Received: by mail-ed1-f66.google.com with SMTP id d55so7302885ede.0 for ; Fri, 12 Apr 2019 05:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=HPcFO45vxtPULRTBA3PXeRbOkzEFzKMHoMsROfDBHok=; b=rvi0BZ2aJBAmOWUg9FR4D5rLbLIb0paLCnMcm+eXKOjAUUp1kRhzayKeFxgyml4FPX VU5i6mT3XbUasy3dAXFtBqqrqA4irsBA0yhn8HptX81nWouerscJlkaMLEozKmaEQRGT 03/O7Zk0dnLrfwRiV80QjzKD/fZ7VTO7chJu8oonjZ7nuAs1PApKqwAoucQpEs/EWTFo gq0KNxxYUuc53WKdZdXruLwlIrkuFeuyqfdTTZQXLsyvnJONq6V7n8+HMMcoPXNLxaFl a/NiMK/HtHTJWYSNypA3b2lEg9+E7mvWJgNhI/sgiK05CyueKMFmY5YJN7FEyjowEGfS WQmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=HPcFO45vxtPULRTBA3PXeRbOkzEFzKMHoMsROfDBHok=; b=F6FBvcvemOjsRIEYn8urCvLqHnlQHWlnTR8kWN13SDi/ROJrSk70stokysKVxc5dws Ukuk//KLRQaYdX6PnXFFU6Ndn5g8atYmvi2iLm+8OmXLIGr8pQgXu9QPephD+VmPly3G AyI6VibnhsQglhb4LKeoHnHCVFXTb7FdRk6W+bbVMBwf3Y/D2Pbw6WDZBdV/C36gFzzg D68RY4PKb/QUOI+Q3obLHMWFd5NC4pV6xmjDnPsnmz9JQbApnQHB04RSkGibXLVjO42q dLSftPFa5levfV2m5mjWVWPeepBx990DsHifkur+bmwr4UxFgisrOfEzm8d9EJ73guxZ CdcA== X-Gm-Message-State: APjAAAVN3CO2Cv3yEvtmsM4DIgxc9IZyYoox1A53YYRdErOvzJxXT/Di N+FhLCi6HFGK/FUqbI6H8TxbUIC4 X-Google-Smtp-Source: APXvYqwSUfPXpX5N6Wgo7NUYhCCrQ9b45ntNzqYwHMoE/LZitLjToiEfSB35Jk6J3T8IUo2g2dPlng== X-Received: by 2002:a17:906:708d:: with SMTP id b13mr31438627ejk.120.1555070436062; Fri, 12 Apr 2019 05:00:36 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l26sm5049789ejr.82.2019.04.12.05.00.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:35 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:35 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:28 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 5/7] check-docs: do not bother checking for legacy scripts' documentation Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin In the recent years, there has been a big push to convert more and more of Git's commands that are implemented as scripts to built-ins written in pure, portable C, for robustness, speed and portability. One strategy that served us well is to convert those scripts incrementally, starting by renaming the scripts to `git-legacy-`, then introducing a built-in that does nothing else at first than checking the config setting `.useBuiltin` (which defaults to `false` at the outset) and handing off to the legacy script if so asked. Obviously, those `git-legacy-` commands share the documentation with the built-in `git-`, and are not intended to be called directly anyway. So let's not try to ensure that they are documented separately from their built-in versions. Signed-off-by: Johannes Schindelin --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a5212c64bf..caa20923a4 100644 --- a/Makefile +++ b/Makefile @@ -3074,7 +3074,7 @@ check-docs:: Documentation/GIT-EXCLUDED-PROGRAMS git-merge-octopus | git-merge-ours | git-merge-recursive | \ git-merge-resolve | git-merge-subtree | \ git-fsck-objects | git-init-db | \ - git-remote-* | git-stage | \ + git-remote-* | git-stage | git-legacy-* | \ git-?*--?* ) continue ;; \ esac ; \ test -f "Documentation/$$v.txt" || \ From patchwork Fri Apr 12 12:00:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 949C21515 for ; Fri, 12 Apr 2019 12:00:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AD6028E60 for ; Fri, 12 Apr 2019 12:00:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F33628E62; Fri, 12 Apr 2019 12:00:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BE3528E60 for ; Fri, 12 Apr 2019 12:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727345AbfDLMAj (ORCPT ); Fri, 12 Apr 2019 08:00:39 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:46432 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbfDLMAi (ORCPT ); Fri, 12 Apr 2019 08:00:38 -0400 Received: by mail-ed1-f65.google.com with SMTP id d1so8070056edd.13 for ; Fri, 12 Apr 2019 05:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=qN63TrtHggTAGtg/Fx+ZyXty2CY5YBwtv3fKIy6wnQw=; b=bcI1kMu51BfjLb9XxVcuDXq8Ix73tefBzYssw6Hd4jXhfpXpuUCiWQMmr1Gq/YptZs C2fIgiCs+a/Lj7yLtz1uyeIwbFjYYZUn8tUIQSN7BVVerJrq1VUswqtGs43s3WOwEePG 105iGxpE5oR6OlsqUzKNlNYLrjrIaXOSD8jEF/pG7Gk0CirRawDk3ZKPAGR55Tn6NWO/ htESb2rfUFcKOZAcsulAvjXdJT6cYXM5JadRh+juZhAI+c9ggvgQVL77I1HoYq48XO// GoTYXjFozCwhJnnXRHGlPCjmjE2yXZfjhTbSvGcGrrAyruel2rDFOPhNxGbGvtAdVMnv NKKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=qN63TrtHggTAGtg/Fx+ZyXty2CY5YBwtv3fKIy6wnQw=; b=elvD6gReplDIfuk67mj+XJYQjADtZmdpTvDguFvpRbnG02LuPKV/lynH/Xa5maLARp 4vLOWKkVmYY8VvygLIfeTqNhdISGArgbGTAvRlD5R6+IR0QVqta91Ssc8OM4l+3C/yIl dQ9dQMSGLW83z9EWNn6V3OBEG2ocEb+WHHGcH4Fl+PXfqRmNFC06vpGuzoFwJ7xo/pDO FhhXQF8q+97gxIw2DQoqs6hW6YbFv2rSztkhWzgXZP2cXNhRdwIAxgih7qA7dZgwJSFK UJME/GnYHWMqogG38YL4tK9YKj7FENNIDWiJouo31jKr2rCOXY/SfEvJ1sIY84UJalzQ m+6A== X-Gm-Message-State: APjAAAV8kKZipooZ9eu2tQDjwjiLMZefHmkJeSKMYGQ8aD1TU53ygECc B/ZC3XIcnRK64jviKazg/gcFkeXX X-Google-Smtp-Source: APXvYqwGFi2KhoX0TZ/8l2jQ6tjI/lTV4QZ096DUcvpggrly8jYXZ80ywQz9uJuUXtTZsJuGbMrmHA== X-Received: by 2002:a17:906:d1da:: with SMTP id bs26mr31046081ejb.149.1555070436830; Fri, 12 Apr 2019 05:00:36 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id op3sm6555497ejb.61.2019.04.12.05.00.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:36 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:36 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:29 GMT Message-Id: <2e19f538bcc20393468535561b6857ba3ab252f8.1555070430.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 6/7] test-tool: handle the `-C ` option just like `git` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin In preparation for moving `git serve` into `test-tool` (because it really is only used by the test suite), we teach the `test-tool` the useful trick to change the working directory before running the test command, which will avoid introducing subshells in the test code. Signed-off-by: Johannes Schindelin --- t/helper/test-tool.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index 99db7409b8..2b21943f93 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -1,5 +1,11 @@ #include "git-compat-util.h" #include "test-tool.h" +#include "parse-options.h" + +static const char * const test_tool_usage[] = { + "test-tool [-C ] ...]]", + NULL +}; struct test_cmd { const char *name; @@ -73,11 +79,24 @@ static NORETURN void die_usage(void) int cmd_main(int argc, const char **argv) { int i; + const char *working_directory = NULL; + struct option options[] = { + OPT_STRING('C', NULL, &working_directory, "directory", + "change the working directory"), + OPT_END() + }; BUG_exit_code = 99; + argc = parse_options(argc, argv, NULL, options, test_tool_usage, + PARSE_OPT_STOP_AT_NON_OPTION | + PARSE_OPT_KEEP_ARGV0); + if (argc < 2) die_usage(); + if (working_directory && chdir(working_directory) < 0) + die("Could not cd to '%s'", working_directory); + for (i = 0; i < ARRAY_SIZE(cmds); i++) { if (!strcmp(cmds[i].name, argv[1])) { argv++; From patchwork Fri Apr 12 12:00:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10898069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF3CA1515 for ; Fri, 12 Apr 2019 12:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9568B28E52 for ; Fri, 12 Apr 2019 12:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A0D728E60; Fri, 12 Apr 2019 12:00:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3512728E58 for ; Fri, 12 Apr 2019 12:00:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbfDLMAl (ORCPT ); Fri, 12 Apr 2019 08:00:41 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:44135 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbfDLMAk (ORCPT ); Fri, 12 Apr 2019 08:00:40 -0400 Received: by mail-ed1-f66.google.com with SMTP id d11so8074250edp.11 for ; Fri, 12 Apr 2019 05:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Jkt5GDfTi+/UE7sV2MF0GxMgRBAKiWI783ntUc7cnho=; b=eproQXO9FWjWFRsgLFnx2pCwaICIs5I95Gu6phkkPYmrhIu6SLEPfrMlKRwr8l3BrT uALveYGUvzhhiTB3l8lCEcJiG6HQ8y0mcReGv3AaSV7cue1fDVr2DxT/Ibgb86hAwA5M jmhKWskNdzdmuH4DeTbkq0x45uXq5/FeASo6Fs7MCH1RLT/RHxGs3DSgyTRhjKlFlEEb tRc1jwalTEjN4bXMdsdlrh2cmhxqA8t8jYNNyOx+6AyQ4ieHXGnXJkCAfC4mw6UgJkrO NcvR3pw4AYHd9I50WR5wB4MdZBORmEKyYIzcQjx2KXAqqKooacsDRt0SVvXh635ebyFw Z1SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Jkt5GDfTi+/UE7sV2MF0GxMgRBAKiWI783ntUc7cnho=; b=kPxx8INu5xaPK1pQL6eTvL83ni7yWLHj78somN30dgqv7ThFU8FfsZQTguODJDLT+y EP2oqk2n4fNQK0C+fuVB6LSveUR7n0lmhYYMY5GS6L+CeSlARGvwy/5WYLcVVg1/6AKY aMr5dbmQG4SD7RM5aRfwKB+CHGn4G6BUSpowbqC1RWR2tyrWPrLDss6hN000ojD6jHz5 NwUBJ2tjUUyQhuYKzGR6Ya4RCsFdNrGAfcrqGLNsFFev6WtOx+LlT9JfA3wdzDeWuB3k UBPWCyv/QcICZS61TPJKRaRkEohtgt4plLMmmYbOAXAxzBVQs1qnTCsJaS+56JBbsEhU DJMQ== X-Gm-Message-State: APjAAAV18149ametZvRkFPqUvd0kdz/u+tsY6xyLBD1eED7gFAUHiWCi Ak1matOq3bR/lSvnKLXmF5IWJJAd X-Google-Smtp-Source: APXvYqzvR9IQ2yyn3Ppv2aSsj/6bZL21Z/uZocr6V6QlHnnveBAk+1XgzswtmxdC5spKGeGGpX6FVw== X-Received: by 2002:a17:906:a311:: with SMTP id j17mr31741824ejz.269.1555070437661; Fri, 12 Apr 2019 05:00:37 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j3sm7499448ejv.22.2019.04.12.05.00.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:00:37 -0700 (PDT) Date: Fri, 12 Apr 2019 05:00:37 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 12:00:30 GMT Message-Id: <411587e4b80bd4e5a1cb9b1ec438cda7a0681465.1555070430.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 7/7] Turn `git serve` into a test helper Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin The `git serve` built-in was introduced in ed10cb952d31 (serve: introduce git-serve, 2018-03-15) as a backend to serve Git protocol v2, probably originally intended to be spawned by `git upload-pack`. However, in the version that the protocol v2 patches made it into core Git, `git upload-pack` calls the `serve()` function directly instead of spawning `git serve`; The only reason in life for `git serve` to survive as a built-in command is to provide a way to test the protocol v2 functionality. Meaning that it does not even have to be a built-in that is installed with end-user facing Git installations, but it can be a test helper instead. Let's make it so. Signed-off-by: Johannes Schindelin --- Makefile | 2 +- builtin.h | 1 - git.c | 1 - builtin/serve.c => t/helper/test-serve-v2.c | 7 +++-- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t5701-git-serve.sh | 32 ++++++++++++--------- t/t5702-protocol-v2.sh | 5 ++-- t/t5703-upload-pack-ref-in-want.sh | 16 +++++------ 9 files changed, 36 insertions(+), 30 deletions(-) rename builtin/serve.c => t/helper/test-serve-v2.c (81%) diff --git a/Makefile b/Makefile index caa20923a4..d7656cdc4f 100644 --- a/Makefile +++ b/Makefile @@ -762,6 +762,7 @@ TEST_BUILTINS_OBJS += test-repository.o TEST_BUILTINS_OBJS += test-revision-walking.o TEST_BUILTINS_OBJS += test-run-command.o TEST_BUILTINS_OBJS += test-scrap-cache-tree.o +TEST_BUILTINS_OBJS += test-serve-v2.o TEST_BUILTINS_OBJS += test-sha1.o TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sha256.o @@ -1131,7 +1132,6 @@ BUILTIN_OBJS += builtin/rev-parse.o BUILTIN_OBJS += builtin/revert.o BUILTIN_OBJS += builtin/rm.o BUILTIN_OBJS += builtin/send-pack.o -BUILTIN_OBJS += builtin/serve.o BUILTIN_OBJS += builtin/shortlog.o BUILTIN_OBJS += builtin/show-branch.o BUILTIN_OBJS += builtin/show-index.o diff --git a/builtin.h b/builtin.h index 6538932e99..c48636e244 100644 --- a/builtin.h +++ b/builtin.h @@ -219,7 +219,6 @@ extern int cmd_rev_parse(int argc, const char **argv, const char *prefix); extern int cmd_revert(int argc, const char **argv, const char *prefix); extern int cmd_rm(int argc, const char **argv, const char *prefix); extern int cmd_send_pack(int argc, const char **argv, const char *prefix); -extern int cmd_serve(int argc, const char **argv, const char *prefix); extern int cmd_shortlog(int argc, const char **argv, const char *prefix); extern int cmd_show(int argc, const char **argv, const char *prefix); extern int cmd_show_branch(int argc, const char **argv, const char *prefix); diff --git a/git.c b/git.c index 2dd588674f..c58b067771 100644 --- a/git.c +++ b/git.c @@ -548,7 +548,6 @@ static struct cmd_struct commands[] = { { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE }, { "rm", cmd_rm, RUN_SETUP }, { "send-pack", cmd_send_pack, RUN_SETUP }, - { "serve", cmd_serve, RUN_SETUP }, { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER }, { "show", cmd_show, RUN_SETUP }, { "show-branch", cmd_show_branch, RUN_SETUP }, diff --git a/builtin/serve.c b/t/helper/test-serve-v2.c similarity index 81% rename from builtin/serve.c rename to t/helper/test-serve-v2.c index d3fd240bb3..aee35e5aef 100644 --- a/builtin/serve.c +++ b/t/helper/test-serve-v2.c @@ -1,14 +1,14 @@ +#include "test-tool.h" #include "cache.h" -#include "builtin.h" #include "parse-options.h" #include "serve.h" static char const * const serve_usage[] = { - N_("git serve []"), + N_("test-tool serve-v2 []"), NULL }; -int cmd_serve(int argc, const char **argv, const char *prefix) +int cmd__serve_v2(int argc, const char **argv) { struct serve_options opts = SERVE_OPTIONS_INIT; @@ -19,6 +19,7 @@ int cmd_serve(int argc, const char **argv, const char *prefix) N_("exit immediately after advertising capabilities")), OPT_END() }; + const char *prefix = setup_git_directory(); /* ignore all unknown cmdline switches for now */ argc = parse_options(argc, argv, prefix, options, serve_usage, diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index 2b21943f93..4bf3666b43 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -48,6 +48,7 @@ static struct test_cmd cmds[] = { { "revision-walking", cmd__revision_walking }, { "run-command", cmd__run_command }, { "scrap-cache-tree", cmd__scrap_cache_tree }, + { "serve-v2", cmd__serve_v2 }, { "sha1", cmd__sha1 }, { "sha1-array", cmd__sha1_array }, { "sha256", cmd__sha256 }, diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h index 25abed1cf2..bc72370916 100644 --- a/t/helper/test-tool.h +++ b/t/helper/test-tool.h @@ -39,6 +39,7 @@ int cmd__repository(int argc, const char **argv); int cmd__revision_walking(int argc, const char **argv); int cmd__run_command(int argc, const char **argv); int cmd__scrap_cache_tree(int argc, const char **argv); +int cmd__serve_v2(int argc, const char **argv); int cmd__sha1(int argc, const char **argv); int cmd__sha1_array(int argc, const char **argv); int cmd__sha256(int argc, const char **argv); diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh index fe45bf828d..ffb9613885 100755 --- a/t/t5701-git-serve.sh +++ b/t/t5701-git-serve.sh @@ -1,6 +1,6 @@ #!/bin/sh -test_description='test git-serve and server commands' +test_description='test protocol v2 server commands' . ./test-lib.sh @@ -14,7 +14,8 @@ test_expect_success 'test capability advertisement' ' 0000 EOF - GIT_TEST_SIDEBAND_ALL=0 git serve --advertise-capabilities >out && + GIT_TEST_SIDEBAND_ALL=0 test-tool serve-v2 \ + --advertise-capabilities >out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -24,11 +25,11 @@ test_expect_success 'stateless-rpc flag does not list capabilities' ' test-tool pkt-line pack >in <<-EOF && 0000 EOF - git serve --stateless-rpc >out out out && + test-tool serve-v2 --stateless-rpc >out && test_must_be_empty out ' @@ -37,7 +38,7 @@ test_expect_success 'request invalid capability' ' foobar 0000 EOF - test_must_fail git serve --stateless-rpc 2>err err err err err err out && + test-tool serve-v2 --stateless-rpc out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -107,7 +108,7 @@ test_expect_success 'basic ref-prefixes' ' 0000 EOF - git serve --stateless-rpc out && + test-tool serve-v2 --stateless-rpc out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -127,7 +128,7 @@ test_expect_success 'refs/heads prefix' ' 0000 EOF - git serve --stateless-rpc out && + test-tool serve-v2 --stateless-rpc out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -148,7 +149,7 @@ test_expect_success 'peel parameter' ' 0000 EOF - git serve --stateless-rpc out && + test-tool serve-v2 --stateless-rpc out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -169,7 +170,7 @@ test_expect_success 'symrefs parameter' ' 0000 EOF - git serve --stateless-rpc out && + test-tool serve-v2 --stateless-rpc out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -189,7 +190,7 @@ test_expect_success 'sending server-options' ' 0000 EOF - git serve --stateless-rpc out && + test-tool serve-v2 --stateless-rpc out && test-tool pkt-line unpack actual && test_cmp expect actual ' @@ -204,7 +205,10 @@ test_expect_success 'unexpected lines are not allowed in fetch request' ' 0000 EOF - test_must_fail git -C server serve --stateless-rpc /dev/null 2>err && + ( + cd server && + test_must_fail test-tool serve-v2 --stateless-rpc + ) /dev/null 2>err && grep "unexpected line: .this-is-not-a-command." err ' diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index db4ae09f2f..8691bfc52d 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -359,12 +359,13 @@ test_expect_success 'even with handcrafted request, filter does not work if not 0000 EOF - test_must_fail git -C server serve --stateless-rpc /dev/null 2>err && + test_must_fail test-tool -C server serve-v2 --stateless-rpc \ + /dev/null 2>err && grep "unexpected line: .filter blob:none." err && # Exercise to ensure that if advertised, filter works git -C server config uploadpack.allowfilter 1 && - git -C server serve --stateless-rpc /dev/null + test-tool -C server serve-v2 --stateless-rpc /dev/null ' test_expect_success 'default refspec is used to filter ref when fetchcing' ' diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index f87b2f6df3..dd1cbd0dd6 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -48,15 +48,15 @@ test_expect_success 'setup repository' ' ' test_expect_success 'config controls ref-in-want advertisement' ' - git serve --advertise-capabilities >out && + test-tool serve-v2 --advertise-capabilities >out && ! grep -a ref-in-want out && git config uploadpack.allowRefInWant false && - git serve --advertise-capabilities >out && + test-tool serve-v2 --advertise-capabilities >out && ! grep -a ref-in-want out && git config uploadpack.allowRefInWant true && - git serve --advertise-capabilities >out && + test-tool serve-v2 --advertise-capabilities >out && grep -a ref-in-want out ' @@ -70,7 +70,7 @@ test_expect_success 'invalid want-ref line' ' 0000 EOF - test_must_fail git serve --stateless-rpc 2>out out out out out out out out out out