From patchwork Fri Sep 2 15:56:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1452ECAAD5 for ; Fri, 2 Sep 2022 16:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237358AbiIBQFK (ORCPT ); Fri, 2 Sep 2022 12:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238337AbiIBQEk (ORCPT ); Fri, 2 Sep 2022 12:04:40 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 741FA7FE50 for ; Fri, 2 Sep 2022 08:58:40 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id n23-20020a7bc5d7000000b003a62f19b453so3580504wmk.3 for ; Fri, 02 Sep 2022 08:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=/HvDjiBfNJ5PehflNIlfNvxGBnMwPZc+kTxB7s8veMU=; b=LRFuqFGuiUadYVkMSjdCCAHlZW0XyBwawv1AnfSi5FvH1sxx5klPMkYxGKmGNr8CFm sy0KfVQWNPZ4+O5syBXkDOUTXDHYLT6gJtl3+iuqIM2bi05/N30zt4cv6N6W5m87g/N0 K+Jz3b1A3ANzaaPnSBHRmk/BxJMSmOUBu3ZCj0EEg66Q5RwMZweMer7fuUqSSGMMoZ9S +RG92iYuscTxCkcE815bPbZfwbij/uSE0bT6VhDX9VlScD1q5FSNRJNcPR8cT4HQ9dD6 sefSP2BOgkTDuzVQDa3IRoDDC+0MlaIi0wp+rEvC7yeo6ZTRKWgJpMiLgzt9x2gUy9U6 uEHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=/HvDjiBfNJ5PehflNIlfNvxGBnMwPZc+kTxB7s8veMU=; b=6T1xVO5d/1kUfAqku6KC4HTUZHn0CVAkXhWuQu4XM1pIa28zVX+xOTaf145jDS07Qa yZupB99bnm0PrP7NKuivaPgplAMio8lt/ZPBdZ6T86JkTPLvpZHAL0uqesinD3Ci9vBr EcMzmUVywACLBxrMs86PAJj1jVqXzv3USbF83RReBIEyT3Kv52dLWV0f2xmyNMDXKynC V1Qbh10Tk41Ji7ShFBGyib2hd5Ep3CCReFAA5OuRa6AVD8IIS+YGtegs2HGlYP3k5h/A dGno0AKpzAAAoH2fAjlN74OceBZK16AMdOxvNBBg3gciYgZD80diDkwM8eQf7GE5GDD1 d8FQ== X-Gm-Message-State: ACgBeo04M25RXzTpYJlSpCfh6rsa96uYw6fhZmTx9UgKnWMFEHgGk084 Zios2yPbTfnmcdzgh7/2k6gE38xvcFA= X-Google-Smtp-Source: AA6agR5PMFxoTc1NIZJWI4FTh7kIp6aG2T4XbaUL9AAUWP7wPa0wuxfltFIAA4+pYCcpYaQ2y5V2PA== X-Received: by 2002:a05:600c:1e8b:b0:3a6:acc:ebfb with SMTP id be11-20020a05600c1e8b00b003a60accebfbmr3429678wmb.66.1662134213653; Fri, 02 Sep 2022 08:56:53 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n19-20020a05600c3b9300b003a846a014c1sm9947456wms.23.2022.09.02.08.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:52 -0700 (PDT) Message-Id: <614cbdc629ddb099f4a30ad6d217d1f1c716da83.1662134210.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:42 +0000 Subject: [PATCH v2 1/9] scalar: fix command documentation section header Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Rename the last section header in 'contrib/scalar/scalar.txt' from "Scalar" to "GIT". The linting rules of the 'documentation' CI build enforce the existence of a "GIT" section in command documentation. Although 'scalar.txt' is not yet checked, it will be in a future patch. Here, changing the header name is more appropriate than making a Scalar-specific exception to the linting rule. The existing "Scalar" section contains only a link back to the main Git documentation, essentially the same as the "GIT" section in builtin documentation. Changing the section name further clarifies the Scalar-Git association and maintains consistency with the rest of Git. Signed-off-by: Victoria Dye --- contrib/scalar/scalar.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/scalar/scalar.txt b/contrib/scalar/scalar.txt index 1a12dc45077..f33436c7f65 100644 --- a/contrib/scalar/scalar.txt +++ b/contrib/scalar/scalar.txt @@ -161,6 +161,6 @@ SEE ALSO -------- linkgit:git-clone[1], linkgit:git-maintenance[1]. -Scalar +GIT --- -Associated with the linkgit:git[1] suite +Part of the linkgit:git[1] suite From patchwork Fri Sep 2 15:56:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0660C38145 for ; Fri, 2 Sep 2022 16:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237226AbiIBQJ5 (ORCPT ); Fri, 2 Sep 2022 12:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237151AbiIBQJ2 (ORCPT ); Fri, 2 Sep 2022 12:09:28 -0400 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15246EF027 for ; Fri, 2 Sep 2022 09:02:28 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id u18so2851426wrq.10 for ; Fri, 02 Sep 2022 09:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=sO51Vgt1bDAkXJFqlyZHeBmrnG3NI2sgeCqEeyGUpk8=; b=KjKTmaGocjRVJA4F80jOJBEvuwUkQHwZL9rMU5lD/sd3AaMzHN9e8zbPOCgQGFOrts aqkUl55tUo9iQcgbvV0MHWy4pKQ9BkKpkxlQjCr9fHAEQzA2c/V0VaAIJH1uZ+ncpdxm UEVKuDF5065MIE6S3TXd1+GbSYo/Yi822v7p7pAp3WW1sZjFu0IIbaY49ugSWgBO6Al9 iiIL7ItaHpibo8X4bLO9SiceuwLblUukNuktian/5ku0ZT9q+yRsuIleR2H3DNofPh1D J3XGPHchCl1Zp8wwL4afbwGPSPxMtMhTfKkXY0aARrlxizYDPRqfiALTp4fKLc8HrD3C oErA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=sO51Vgt1bDAkXJFqlyZHeBmrnG3NI2sgeCqEeyGUpk8=; b=wJ9ng1czgBteplYHcorVBIvGXTJyG3nMtC4dQK64dbYWjOe3Oa0XXDbbt8i32bUaX9 ynhojXhpmFzGgHfiNf5eII/IgphAmu8OX5EmUVI8cK9wIHzmVEzo915Xop9WEMfpBiTY 98a8d0Q3sc4/TLQfM4sT8ro/hnrZCNM5vz0LSov764Z2PubC6a6jypsNg6GysbWR9ydM luWOWZitpkGGi7oHDTClHcZLDXneI93tKO5I3aV+LoNWmRW3QFVxXUEywVlGZgh8dHvG EYhWner7hggyxDyn8ZzNDbq5nxzlT42Laby6TDPG7d+Z/IAptNzbVben4M0Yvhk5cDzb ajVQ== X-Gm-Message-State: ACgBeo3deMGyxREtgZudiAnrWUwgFUuc3P9g7fDQY82L1VCBLMcdK61X NUloxq8n/jF7ptjBXI63UOwQNueP9lA= X-Google-Smtp-Source: AA6agR7WUhPbxnJ0vFcUENQ6at5E9d2BvIsV3EVJwk2SdbfB+UzOK2Wto+YXGpOvM73HQhKqtrFs0A== X-Received: by 2002:a5d:452f:0:b0:226:e80e:989 with SMTP id j15-20020a5d452f000000b00226e80e0989mr9470253wra.625.1662134214808; Fri, 02 Sep 2022 08:56:54 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r15-20020adfce8f000000b002207a0b93b4sm1835354wrn.49.2022.09.02.08.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:54 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:43 +0000 Subject: [PATCH v2 2/9] scalar: include in standard Git build & installation Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Move 'scalar' out of 'contrib/' and into the root of the Git tree. The goal of this change is to build 'scalar' as part of the standard Git build & install processes. This patch includes both the physical move of Scalar's files out of 'contrib/' ('scalar.c', 'scalar.txt', and 't9xxx-scalar.sh'), and the changes to the build definitions in 'Makefile' and 'CMakelists.txt' to accommodate the new program. At a high level, Scalar is built so that: - there is a 'scalar-objs' target (similar to those created in 029bac01a8 (Makefile: add {program,xdiff,test,git,fuzz}-objs & objects targets, 2021-02-23)) for debugging purposes. - it appears in the root of the install directory (rather than the gitexecdir). - it is included in the 'bin-wrappers/' directory for use in tests. - it receives a platform-specific executable suffix (e.g., '.exe'), if applicable. - 'scalar.txt' is installed as 'man1' documentation. - the 'clean' target removes the 'scalar' executable. Additionally, update the root level '.gitignore' file to ignore the Scalar executable. Signed-off-by: Victoria Dye --- .gitignore | 1 + Documentation/Makefile | 1 + {contrib/scalar => Documentation}/scalar.txt | 0 Makefile | 31 ++++--- contrib/buildsystems/CMakeLists.txt | 9 ++- contrib/scalar/.gitignore | 2 - contrib/scalar/Makefile | 35 -------- contrib/scalar/t/Makefile | 81 ------------------- contrib/scalar/scalar.c => scalar.c | 0 .../t/t9099-scalar.sh => t/t9210-scalar.sh | 10 +-- 10 files changed, 28 insertions(+), 142 deletions(-) rename {contrib/scalar => Documentation}/scalar.txt (100%) delete mode 100644 contrib/scalar/.gitignore delete mode 100644 contrib/scalar/Makefile delete mode 100644 contrib/scalar/t/Makefile rename contrib/scalar/scalar.c => scalar.c (100%) rename contrib/scalar/t/t9099-scalar.sh => t/t9210-scalar.sh (96%) diff --git a/.gitignore b/.gitignore index 80b530bbed2..3d1b880101e 100644 --- a/.gitignore +++ b/.gitignore @@ -185,6 +185,7 @@ /git-whatchanged /git-worktree /git-write-tree +/scalar /git-core-*/?* /git.res /gitweb/GITWEB-BUILD-OPTIONS diff --git a/Documentation/Makefile b/Documentation/Makefile index bd6b6fcb930..16c9e062390 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -21,6 +21,7 @@ MAN1_TXT += $(filter-out \ MAN1_TXT += git.txt MAN1_TXT += gitk.txt MAN1_TXT += gitweb.txt +MAN1_TXT += scalar.txt # man5 / man7 guides (note: new guides should also be added to command-list.txt) MAN5_TXT += gitattributes.txt diff --git a/contrib/scalar/scalar.txt b/Documentation/scalar.txt similarity index 100% rename from contrib/scalar/scalar.txt rename to Documentation/scalar.txt diff --git a/Makefile b/Makefile index eac30126e29..e03f32ec1e7 100644 --- a/Makefile +++ b/Makefile @@ -608,7 +608,9 @@ FUZZ_OBJS = FUZZ_PROGRAMS = GIT_OBJS = LIB_OBJS = +SCALAR_OBJS = OBJECTS = +OTHER_PROGRAMS = PROGRAM_OBJS = PROGRAMS = EXCLUDED_PROGRAMS = @@ -821,10 +823,12 @@ BUILT_INS += git-switch$X BUILT_INS += git-whatchanged$X # what 'all' will build but not install in gitexecdir -OTHER_PROGRAMS = git$X +OTHER_PROGRAMS += git$X +OTHER_PROGRAMS += scalar$X # what test wrappers are needed and 'install' will install, in bindir BINDIR_PROGRAMS_NEED_X += git +BINDIR_PROGRAMS_NEED_X += scalar BINDIR_PROGRAMS_NEED_X += git-receive-pack BINDIR_PROGRAMS_NEED_X += git-shell BINDIR_PROGRAMS_NEED_X += git-upload-archive @@ -2222,7 +2226,7 @@ profile-fast: profile-clean all:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS ifneq (,$X) - $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';) + $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';) endif all:: @@ -2545,7 +2549,12 @@ GIT_OBJS += git.o .PHONY: git-objs git-objs: $(GIT_OBJS) +SCALAR_OBJS += scalar.o +.PHONY: scalar-objs +scalar-objs: $(SCALAR_OBJS) + OBJECTS += $(GIT_OBJS) +OBJECTS += $(SCALAR_OBJS) OBJECTS += $(PROGRAM_OBJS) OBJECTS += $(TEST_OBJS) OBJECTS += $(XDIFF_OBJS) @@ -2556,10 +2565,6 @@ ifndef NO_CURL OBJECTS += http.o http-walker.o remote-curl.o endif -SCALAR_SOURCES := contrib/scalar/scalar.c -SCALAR_OBJECTS := $(SCALAR_SOURCES:c=o) -OBJECTS += $(SCALAR_OBJECTS) - .PHONY: objects objects: $(OBJECTS) @@ -2691,7 +2696,7 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) -contrib/scalar/scalar$X: $(SCALAR_OBJECTS) GIT-LDFLAGS $(GITLIBS) +scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ $(filter %.o,$^) $(LIBS) @@ -2747,8 +2752,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \ XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \ --keyword=__ --keyword=N__ --keyword="__n:1,2" MSGMERGE_FLAGS = --add-location --backup=off --update -LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(SCALAR_SOURCES) \ - $(GENERATED_H)) +LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(GENERATED_H)) LOCALIZED_SH = $(sort $(SCRIPT_SH) git-sh-setup.sh) LOCALIZED_PERL = $(sort $(SCRIPT_PERL)) @@ -3062,7 +3066,7 @@ bin-wrappers/%: wrap-for-bin.sh $(call mkdir_p_parent_template) $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@@BUILD_DIR@@|$(shell pwd)|' \ - -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \ + -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \ chmod +x $@ # GNU make supports exporting all variables by "export" without parameters. @@ -3276,14 +3280,14 @@ ifndef NO_TCLTK $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install endif ifneq (,$X) - $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';) + $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';) endif bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ destdir_from_execdir_SQ=$$(echo '$(gitexecdir_relative_SQ)' | sed -e 's|[^/][^/]*|..|g') && \ { test "$$bindir/" = "$$execdir/" || \ - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ + for p in $(OTHER_PROGRAMS) $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ $(RM) "$$execdir/$$p" && \ test -n "$(INSTALL_SYMLINKS)" && \ ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/$$p" "$$execdir/$$p" || \ @@ -3458,7 +3462,7 @@ clean: profile-clean coverage-clean cocciclean $(RM) git.res $(RM) $(OBJECTS) $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB) - $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X + $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) $(RM) $(TEST_PROGRAMS) $(RM) $(FUZZ_PROGRAMS) $(RM) $(SP_OBJ) @@ -3509,6 +3513,7 @@ ALL_COMMANDS += git-citool ALL_COMMANDS += git-gui ALL_COMMANDS += gitk ALL_COMMANDS += gitweb +ALL_COMMANDS += scalar .PHONY: check-docs check-docs:: diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 2237109b57f..bae203c1fb9 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -610,7 +610,7 @@ unset(CMAKE_REQUIRED_INCLUDES) #programs set(PROGRAMS_BUILT git git-daemon git-http-backend git-sh-i18n--envsubst - git-shell) + git-shell scalar) if(NOT CURL_FOUND) list(APPEND excluded_progs git-http-fetch git-http-push) @@ -757,6 +757,9 @@ target_link_libraries(git-sh-i18n--envsubst common-main) add_executable(git-shell ${CMAKE_SOURCE_DIR}/shell.c) target_link_libraries(git-shell common-main) +add_executable(scalar ${CMAKE_SOURCE_DIR}/scalar.c) +target_link_libraries(scalar common-main) + if(CURL_FOUND) add_library(http_obj OBJECT ${CMAKE_SOURCE_DIR}/http.c) @@ -903,7 +906,7 @@ list(TRANSFORM git_perl_scripts PREPEND "${CMAKE_BINARY_DIR}/") #install foreach(program ${PROGRAMS_BUILT}) -if(program STREQUAL "git" OR program STREQUAL "git-shell") +if(program MATCHES "^(git|git-shell|scalar)$") install(TARGETS ${program} RUNTIME DESTINATION bin) else() @@ -977,7 +980,7 @@ endif() #wrapper scripts set(wrapper_scripts - git git-upload-pack git-receive-pack git-upload-archive git-shell git-remote-ext) + git git-upload-pack git-receive-pack git-upload-archive git-shell git-remote-ext scalar) set(wrapper_test_scripts test-fake-ssh test-tool) diff --git a/contrib/scalar/.gitignore b/contrib/scalar/.gitignore deleted file mode 100644 index ff3d47e84d0..00000000000 --- a/contrib/scalar/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/*.exe -/scalar diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile deleted file mode 100644 index 37f283f35d7..00000000000 --- a/contrib/scalar/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# The default target of this Makefile is... -all:: - -# Import tree-wide shared Makefile behavior and libraries -include ../../shared.mak - -include ../../config.mak.uname --include ../../config.mak.autogen --include ../../config.mak - -TARGETS = scalar$(X) scalar.o -GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a - -all:: scalar$(X) ../../bin-wrappers/scalar - -$(GITLIBS): - $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@) - -$(TARGETS): $(GITLIBS) scalar.c - $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(patsubst %,contrib/scalar/%,$@) - -clean: - $(RM) $(TARGETS) ../../bin-wrappers/scalar - -../../bin-wrappers/scalar: ../../wrap-for-bin.sh Makefile - @mkdir -p ../../bin-wrappers - $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ - -e 's|@@BUILD_DIR@@|$(shell cd ../.. && pwd)|' \ - -e 's|@@PROG@@|contrib/scalar/scalar$(X)|' < $< > $@ && \ - chmod +x $@ - -test: all - $(MAKE) -C t - -.PHONY: $(GITLIBS) all clean test FORCE diff --git a/contrib/scalar/t/Makefile b/contrib/scalar/t/Makefile deleted file mode 100644 index 1ed174a8cf3..00000000000 --- a/contrib/scalar/t/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -# Import tree-wide shared Makefile behavior and libraries -include ../../../shared.mak - -# Run scalar tests -# -# Copyright (c) 2005,2021 Junio C Hamano, Johannes Schindelin -# - --include ../../../config.mak.autogen --include ../../../config.mak - -SHELL_PATH ?= $(SHELL) -PERL_PATH ?= /usr/bin/perl -RM ?= rm -f -PROVE ?= prove -DEFAULT_TEST_TARGET ?= test -TEST_LINT ?= test-lint - -ifdef TEST_OUTPUT_DIRECTORY -TEST_RESULTS_DIRECTORY = $(TEST_OUTPUT_DIRECTORY)/test-results -else -TEST_RESULTS_DIRECTORY = ../../../t/test-results -endif - -# Shell quote; -SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) -PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) -TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY)) - -T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)) - -all: $(DEFAULT_TEST_TARGET) - -test: $(TEST_LINT) - $(MAKE) aggregate-results-and-cleanup - -prove: $(TEST_LINT) - @echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS) - $(MAKE) clean-except-prove-cache - -$(T): - @echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS) - -clean-except-prove-cache: - $(RM) -r 'trash directory'.* - $(RM) -r valgrind/bin - -clean: clean-except-prove-cache - $(RM) .prove - -test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax - -test-lint-duplicates: - @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \ - test -z "$$dups" || { \ - echo >&2 "duplicate test numbers:" $$dups; exit 1; } - -test-lint-executable: - @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \ - test -z "$$bad" || { \ - echo >&2 "non-executable tests:" $$bad; exit 1; } - -test-lint-shell-syntax: - @'$(PERL_PATH_SQ)' ../../../t/check-non-portable-shell.pl $(T) - -aggregate-results-and-cleanup: $(T) - $(MAKE) aggregate-results - $(MAKE) clean - -aggregate-results: - for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \ - echo "$$f"; \ - done | '$(SHELL_PATH_SQ)' ../../../t/aggregate-results.sh - -valgrind: - $(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind" - -test-results: - mkdir -p test-results - -.PHONY: $(T) aggregate-results clean valgrind diff --git a/contrib/scalar/scalar.c b/scalar.c similarity index 100% rename from contrib/scalar/scalar.c rename to scalar.c diff --git a/contrib/scalar/t/t9099-scalar.sh b/t/t9210-scalar.sh similarity index 96% rename from contrib/scalar/t/t9099-scalar.sh rename to t/t9210-scalar.sh index dfb949f52ee..14ca575a214 100755 --- a/contrib/scalar/t/t9099-scalar.sh +++ b/t/t9210-scalar.sh @@ -2,15 +2,9 @@ test_description='test the `scalar` command' -TEST_DIRECTORY=$PWD/../../../t -export TEST_DIRECTORY +. ./test-lib.sh -# Make it work with --no-bin-wrappers -PATH=$PWD/..:$PATH - -. ../../../t/test-lib.sh - -GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab ../cron.txt,launchctl:true,schtasks:true" +GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true" export GIT_TEST_MAINT_SCHEDULER test_expect_success 'scalar shows a usage' ' From patchwork Fri Sep 2 15:56:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12964386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6670BC001B5 for ; Fri, 2 Sep 2022 16:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237618AbiIBQFI (ORCPT ); Fri, 2 Sep 2022 12:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238334AbiIBQEj (ORCPT ); Fri, 2 Sep 2022 12:04:39 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A370043605 for ; Fri, 2 Sep 2022 08:58:42 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id n23-20020a7bc5d7000000b003a62f19b453so3580549wmk.3 for ; Fri, 02 Sep 2022 08:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=34CmBf8CuIsfMqN+5OEJmvDj0KavnYpIi3zcg1sxGUQ=; b=DYL8HHe5hMzVpwzE6iy87hPMW4p8Hm4ZY/SXA9QURDrwTgcGx8kWaZqL8JmAUBFdib lEl1s6oJZh3ykqb+YlOKcnKPJ36b0k4YU5hV+kqUd9f+q0eWZ4j5pE1KMmGcPfw1J/Cs p+87FzFA+FsfqYvrJj1jrYpV9KhffosNUt0I20BzJXLEkZM0k2VrNabwlBV7tvtuEwj1 sbpNOjKKHZbKPnE3eQv9RamGUf8+W1rr6ffJYOFPxRzid+YIUi8nD0GvsnTHYTlw2FGT YuVZuzIS2j0JLqyxuMTjxOQHGd1CdNqWdZLxpyICWZtDqsC+qz6DphWNXWrHc1h25zrL jwMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=34CmBf8CuIsfMqN+5OEJmvDj0KavnYpIi3zcg1sxGUQ=; b=XvsbVB0nc5dgzrZNaZGlryN29Nq7YYYMi7x8FJjXo5KWXxK21tYcz8GxuPVgjQbgV1 UBYCzeswLNhzT9iah/WStdd3PMu2f2nOjy5FCc7X59OhS4gqEjEASuX1vv5eTdUMKRIh ltBbBrd7cSPkQo5XsvFqNZ5XdWJUioMARjDvTZlX496UFhoemaOpALVgxrKBZrwfgtJD j2hVCAIZcm62NtI9B9PFbX6N8QXWZgWmGb+XjpGUWy9t7VNUVTGigORS2ybhIs0F6PAd 9tHwt7wcgzbM3+oz37bNclsQyEqt7NtmuKW3RwSztcGvIZakfmKraYpYZgEXwe7MXoVW Q5gw== X-Gm-Message-State: ACgBeo0ML99bNdGshhqLsNi2vkF2UFBEnbrvHnFfQS6IWBB5vRGB8znA MV2RXtQVHkZylVerXEZU91C++/IG5V8= X-Google-Smtp-Source: AA6agR595xcyLS2m6+PPO+DZwVIsKnZqBi2+9bO9ynImeflMq3O/RpOrP22D9yMdup1Si7JmeQ+A0g== X-Received: by 2002:a05:600c:1546:b0:3a6:a99:aa7 with SMTP id f6-20020a05600c154600b003a60a990aa7mr3167185wmg.109.1662134215753; Fri, 02 Sep 2022 08:56:55 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bk23-20020a0560001d9700b002252884cc91sm1826205wrb.43.2022.09.02.08.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:55 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:44 +0000 Subject: [PATCH v2 3/9] git help: special-case `scalar` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin With this commit, `git help scalar` will open the appropriate manual or HTML page (instead of looking for `gitscalar`). Signed-off-by: Johannes Schindelin Signed-off-by: Victoria Dye --- builtin/help.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/help.c b/builtin/help.c index 09ac4289f13..6f2796f211e 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -440,6 +440,8 @@ static const char *cmd_to_page(const char *git_cmd) return git_cmd; else if (is_git_command(git_cmd)) return xstrfmt("git-%s", git_cmd); + else if (!strcmp("scalar", git_cmd)) + return xstrdup(git_cmd); else return xstrfmt("git%s", git_cmd); } From patchwork Fri Sep 2 15:56:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12964385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 900BFC001B5 for ; Fri, 2 Sep 2022 16:05:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237453AbiIBQFC (ORCPT ); Fri, 2 Sep 2022 12:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238319AbiIBQEi (ORCPT ); Fri, 2 Sep 2022 12:04:38 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE6165810 for ; Fri, 2 Sep 2022 08:58:47 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id n17so2873556wrm.4 for ; Fri, 02 Sep 2022 08:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=b+hSNf9d9LK+B92bNET4jUFRgGR0JVUliICx97zkhh4=; b=GBSMcbNFU7qlrXkntsvLTu+5QV/zV2243ze8Frq/PC6tI4N12Yf6oXBuAUC9v6HN8W AEtl2nby8QSjpsK+cghGQZD4t7ftSBdiYfcHgabgi6uHBUGfekWobkWn1RQOEh/Rkltv MJQ3DQOh+Wz1tCGlPI6JGcHgY3knUZtUA3gCLN2kNz/pHgdhbLJ52HbOx841IxdEiLZ7 iwQN79jHbwgyHP4X1Otf81BWwnNIRUuIowjQeO69EVVikf9KI7Hfji9g7bKi7/LnFQ6A sDmAB40M6SCx38DFP4NVQtY2xJn079c8OoRvtG0RpwyuNjLsIhiG9Cncku6olITOwC5k S74w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=b+hSNf9d9LK+B92bNET4jUFRgGR0JVUliICx97zkhh4=; b=oNEjfJKOrkpQQIHV1eG6FWY31vl0453WFLMySRUppKvyoDQ1C7mSPn52KsEIvkRbNB skk1RGj2FWNUqFuVYU8ochp7QVn6aPK+5OcdTt8rjF1qzrNYisB3RtpA4GcUkX6fP+tr EaPg7VaaM3tKDZHywwbeyKbe/5pWT1apAEMTEh7jS6/50xq3WFdf5ex0L8aAeSvmMKxL HR5sbmbPXxrHcVkFYLr9s/AjYzYIl9RqYzbfYnpUOqcoHoKtJDSfPvlOY2LdFw2Ulx+l DwvwX9v5KgQH08HcxB2Sgw6OVebm6Ictog/vgem/NUnksYCoaySBrss/yGMnK6hdKUSe fp6w== X-Gm-Message-State: ACgBeo1U3tOYIIkJ6QkcaKQvFLUcHRksRJjtYMDzKSziwga0RNbOPzfW C2cV46ydA6V55oaoaEJuzVrGiNFOowM= X-Google-Smtp-Source: AA6agR5JpaYvxw+SkVoHdNCY+eV5+JwhSK3zXbbntitigMPkIJbltrfgjs32JlcxUxj6D8IcNXwB6A== X-Received: by 2002:adf:e80e:0:b0:226:d808:667d with SMTP id o14-20020adfe80e000000b00226d808667dmr15140380wrm.282.1662134216831; Fri, 02 Sep 2022 08:56:56 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bk16-20020a0560001d9000b002258235bda3sm1784774wrb.61.2022.09.02.08.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:56 -0700 (PDT) Message-Id: <55aba052c342c7c5e1f8d3b7908f3662a1dcd0dc.1662134210.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:45 +0000 Subject: [PATCH v2 4/9] scalar: implement the `help` subcommand Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin It is merely handing off to `git help scalar`. Signed-off-by: Johannes Schindelin Signed-off-by: Victoria Dye --- scalar.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scalar.c b/scalar.c index 642d16124eb..c5c1ce68919 100644 --- a/scalar.c +++ b/scalar.c @@ -819,6 +819,25 @@ static int cmd_delete(int argc, const char **argv) return res; } +static int cmd_help(int argc, const char **argv) +{ + struct option options[] = { + OPT_END(), + }; + const char * const usage[] = { + "scalar help", + NULL + }; + + argc = parse_options(argc, argv, NULL, options, + usage, 0); + + if (argc != 0) + usage_with_options(usage, options); + + return run_git("help", "scalar", NULL); +} + static int cmd_version(int argc, const char **argv) { int verbose = 0, build_options = 0; @@ -858,6 +877,7 @@ static struct { { "run", cmd_run }, { "reconfigure", cmd_reconfigure }, { "delete", cmd_delete }, + { "help", cmd_help }, { "version", cmd_version }, { "diagnose", cmd_diagnose }, { NULL, NULL}, From patchwork Fri Sep 2 15:56:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00A68ECAAD5 for ; Fri, 2 Sep 2022 16:13:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235907AbiIBQNk (ORCPT ); Fri, 2 Sep 2022 12:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235438AbiIBQNI (ORCPT ); Fri, 2 Sep 2022 12:13:08 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6309A10950F for ; Fri, 2 Sep 2022 09:09:20 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id se27so4790494ejb.8 for ; Fri, 02 Sep 2022 09:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=oJO2Y7+qunhoUZPELmg7GT5LPuQC6HsgHehra7Pi3vw=; b=KmcJqdHevi6uWAh4Vpqm/Q8cAa4g2E7qJmJumQwyGj0GaQ4Q4NtqqT3DvxxH1rB8V5 aB/KsjwBhN5zdTyNgtZO8qkQflwuk8rFvqBar3kDcMY9B9+NO8qWGUwSKh0A9U3bYSbq ar0YguVuxoiz9eo6xM0SN1Zvhh26VppBYq4n1amBIsNmXZFEli4VrbHXFJwxCV8fF8ld ubHmqN90VOoZddQkeViYMnCQ/vLeaTW0DeoWdksfLquftvfTvCCuZILJuj37xQfRkbGF l+D1ipdSsVeBniItJApwh0Feq1EQe/c0ZDvMW/31XPAxQN4j366STF9DoCgt73D66yM6 YW6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=oJO2Y7+qunhoUZPELmg7GT5LPuQC6HsgHehra7Pi3vw=; b=x7URvKvUo35MvpD4dufd4u0CkSLeeih5KJcVAwndVTFXUYXEN+/hoWlnx+5B9oQ+mz mAmeQtjS/qy90qJ9j91pS0pfZfkMSOG2LeTt74LemlJXS4g/2Zromwul1XrcYeerT78h zfOY+mzosG/dk8vaPfZo0txcOKJ6LbaUOGdEmQ+tTAEf13tu18OCuDptahfrDnbErpw4 JyfTqfKwPbBpst96lIBWm4KawDXvo6ARoFcAeY3A5GUKYdnsmLXQVetWXwRsfr9SY+A3 2nw7lF3tA+fzFpketdGqRM5oh2LpYCJkGvkXcZKiEbc5mio6W38gdppcmgz5yB6lzMb4 WGNA== X-Gm-Message-State: ACgBeo0EOBur2teP3Srv+bXoGLIL1pwGS66u42ftiC+APSIlolI5SnTG Z+KSNRcAslEI0mueg3u/LRPDrh9LSDM= X-Google-Smtp-Source: AA6agR7axNuH9ess+IqeP8rbUaMXw0QM1g3ej7XjtUgEY+jzv0gFzERn+zZT+ol3tK49xP4s0Tufvw== X-Received: by 2002:a5d:6a01:0:b0:21a:338c:4862 with SMTP id m1-20020a5d6a01000000b0021a338c4862mr17269257wru.631.1662134217686; Fri, 02 Sep 2022 08:56:57 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m23-20020a05600c3b1700b003a5e7435190sm10647425wms.32.2022.09.02.08.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:57 -0700 (PDT) Message-Id: <070f195f027e5601b88ca6a0d4c9991b472ad9ab.1662134210.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:46 +0000 Subject: [PATCH v2 5/9] scalar: add to 'git help -a' command list MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Add 'scalar' as a 'mainporcelain' command in the Git command list. Update the regex in 'cmd-list.perl' used to match the first line of command documentation to find 'scalar(1)'. Helped-by: Ævar Arnfjörð Bjarmason Signed-off-by: Victoria Dye --- Documentation/cmd-list.perl | 2 +- command-list.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl index af5da45d287..9515a499a31 100755 --- a/Documentation/cmd-list.perl +++ b/Documentation/cmd-list.perl @@ -10,7 +10,7 @@ sub format_one { $state = 0; open I, '<', "$name.txt" or die "No such file $name.txt"; while () { - if (/^git[a-z0-9-]*\(([0-9])\)$/) { + if (/^(git|scalar)[a-z0-9-]*\(([0-9])\)$/) { $mansection = $1; next; } diff --git a/command-list.txt b/command-list.txt index f96bdabd7d9..93f94e42ab7 100644 --- a/command-list.txt +++ b/command-list.txt @@ -235,3 +235,4 @@ gittutorial guide gittutorial-2 guide gitweb ancillaryinterrogators gitworkflows guide +scalar mainporcelain From patchwork Fri Sep 2 15:56:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3FE2C001B5 for ; Fri, 2 Sep 2022 16:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237673AbiIBQGR (ORCPT ); Fri, 2 Sep 2022 12:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237675AbiIBQFx (ORCPT ); Fri, 2 Sep 2022 12:05:53 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC391264A6 for ; Fri, 2 Sep 2022 08:59:40 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id e13so2889048wrm.1 for ; Fri, 02 Sep 2022 08:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=ebEbClj28u/OFZ6mfth/2Z8IDZ5nSDnITNepZWQuAH8=; b=LLffPWkCwddA0C7C6k5P3KD1YdUrh6xWU3OZiaT29U2vL01WbaMPZfd/h2NSfXmasO FvXlvbaWwyQ6uSmn7EjtHXKLj51HSIhsGbfxclP3P+GuAFlcOUaG+wWSPi5LYMe2pmM1 25Nyv2dbEkvR4Ux82SX3f5tqtsRTLjwxFGUEKh+f2X6K2uPpECCye7I8y5jc6XukWmfh +Y9EGWckXescdgo6893mOzgmT8RbX6SG2QNehJLWXj21FrUbTvuByC8n3ECoyHKnGpLH yDrxU6x9utjKXk3MyB0bc/Df0CiKgxMApwwTNlIGsrIcPJzZ7C0lokXK/XfVqkYoQTzX LE7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=ebEbClj28u/OFZ6mfth/2Z8IDZ5nSDnITNepZWQuAH8=; b=pb/mSLeyDG7ydqs9fhn0vM4EwR/yQ/1IauwHhRvSycdxhzu1qcm5Ym29MaJgS1bD+R pkmMg0mazFrxZuCOf+KlI6crt5NE+rg/+CC8uUqozwmemDYxxiJWOv+6tSK0BYnb24Kw j8vRTDXUZ5kA9TsLSmtMc7EZLvHlygfDCwBf5t6O7TlH4/a9wzimn256V4AaLBJ0Ujvq Qn4efZf/R7yheneIrhYfnCfG1CwAerrQGvLCX/ZxXH6nGPZN1l9tKxhVdj5WARePlSv/ ffdYPOtHYRKOQa/l3Qz3+w8tqwPuJZzbfol4OA49Ut/ZxndrXqZqcYB1oUfhfsz5/nDd tzDg== X-Gm-Message-State: ACgBeo3QODIvDv5ZyDuqrKNMkvl+iJjZ8oo8HeS0FT2WEJxjrLQn1//c kZivju7mljsqxNo2pI4nDdCpotcKM+U= X-Google-Smtp-Source: AA6agR6n5Wp9EXNlfRBTNTkTVVk0IMbXE8+RSWHKh6xVxSD86mHKQK4YQ+BuHAx9GoGkl8/Qdix6FA== X-Received: by 2002:a5d:64cd:0:b0:226:e332:3d1 with SMTP id f13-20020a5d64cd000000b00226e33203d1mr10916664wri.253.1662134218606; Fri, 02 Sep 2022 08:56:58 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id by8-20020a056000098800b0021d6dad334bsm1817867wrb.4.2022.09.02.08.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:58 -0700 (PDT) Message-Id: <15acf20274bc78231cbbcb456b303d24fc2ba425.1662134210.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:47 +0000 Subject: [PATCH v2 6/9] scalar-clone: add test coverage Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Create a new test file ('t9211-scalar-clone.sh') to exercise the options and behavior of the 'scalar clone' command. Each test clones to a unique target location and cleans up the cloned repo only when the test passes. This ensures that failed tests' artifacts are captured in CI artifacts for further debugging. Helped-by: Johannes Schindelin Signed-off-by: Victoria Dye --- t/t9211-scalar-clone.sh | 151 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100755 t/t9211-scalar-clone.sh diff --git a/t/t9211-scalar-clone.sh b/t/t9211-scalar-clone.sh new file mode 100755 index 00000000000..dd33d87e9be --- /dev/null +++ b/t/t9211-scalar-clone.sh @@ -0,0 +1,151 @@ +#!/bin/sh + +test_description='test the `scalar clone` subcommand' + +. ./test-lib.sh + +GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true" +export GIT_TEST_MAINT_SCHEDULER + +test_expect_success 'set up repository to clone' ' + rm -rf .git && + git init to-clone && + ( + cd to-clone && + git branch -m base && + + test_commit first && + test_commit second && + test_commit third && + + git switch -c parallel first && + mkdir -p 1/2 && + test_commit 1/2/3 && + + git switch base && + + # By default, permit + git config uploadpack.allowfilter true && + git config uploadpack.allowanysha1inwant true + ) +' + +cleanup_clone () { + rm -rf "$1" +} + +test_expect_success 'creates content in enlistment root' ' + enlistment=cloned && + + scalar clone "file://$(pwd)/to-clone" $enlistment && + ls -A $enlistment >enlistment-root && + test_line_count = 1 enlistment-root && + test_path_is_dir $enlistment/src && + test_path_is_dir $enlistment/src/.git && + + cleanup_clone $enlistment +' + +test_expect_success 'with spaces' ' + enlistment="cloned with space" && + + scalar clone "file://$(pwd)/to-clone" "$enlistment" && + test_path_is_dir "$enlistment" && + test_path_is_dir "$enlistment/src" && + test_path_is_dir "$enlistment/src/.git" && + + cleanup_clone "$enlistment" +' + +test_expect_success 'partial clone if supported by server' ' + enlistment=partial-clone && + + scalar clone "file://$(pwd)/to-clone" $enlistment && + + ( + cd $enlistment/src && + + # Two promisor packs: one for refs, the other for blobs + ls .git/objects/pack/pack-*.promisor >promisorlist && + test_line_count = 2 promisorlist + ) && + + cleanup_clone $enlistment +' + +test_expect_success 'fall back on full clone if partial unsupported' ' + enlistment=no-partial-support && + + test_config -C to-clone uploadpack.allowfilter false && + test_config -C to-clone uploadpack.allowanysha1inwant false && + + scalar clone "file://$(pwd)/to-clone" $enlistment 2>err && + grep "filtering not recognized by server, ignoring" err && + + ( + cd $enlistment/src && + + # Still get a refs promisor file, but none for blobs + ls .git/objects/pack/pack-*.promisor >promisorlist && + test_line_count = 1 promisorlist + ) && + + cleanup_clone $enlistment +' + +test_expect_success 'initializes sparse-checkout by default' ' + enlistment=sparse && + + scalar clone "file://$(pwd)/to-clone" $enlistment && + ( + cd $enlistment/src && + test_cmp_config true core.sparseCheckout && + test_cmp_config true core.sparseCheckoutCone + ) && + + cleanup_clone $enlistment +' + +test_expect_success '--full-clone does not create sparse-checkout' ' + enlistment=full-clone && + + scalar clone --full-clone "file://$(pwd)/to-clone" $enlistment && + ( + cd $enlistment/src && + test_cmp_config "" --default "" core.sparseCheckout && + test_cmp_config "" --default "" core.sparseCheckoutCone + ) && + + cleanup_clone $enlistment +' + +test_expect_success '--single-branch clones HEAD only' ' + enlistment=single-branch && + + scalar clone --single-branch "file://$(pwd)/to-clone" $enlistment && + ( + cd $enlistment/src && + git for-each-ref refs/remotes/origin >out && + test_line_count = 1 out && + grep "refs/remotes/origin/base" out + ) && + + cleanup_clone $enlistment +' + +test_expect_success '--no-single-branch clones all branches' ' + enlistment=no-single-branch && + + scalar clone --no-single-branch "file://$(pwd)/to-clone" $enlistment && + ( + cd $enlistment/src && + git for-each-ref refs/remotes/origin >out && + test_line_count = 2 out && + grep "refs/remotes/origin/base" out && + grep "refs/remotes/origin/parallel" out + ) && + + cleanup_clone $enlistment +' + +test_done From patchwork Fri Sep 2 15:56:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB0A4ECAAD5 for ; Fri, 2 Sep 2022 16:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236753AbiIBQFi (ORCPT ); Fri, 2 Sep 2022 12:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237421AbiIBQFA (ORCPT ); Fri, 2 Sep 2022 12:05:00 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A7BBB14E5 for ; Fri, 2 Sep 2022 08:59:10 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id w5so2831183wrn.12 for ; Fri, 02 Sep 2022 08:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=RUyY7f8DvONxjrqO0y3le77xZJZhE1LdWC1cW2r7lK8=; b=mYLw6zbo7R0akf1LO98n9ArqXqWofoKtKGpGzXqeYcjIBrYRqEKuYX8TPMZcqrex6r Kx42/TEaFO7N5zF1jxxA6BDrJC9StS4nCiIHCkWoeRXcboqRQHVVF+Twpw26fw01P8UJ 4Ra5dyrdgUhOWnX61U7Cml/42Q1s1XXvxuinMide5U+mfzcQD67kuwUn0iyPTp41pbGe qY8lonpMuU0pqedBSXvWzkUaz7r/2Lf+VOsg4i6V+UMTUVG2aNDoKdllcXaWW7W6f/KR o2UTGhIHVRY/ZhLI3XW/HknjKF1a+NVQ+qkkvWErSfBDOqe7vKBw4RK0yF6BW+EBCVKO ESlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=RUyY7f8DvONxjrqO0y3le77xZJZhE1LdWC1cW2r7lK8=; b=DszUrDNin3uQejdXgs+2oDYawOxQe9/NEGNzmI9FYNizc9R3Rd/61jGZdbAB3tw4E9 Nh5nY5aCFaHAjs24h5hAb0uTzeWKpWWTUxU15WnChnX37g1I8Q5WPnS6kte5927kyHmo U5c7/bZZkiOyTIuRvMVQv8qgRV741Eu6Iy9FFWAzgHo7STN8aRedQd8UIIxP5Sb4jHUg RiSGeImGSU0m3sEwHAC4byZO2paK5aUWZxLK0n7ZT1PnIPTjAOvyxhROnFInnaUP/YHf 04ZA5h9tPva7KnYFGDI1LO1IIRWR48fEg5gQ6t3Dx/2w4g/Y/F3vFblCE2SVMVed2kA3 C7Sw== X-Gm-Message-State: ACgBeo1RkMHTC4BZ2RrzRtFUCjnJLBT7kin3bl2ILrP8dpiOvJ9cmae3 nR667xKz2DBF8mF/YMKno21cwb7FdpI= X-Google-Smtp-Source: AA6agR7C3uGLtaaqhOh2UOjLL9yN5MHZ0elOUh4sgohzen9nfy3a9XxzUQSvsuHGOSc1ndynADTHOQ== X-Received: by 2002:adf:fe44:0:b0:226:da5d:990 with SMTP id m4-20020adffe44000000b00226da5d0990mr15308784wrs.334.1662134219521; Fri, 02 Sep 2022 08:56:59 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id ba10-20020a0560001c0a00b00226fa6cf1d3sm1777041wrb.7.2022.09.02.08.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:56:59 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:48 +0000 Subject: [PATCH v2 7/9] t/perf: add Scalar performance tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Create 'p9210-scalar.sh' for testing Scalar performance and comparing performance of Git operations in Scalar registrations and standard repositories. Example results: Test this tree ------------------------------------------------------------------------ 9210.2: scalar clone 14.82(18.00+3.63) 9210.3: git clone 26.15(36.67+6.90) 9210.4: git status (scalar) 0.04(0.01+0.01) 9210.5: git status (non-scalar) 0.10(0.02+0.11) 9210.6: test_commit --append --no-tag A (scalar) 0.08(0.02+0.03) 9210.7: test_commit --append --no-tag A (non-scalar) 0.13(0.03+0.11) Helped-by: Johannes Schindelin Signed-off-by: Victoria Dye --- t/perf/p9210-scalar.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 t/perf/p9210-scalar.sh diff --git a/t/perf/p9210-scalar.sh b/t/perf/p9210-scalar.sh new file mode 100755 index 00000000000..265f7cd1fe2 --- /dev/null +++ b/t/perf/p9210-scalar.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +test_description='test scalar performance' +. ./perf-lib.sh + +test_perf_large_repo "$TRASH_DIRECTORY/to-clone" + +test_expect_success 'enable server-side partial clone' ' + git -C to-clone config uploadpack.allowFilter true && + git -C to-clone config uploadpack.allowAnySHA1InWant true +' + +test_perf 'scalar clone' ' + rm -rf scalar-clone && + scalar clone "file://$(pwd)/to-clone" scalar-clone +' + +test_perf 'git clone' ' + rm -rf git-clone && + git clone "file://$(pwd)/to-clone" git-clone +' + +test_compare_perf () { + command=$1 + shift + args=$* + test_perf "$command $args (scalar)" " + $command -C scalar-clone/src $args + " + + test_perf "$command $args (non-scalar)" " + $command -C git-clone $args + " +} + +test_compare_perf git status +test_compare_perf test_commit --append --no-tag A + +test_done From patchwork Fri Sep 2 15:56:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9739C001B5 for ; Fri, 2 Sep 2022 16:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237326AbiIBQLX (ORCPT ); Fri, 2 Sep 2022 12:11:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237300AbiIBQLA (ORCPT ); Fri, 2 Sep 2022 12:11:00 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51496140F6 for ; Fri, 2 Sep 2022 09:04:55 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id h204-20020a1c21d5000000b003a5b467c3abso3584056wmh.5 for ; Fri, 02 Sep 2022 09:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=DlLRAX/66uC6N+i/79O4L262ADYw9aS5EPDC0QOrTfk=; b=gSYi0H3WEGhVd1H4n178N9yKWm4bMP118qjYCg932vl7Pu0P8IU5KEOzzezKeCOLBn uvCYCzjIOu7WmV31Q6KGLckfF0HMZpuJYvYvAjrZRav+7R9WqI1zy8r/mbqPnqewqnHh Sn/Z0bWrpI4uol2If+sPPigVIDQwJrVyXmMFrfnXJzqrMJKF9imPdG85eBi3wBytNvX3 tWPKWKLz43+Yoq2cZ53Kae7hfH5ny9BUpOyMHSS8K7mTvIz1SQld+ADmNARZ6dDsG21E R9Ugb8TkGGq+aMB+qaFtB218Z1tdR8KEI2J2yFxNK3+zGAiP3KmKivOfFtyPSWiBSDk3 EQyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=DlLRAX/66uC6N+i/79O4L262ADYw9aS5EPDC0QOrTfk=; b=mC1ZIAd4/blpWU9qSufJwQ+SWLwsD3v0RIxaCF2CUDSbwWUz66WWvxLYSvIwyuelFc +spRfHfnOczVcZl1CBTkXTe7TqNvw/gdB0HNO1i4XwWZWK3IokmDu0TfvmyvtYT2DWGz H5tWZJTkfe7Qv3suNVSHCL6Gx72KBtookdWReTv6ftH15XIR98yDaAPhfTrE/KnJQlG/ OcfW+kzetRfNP/UKZ/xQFqR6L9oNAdUM5VMGfOMSN4ERoqee7PCjByRWKu6qIDpMmpRZ DBD4753Pyg5oG8t9+Q3KnWNs36dzdedbu2+zL8vVmjwwCxFeMUi81wSm7LNPfSzzVj1w sg1g== X-Gm-Message-State: ACgBeo1Hp6q7WYzaMXr4dSUyCR6Hz8PxHbrK+CT0TgXrq6gYI3JrgeBG rvGelGyCXhblCF/EW29t7gPlpk9uq9I= X-Google-Smtp-Source: AA6agR5ST0Kr5f7R+Z3lm68EjDiJVYIRRSDzlrlR96DHj8OBtFVZdhQMQC0e1xEq13pIiUmbiZhZIA== X-Received: by 2002:a05:600c:5028:b0:3a8:4349:153c with SMTP id n40-20020a05600c502800b003a84349153cmr3334686wmr.130.1662134220664; Fri, 02 Sep 2022 08:57:00 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k36-20020a05600c1ca400b003a5f3de6fddsm10345124wms.25.2022.09.02.08.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:57:00 -0700 (PDT) Message-Id: <2e6dd03beba221e68f1af71aabf17e63541401db.1662134210.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:49 +0000 Subject: [PATCH v2 8/9] t/perf: add 'GIT_PERF_USE_SCALAR' run option Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Add a 'GIT_PERF_USE_SCALAR' environment variable (and corresponding perf config 'useScalar') to register a repository created with any of: * test_perf_fresh_repo * test_perf_default_repo * test_perf_large_repo as a Scalar enlistment. This is intended to allow a developer to test the impact of Scalar on already-defined performance scenarios. Suggested-by: Derrick Stolee Signed-off-by: Victoria Dye --- t/perf/README | 4 ++++ t/perf/perf-lib.sh | 13 ++++++++++++- t/perf/run | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/t/perf/README b/t/perf/README index fb9127a66f7..8f217d7be7d 100644 --- a/t/perf/README +++ b/t/perf/README @@ -95,6 +95,10 @@ You can set the following variables (also in your config.mak): Git (e.g., performance of index-pack as the number of threads changes). These can be enabled with GIT_PERF_EXTRA. + GIT_PERF_USE_SCALAR + Boolean indicating whether to register test repo(s) with Scalar + before executing tests. + You can also pass the options taken by ordinary git tests; the most useful one is: diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index 27c28017921..e7786775a90 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -49,6 +49,9 @@ export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP MODERN_GIT=$GIT_BUILD_DIR/bin-wrappers/git export MODERN_GIT +MODERN_SCALAR=$GIT_BUILD_DIR/bin-wrappers/scalar +export MODERN_SCALAR + perf_results_dir=$TEST_RESULTS_DIR test -n "$GIT_PERF_SUBSECTION" && perf_results_dir="$perf_results_dir/$GIT_PERF_SUBSECTION" mkdir -p "$perf_results_dir" @@ -120,6 +123,10 @@ test_perf_create_repo_from () { # status" due to a locked index. Since we have # a copy it's fine to remove the lock. rm .git/index.lock + fi && + if test_bool_env GIT_PERF_USE_SCALAR false + then + "$MODERN_SCALAR" register fi ) || error "failed to copy repository '$source' to '$repo'" } @@ -130,7 +137,11 @@ test_perf_fresh_repo () { "$MODERN_GIT" init -q "$repo" && ( cd "$repo" && - test_perf_do_repo_symlink_config_ + test_perf_do_repo_symlink_config_ && + if test_bool_env GIT_PERF_USE_SCALAR false + then + "$MODERN_SCALAR" register + fi ) } diff --git a/t/perf/run b/t/perf/run index 55219aa4056..33da4d2aba2 100755 --- a/t/perf/run +++ b/t/perf/run @@ -171,6 +171,9 @@ run_subsection () { get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand" get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts" + get_var_from_env_or_config "GIT_PERF_USE_SCALAR" "perf" "useScalar" "--bool" + export GIT_PERF_USE_SCALAR + get_var_from_env_or_config "GIT_PERF_REPO_NAME" "perf" "repoName" export GIT_PERF_REPO_NAME From patchwork Fri Sep 2 15:56:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Dye X-Patchwork-Id: 12964393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE3B4C001B5 for ; Fri, 2 Sep 2022 16:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237466AbiIBQL3 (ORCPT ); Fri, 2 Sep 2022 12:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237453AbiIBQLC (ORCPT ); Fri, 2 Sep 2022 12:11:02 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0606641D01 for ; Fri, 2 Sep 2022 09:05:04 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id az24-20020a05600c601800b003a842e4983cso1710151wmb.0 for ; Fri, 02 Sep 2022 09:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=NHckKwoRME6izHezy19QDuLVea12ybAgp0ADMPSukzw=; b=EzhszcxxrOZItuzER0h0UTYz+sVx8r11oUfCcBekApLlsJygpLPT/ixIkmqQIXQcUT zVJOUlw2qkj1aKp1nPd3UheefKBVBnA5tqpQ/e46Ih5cJLG6RV4ZGvsU8dE2pud4VYmx tb+FOJ1Lc6qTzc1HC3+cuG7A7MvFnl09GMXf5qs4OGmWgfUshjfBxQQGYmlIqAa3PULW hMC7CBBgJVaAu09G3UnLpgEm7YLb0J3KV4+IRaxIBJxwSDu7KnzlBic0PF3gLBcU3rW9 10va3b3OtsA3adsClFVIUuDJWueouOT/L64s7cY5OKs9b8KprkAt9rhE/UI4qW5AqWlJ FChw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=NHckKwoRME6izHezy19QDuLVea12ybAgp0ADMPSukzw=; b=H5KP4xGSqfPwhf719kdgWZjxRzmp81QBKJiM1AuecRGTjXjTAh1X13dpsi+sorPWyb B+otDjmUVXIsGEUFMyJ6G1oY3UMDeyWeSz0UF77hPlvmCwnt91pn0lUdYN+48xpLyPC7 grtMKMxvqYheaGTV01Wxb+941WjwnTN0FNDjHGa4PFASaDqbBUiIlk41NFHehH1Vab+W obkK3JK9QkxD7Y0oQvqFqfe0JjJYGc73wDvh5JKU8XXeKA0my7dYnt6+Zw9oL8q5Ue0A WkoAE04bi8dMFe375XQVzt8Mz0Ib7lmlbewvvRNOPk+Sb/ZwspvFxVjuSMoXpzZl1ohb Duug== X-Gm-Message-State: ACgBeo2kKhEychUzdsxZ0YXHaqFZkVFBDGcwBuAZOBa5MzxDVSxGfzU8 E03sXdJdcadZnjJpaw6Oq8AkFplCedo= X-Google-Smtp-Source: AA6agR4dBhVPUmM7H/O+p88oR1cuSkzdEXXlir6mqyD19sFRAUqsqyz7oMYrP2GVG4GgV6MBCbfSxg== X-Received: by 2002:a1c:7414:0:b0:3a5:fd9e:e629 with SMTP id p20-20020a1c7414000000b003a5fd9ee629mr3392514wmc.194.1662134221616; Fri, 02 Sep 2022 08:57:01 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t64-20020a1c4643000000b003a673055e68sm10154836wma.0.2022.09.02.08.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 08:57:01 -0700 (PDT) Message-Id: <6bedd80c398dd862d17b03528cc14f17e9484391.1662134210.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 15:56:50 +0000 Subject: [PATCH v2 9/9] Documentation/technical: include Scalar technical doc Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: derrickstolee@github.com, johannes.schindelin@gmx.de, gitster@pobox.com, =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Victoria Dye , Victoria Dye Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Victoria Dye From: Victoria Dye Include 'Documentation/technical/scalar.txt' alongside the other HTML technical docs when installing them. Now that the document is intended as a widely-accessible reference, remove the internal work-in-progress roadmap from the document. Those details should no longer be needed to guide Scalar's development and, if they were left, they could fall out-of-date and be misleading to readers. Signed-off-by: Victoria Dye --- Documentation/Makefile | 1 + Documentation/technical/scalar.txt | 61 ------------------------------ 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 16c9e062390..9ec53afdf18 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -116,6 +116,7 @@ TECH_DOCS += technical/parallel-checkout TECH_DOCS += technical/partial-clone TECH_DOCS += technical/racy-git TECH_DOCS += technical/reftable +TECH_DOCS += technical/scalar TECH_DOCS += technical/send-pack-pipeline TECH_DOCS += technical/shallow TECH_DOCS += technical/trivial-merge diff --git a/Documentation/technical/scalar.txt b/Documentation/technical/scalar.txt index 0600150b3ad..921cb104c3c 100644 --- a/Documentation/technical/scalar.txt +++ b/Documentation/technical/scalar.txt @@ -64,64 +64,3 @@ some "global" `git` options (e.g., `-c` and `-C`). Because `scalar` is not invoked as a Git subcommand (like `git scalar`), it is built and installed as its own executable in the `bin/` directory, alongside `git`, `git-gui`, etc. - -Roadmap -------- - -NOTE: this section will be removed once the remaining tasks outlined in this -roadmap are complete. - -Scalar is a large enough project that it is being upstreamed incrementally, -living in `contrib/` until it is feature-complete. So far, the following patch -series have been accepted: - -- `scalar-the-beginning`: The initial patch series which sets up - `contrib/scalar/` and populates it with a minimal `scalar` command that - demonstrates the fundamental ideas. - -- `scalar-c-and-C`: The `scalar` command learns about two options that can be - specified before the command, `-c =` and `-C `. - -- `scalar-diagnose`: The `scalar` command is taught the `diagnose` subcommand. - -- `scalar-generalize-diagnose`: Move the functionality of `scalar diagnose` - into `git diagnose` and `git bugreport --diagnose`. - -- 'scalar-add-fsmonitor: Enable the built-in FSMonitor in Scalar - enlistments. At the end of this series, Scalar should be feature-complete - from the perspective of a user. - -Roughly speaking (and subject to change), the following series are needed to -"finish" this initial version of Scalar: - -- Move Scalar to toplevel: Move Scalar out of `contrib/` and into the root of - `git`. This includes a variety of related updates, including: - - building & installing Scalar in the Git root-level 'make [install]'. - - builing & testing Scalar as part of CI. - - moving and expanding test coverage of Scalar (including perf tests). - - implementing 'scalar help'/'git help scalar' to display scalar - documentation. - -Finally, there are two additional patch series that exist in Microsoft's fork of -Git, but there is no current plan to upstream them. There are some interesting -ideas there, but the implementation is too specific to Azure Repos and/or VFS -for Git to be of much help in general. - -These still exist mainly because the GVFS protocol is what Azure Repos has -instead of partial clone, while Git is focused on improving partial clone: - -- `scalar-with-gvfs`: The primary purpose of this patch series is to support - existing Scalar users whose repositories are hosted in Azure Repos (which does - not support Git's partial clones, but supports its predecessor, the GVFS - protocol, which is used by Scalar to emulate the partial clone). - - Since the GVFS protocol will never be supported by core Git, this patch series - will remain in Microsoft's fork of Git. - -- `run-scalar-functional-tests`: The Scalar project developed a quite - comprehensive set of integration tests (or, "Functional Tests"). They are the - sole remaining part of the original C#-based Scalar project, and this patch - adds a GitHub workflow that runs them all. - - Since the tests partially depend on features that are only provided in the - `scalar-with-gvfs` patch series, this patch cannot be upstreamed.