{"thread":{"id":"53996","subject":"[PATCH 0/4] Fit the building tools to Plan 9 environment","startedAt":"2020-08-06T01:05:20Z","lastAt":"2020-09-10T05:31:12Z","messageCount":29,"participants":["KADOTA, Kyohei via GitGitGadget","lufia via GitGitGadget","brian m. carlson","Eric Sunshine","Kyohei Kadota","Junio C Hamano","Kyohei Kadota via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"403013","messageId":"pull.694.git.1596675905.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":null,"subject":"[PATCH 0/4] Fit the building tools to Plan 9 environment","fromName":"KADOTA, Kyohei via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-06T01:05:00Z","receivedAt":"2020-08-06T01:05:20Z","isPatch":true,"sender":{"key":"name:KADOTA, Kyohei","avatar":null},"body":"I've posted some commits for porting git to Plan 9.\n\nThis pull request is thing that cut off building scripts from #305 and is\nre-constructed that.\n\nI expect this don't change any artifacts.\n\nlufia (4):\n  Use $(SHELL_PATH) instead of sh in Makefile.\n  Define TAR_CF and TAR_XF variables in Makefile\n  Fit to Plan 9's ANSI/POSIX compatibility layer\n  Use $(LD) instead of $(CC) for linking the object files\n\n .github/workflows/main.yml |  1 +\n GIT-VERSION-GEN            |  2 +-\n Makefile                   | 33 ++++++++++---------\n ci/lib.sh                  |  8 ++++-\n config.mak.in              |  1 +\n config.mak.uname           | 18 +++++++----\n generate-cmdlist.sh        | 19 +++++++----\n git-gui/Makefile           |  6 ++--\n t/chainlint.sed            | 66 +++++++++++++++++++-------------------\n templates/Makefile         |  6 ++--\n 10 files changed, 93 insertions(+), 67 deletions(-)\n\n\nbase-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-694%2Flufia%2Fcompat-p9-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-694/lufia/compat-p9-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/694\n-- \ngitgitgadget\n"},{"id":"403014","messageId":"22f8f3e37a18263d890307701903dc18c98aa54b.1596675905.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.git.1596675905.gitgitgadget@gmail.com","subject":"[PATCH 2/4] Define TAR_CF and TAR_XF variables in Makefile","fromName":"lufia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-06T01:05:02Z","receivedAt":"2020-08-06T01:05:31Z","isPatch":true,"sender":{"key":"name:lufia","avatar":null},"body":"From: lufia <lufia@lufia.org>\n\nPlan 9's tar(1) don't support o option.\nSo I changed Makefiles to replace tar commands if needed.\n\nSigned-off-by: lufia <lufia@lufia.org>\n---\n Makefile           | 14 ++++++++------\n templates/Makefile |  6 ++++--\n 2 files changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 372139f1f2..e222241509 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -547,6 +547,8 @@ AR = ar\n RM = rm -f\n DIFF = diff\n TAR = tar\n+TAR_CF = $(TAR) cf\n+TAR_XF = $(TAR) xof\n FIND = find\n INSTALL = install\n TCL_PATH = tclsh\n@@ -2926,13 +2928,13 @@ endif\n \t$(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'\n ifndef NO_GETTEXT\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'\n-\t(cd po/build/locale && $(TAR) cf - .) | \\\n-\t(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)\n+\t(cd po/build/locale && $(TAR_CF) - .) | \\\n+\t(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR_XF) -)\n endif\n ifndef NO_PERL\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'\n-\t(cd perl/build/lib && $(TAR) cf - .) | \\\n-\t(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)\n+\t(cd perl/build/lib && $(TAR_CF) - .) | \\\n+\t(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR_XF) -)\n \t$(MAKE) -C gitweb install\n endif\n ifndef NO_TCLTK\n@@ -2999,8 +3001,8 @@ install-man: install-man-perl\n \n install-man-perl: man-perl\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3'\n-\t(cd perl/build/man/man3 && $(TAR) cf - .) | \\\n-\t(cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -)\n+\t(cd perl/build/man/man3 && $(TAR_CF) - .) | \\\n+\t(cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR_XF) -)\n \n install-html:\n \t$(MAKE) -C Documentation install-html\ndiff --git a/templates/Makefile b/templates/Makefile\nindex d22a71a399..eddc07effb 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -6,6 +6,8 @@ endif\n \n INSTALL ?= install\n TAR ?= tar\n+TAR_CF ?= tar cf\n+TAR_XF ?= tar xof\n RM ?= rm -f\n prefix ?= $(HOME)\n template_instdir ?= $(prefix)/share/git-core/templates\n@@ -62,5 +64,5 @@ clean:\n \n install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'\n-\t(cd blt && $(TAR) cf - .) | \\\n-\t(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -)\n+\t(cd blt && $(TAR_CF) - .) | \\\n+\t(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR_XF) -)\n-- \ngitgitgadget\n\n"},{"id":"403015","messageId":"1f63b4fc7c2ae1970d7226bbf0b66901528fb9d8.1596675905.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.git.1596675905.gitgitgadget@gmail.com","subject":"[PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile.","fromName":"lufia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-06T01:05:01Z","receivedAt":"2020-08-06T01:05:34Z","isPatch":true,"sender":{"key":"name:lufia","avatar":null},"body":"From: lufia <lufia@lufia.org>\n\nIn the not POSIX environment, like Plan 9, sh might not be looked up\nin the directories named by the $PATH.\n\nSigned-off-by: lufia <lufia@lufia.org>\n---\n config.mak.uname | 12 ++++++------\n git-gui/Makefile |  6 +++---\n 2 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex c7eba69e54..f3eb2b91a2 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -4,12 +4,12 @@\n # Microsoft's Safe Exception Handling in libraries (such as zlib).\n # Typically required for VS2013+/32-bit compilation on Vista+ versions.\n \n-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n-uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n-uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n-uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')\n-uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')\n-uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')\n+uname_S := $(shell $(SHELL_PATH) -c 'uname -s 2>/dev/null || echo not')\n+uname_M := $(shell $(SHELL_PATH) -c 'uname -m 2>/dev/null || echo not')\n+uname_O := $(shell $(SHELL_PATH) -c 'uname -o 2>/dev/null || echo not')\n+uname_R := $(shell $(SHELL_PATH) -c 'uname -r 2>/dev/null || echo not')\n+uname_P := $(shell $(SHELL_PATH) -c 'uname -p 2>/dev/null || echo not')\n+uname_V := $(shell $(SHELL_PATH) -c 'uname -v 2>/dev/null || echo not')\n \n ifdef MSVC\n \t# avoid the MingW and Cygwin configuration sections\ndiff --git a/git-gui/Makefile b/git-gui/Makefile\nindex f10caedaa7..c47603c397 100644\n--- a/git-gui/Makefile\n+++ b/git-gui/Makefile\n@@ -11,9 +11,9 @@ GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n -include GIT-VERSION-FILE\n \n-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n-uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n-uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')\n+uname_S := $(shell $(SHELL_PATH) -c 'uname -s 2>/dev/null || echo not')\n+uname_O := $(shell $(SHELL_PATH) -c 'uname -o 2>/dev/null || echo not')\n+uname_R := $(shell $(SHELL_PATH) -c 'uname -r 2>/dev/null || echo not')\n \n SCRIPT_SH = git-gui.sh\n GITGUI_MAIN := git-gui\n-- \ngitgitgadget\n\n"},{"id":"403016","messageId":"4ebd56a3c52c2a4a47d69d851f75deccc3ce8932.1596675905.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.git.1596675905.gitgitgadget@gmail.com","subject":"[PATCH 4/4] Use $(LD) instead of $(CC) for linking the object files","fromName":"lufia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-06T01:05:04Z","receivedAt":"2020-08-06T01:05:35Z","isPatch":true,"sender":{"key":"name:lufia","avatar":null},"body":"From: lufia <lufia@lufia.org>\n\nPlan 9's loader(aka. linker) is separated from the compiler.\nThe compilers are called 8c, 6c... for each machine architectures;\ncorresponded loaders are called 8l, 6l...\n\nSigned-off-by: lufia <lufia@lufia.org>\n---\n .github/workflows/main.yml |  1 +\n Makefile                   | 19 ++++++++++---------\n ci/lib.sh                  |  8 +++++++-\n config.mak.in              |  1 +\n config.mak.uname           |  6 ++++++\n 5 files changed, 25 insertions(+), 10 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 84a5dcff7a..37b006f371 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -243,6 +243,7 @@ jobs:\n             pool: ubuntu-latest\n     env:\n       CC: ${{matrix.vector.cc}}\n+      LD: ${{matrix.vector.cc}}\n       jobname: ${{matrix.vector.jobname}}\n     runs-on: ${{matrix.vector.pool}}\n     steps:\ndiff --git a/Makefile b/Makefile\nindex e222241509..a52a05604a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -543,6 +543,7 @@ export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir\n \n # Set our default programs\n CC = cc\n+LD = cc\n AR = ar\n RM = rm -f\n DIFF = diff\n@@ -2128,7 +2129,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \\\n \t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'\n \n git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) \\\n \t\t$(filter %.o,$^) $(LIBS)\n \n help.sp help.s help.o: command-list.h\n@@ -2459,25 +2460,25 @@ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n endif\n \n git-%$X: %.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n \n git-bugreport$X: bugreport.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(LIBS)\n \n git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(IMAP_SEND_LDFLAGS) $(LIBS)\n \n git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(LIBS)\n git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \\\n \t$(VCSSVN_LIB)\n \n $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n@@ -2487,7 +2488,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n \tcp $< $@\n \n $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n $(LIB_FILE): $(LIB_OBJS)\n@@ -2782,7 +2783,7 @@ t/helper/test-svn-fe$X: $(VCSSVN_LIB)\n t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n \n t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n \n check-sha1:: t/helper/test-tool$X\n \tt/helper/test-sha1.sh\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 3eefec500d..19c5beb277 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -125,6 +125,7 @@ then\n \ttest darwin != \"$CI_OS_NAME\" || CI_OS_NAME=osx\n \tCI_REPO_SLUG=\"$(expr \"$BUILD_REPOSITORY_URI\" : '.*/\\([^/]*/[^/]*\\)$')\"\n \tCC=\"${CC:-gcc}\"\n+\tLD=\"$CC\"\n \n \t# use a subdirectory of the cache dir (because the file share is shared\n \t# among *all* phases)\n@@ -149,6 +150,7 @@ then\n \tCI_REPO_SLUG=\"$GITHUB_REPOSITORY\"\n \tCI_JOB_ID=\"$GITHUB_RUN_ID\"\n \tCC=\"${CC:-gcc}\"\n+\tLD=\"$CC\"\n \n \tcache_dir=\"$HOME/none\"\n \n@@ -184,6 +186,7 @@ linux-clang|linux-gcc)\n \tif [ \"$jobname\" = linux-gcc ]\n \tthen\n \t\texport CC=gcc-8\n+\t\texport LD=\"$CC\"\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n@@ -207,6 +210,7 @@ osx-clang|osx-gcc)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n \t\texport CC=gcc-9\n+\t\texport LD=\"$CC\"\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python2)\"\n@@ -222,12 +226,14 @@ GETTEXT_POISON)\n \t;;\n Linux32)\n \tCC=gcc\n+\tLD=\"$CC\"\n \t;;\n linux-musl)\n \tCC=gcc\n+\tLD=\"$CC\"\n \tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes\"\n \tMAKEFLAGS=\"$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes\"\n \t;;\n esac\n \n-MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc}\"\n+MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc} LD=${LD:-cc}\"\ndiff --git a/config.mak.in b/config.mak.in\nindex e6a6d0f941..76ea7e781e 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -2,6 +2,7 @@\n # @configure_input@\n \n CC = @CC@\n+LD = @CC@\n CFLAGS = @CFLAGS@\n CPPFLAGS = @CPPFLAGS@\n LDFLAGS = @LDFLAGS@\ndiff --git a/config.mak.uname b/config.mak.uname\nindex f3eb2b91a2..3c4c11eec1 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -69,6 +69,7 @@ ifeq ($(uname_S),GNU/kFreeBSD)\n endif\n ifeq ($(uname_S),UnixWare)\n \tCC = cc\n+\tLD = $(CC)\n \tNEEDS_SOCKET = YesPlease\n \tNEEDS_NSL = YesPlease\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n@@ -90,6 +91,7 @@ ifeq ($(uname_S),SCO_SV)\n \tendif\n \tifeq ($(uname_R),5)\n \t\tCC = cc\n+\t\tLD = $(CC)\n \t\tBASIC_CFLAGS += -Kthread\n \tendif\n \tNEEDS_SOCKET = YesPlease\n@@ -435,6 +437,7 @@ ifeq ($(uname_S),Windows)\n \tDEFAULT_HELP_FORMAT = html\n \n \tCC = compat/vcbuild/scripts/clink.pl\n+\tLD = $(CC)\n \tAR = compat/vcbuild/scripts/lib.pl\n \tCFLAGS =\n \tBASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE\n@@ -525,6 +528,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n \tifeq ($(uname_R).$(uname_V),L17.02)\n \t\tCC += -WRVU=L16.05\n \tendif\n+\tLD = $(CC)\n \t# Disable all optimization, seems to result in bad code, with -O or -O2\n \t# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects\n \t# abends on \"git push\". Needs more investigation.\n@@ -665,8 +669,10 @@ else\n \t\t\tBASIC_LDFLAGS += -Wl,--large-address-aware\n \t\tendif\n \t\tCC = gcc\n+\t\tLD = $(CC)\n \t\tCOMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \\\n \t\t\t-fstack-protector-strong\n+\t\tBASIC_LDFLAGS += -fstack-protector-strong\n \t\tEXTLIBS += -lntdll\n \t\tINSTALL = /bin/install\n \t\tNO_R_TO_GCC_LINKER = YesPlease\n-- \ngitgitgadget\n"},{"id":"403017","messageId":"d15ed626de65c51ef2ba31020eeb2111fb8e091f.1596675905.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.git.1596675905.gitgitgadget@gmail.com","subject":"[PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"lufia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-06T01:05:03Z","receivedAt":"2020-08-06T01:05:36Z","isPatch":true,"sender":{"key":"name:lufia","avatar":null},"body":"From: lufia <lufia@lufia.org>\n\nThat haven't any commands: cut, expr and printf.\n\nAnd its sed(1)'s label is limited to maximum seven characters.\nTherefore I replaced some labels to drop a character.\n\n* close -> cl\n* continue -> cont (cnt is used for count)\n* line -> ln\n* hered -> hdoc\n* shell -> sh\n* string -> str\n\nSigned-off-by: lufia <lufia@lufia.org>\n---\n GIT-VERSION-GEN     |  2 +-\n generate-cmdlist.sh | 19 ++++++++-----\n t/chainlint.sed     | 66 ++++++++++++++++++++++-----------------------\n 3 files changed, 47 insertions(+), 40 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 9db2f4feab..a7cc01caf9 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -26,7 +26,7 @@ else\n \tVN=\"$DEF_VER\"\n fi\n \n-VN=$(expr \"$VN\" : v*'\\(.*\\)')\n+VN=${VN#v}\n \n if test -r $GVF\n then\ndiff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\nindex 45fecf8bdf..8344ca6264 100755\n--- a/generate-cmdlist.sh\n+++ b/generate-cmdlist.sh\n@@ -6,11 +6,11 @@ die () {\n }\n \n command_list () {\n-\teval \"grep -ve '^#' $exclude_programs\" <\"$1\"\n+\teval \"grep -v -e '^#' $exclude_programs\" <\"$1\"\n }\n \n get_categories () {\n-\ttr ' ' '\\n'|\n+\ttr ' ' '\\012'|\n \tgrep -v '^$' |\n \tsort |\n \tuniq\n@@ -18,13 +18,13 @@ get_categories () {\n \n category_list () {\n \tcommand_list \"$1\" |\n-\tcut -c 40- |\n+\tawk '{ print substr($0, 40) }' |\n \tget_categories\n }\n \n get_synopsis () {\n \tsed -n '\n-\t\t/^NAME/,/'\"$1\"'/H\n+\t\t/^NAME/,/'\"$1\"'/h\n \t\t${\n \t\t\tx\n \t\t\ts/.*'\"$1\"' - \\(.*\\)/N_(\"\\1\")/\n@@ -60,16 +60,23 @@ define_category_names () {\n \techo \"};\"\n }\n \n+if test -z \"$(echo -n)\"\n+then\n+\talias print='echo -n'\n+else\n+\talias print='printf %s'\n+fi\n+\n print_command_list () {\n \techo \"static struct cmdname_help command_list[] = {\"\n \n \tcommand_list \"$1\" |\n \twhile read cmd rest\n \tdo\n-\t\tprintf \"\t{ \\\"$cmd\\\", $(get_synopsis $cmd), 0\"\n+\t\tprint \"\t{ \\\"$cmd\\\", $(get_synopsis $cmd), 0\"\n \t\tfor cat in $(echo \"$rest\" | get_categories)\n \t\tdo\n-\t\t\tprintf \" | CAT_$cat\"\n+\t\t\tprint \" | CAT_$cat\"\n \t\tdone\n \t\techo \" },\"\n \tdone\ndiff --git a/t/chainlint.sed b/t/chainlint.sed\nindex 70df40e34b..8a25c5b855 100644\n--- a/t/chainlint.sed\n+++ b/t/chainlint.sed\n@@ -117,7 +117,7 @@\n /^[ \t]*!*[ \t]*(..*)[ \t]*[0-9]*[<>|&]/boneline\n \n # multi-line \"(...\\n...)\"\n-/^[ \t]*(/bsubshell\n+/^[ \t]*(/bsubsh\n \n # innocuous line -- print it and advance to next line\n b\n@@ -130,11 +130,11 @@ b\n }\n b\n \n-:subshell\n+:subsh\n # bare \"(\" line? -- stash for later printing\n /^[ \t]*([\t]*$/ {\n \th\n-\tbnextline\n+\tbnextln\n }\n # \"(...\" line -- split off and stash \"(\", then process \"...\" as its own line\n x\n@@ -143,7 +143,7 @@ x\n s/(//\n bslurp\n \n-:nextline\n+:nextln\n N\n s/.*\\n//\n \n@@ -151,10 +151,10 @@ s/.*\\n//\n # incomplete line \"...\\\"\n /\\\\$/bicmplte\n # multi-line quoted string \"...\\n...\"?\n-/\"/bdqstring\n+/\"/bdqstr\n # multi-line quoted string '...\\n...'? (but not contraction in string \"it's\")\n /'/{\n-\t/\"[^'\"]*'[^'\"]*\"/!bsqstring\n+\t/\"[^'\"]*'[^'\"]*\"/!bsqstr\n }\n :folded\n # here-doc -- swallow it\n@@ -163,8 +163,8 @@ s/.*\\n//\n # before closing \")\", \"done\", \"elsif\", \"else\", or \"fi\" will need to be\n # re-visited to drop \"suspect\" marking since final line of those constructs\n # legitimately lacks \"&&\", so \"suspect\" mark must be removed\n-/^[ \t]*#/bnextline\n-/^[ \t]*$/bnextline\n+/^[ \t]*#/bnextln\n+/^[ \t]*$/bnextln\n # in-line comment -- strip it (but not \"#\" in a string, Bash ${#...} array\n # length, or Perforce \"//depot/path#42\" revision in filespec)\n /[ \t]#/{\n@@ -175,22 +175,22 @@ s/.*\\n//\n # multi-line \"case ... esac\"\n /^[ \t]*case[ \t]..*[ \t]in/bcase\n # multi-line \"for ... done\" or \"while ... done\"\n-/^[ \t]*for[ \t]..*[ \t]in/bcontinue\n-/^[ \t]*while[ \t]/bcontinue\n-/^[ \t]*do[ \t]/bcontinue\n-/^[ \t]*do[ \t]*$/bcontinue\n-/;[ \t]*do/bcontinue\n+/^[ \t]*for[ \t]..*[ \t]in/bcont\n+/^[ \t]*while[ \t]/bcont\n+/^[ \t]*do[ \t]/bcont\n+/^[ \t]*do[ \t]*$/bcont\n+/;[ \t]*do/bcont\n /^[ \t]*done[ \t]*&&[ \t]*$/bdone\n /^[ \t]*done[ \t]*$/bdone\n /^[ \t]*done[ \t]*[<>|]/bdone\n /^[ \t]*done[ \t]*)/bdone\n-/||[ \t]*exit[ \t]/bcontinue\n-/||[ \t]*exit[ \t]*$/bcontinue\n+/||[ \t]*exit[ \t]/bcont\n+/||[ \t]*exit[ \t]*$/bcont\n # multi-line \"if...elsif...else...fi\"\n-/^[ \t]*if[ \t]/bcontinue\n-/^[ \t]*then[ \t]/bcontinue\n-/^[ \t]*then[ \t]*$/bcontinue\n-/;[ \t]*then/bcontinue\n+/^[ \t]*if[ \t]/bcont\n+/^[ \t]*then[ \t]/bcont\n+/^[ \t]*then[ \t]*$/bcont\n+/;[ \t]*then/bcont\n /^[ \t]*elif[ \t]/belse\n /^[ \t]*elif[ \t]*$/belse\n /^[ \t]*else[ \t]/belse\n@@ -234,10 +234,10 @@ s/.*\\n//\n \t}\n }\n # line ends with pipe \"...|\" -- valid; not missing \"&&\"\n-/|[ \t]*$/bcontinue\n+/|[ \t]*$/bcont\n # missing end-of-line \"&&\" -- mark suspect\n /&&[ \t]*$/!s/^/?!AMP?!/\n-:continue\n+:cont\n # retrieve and print previous line\n x\n n\n@@ -250,7 +250,7 @@ s/\\\\\\n//\n bslurp\n \n # check for multi-line double-quoted string \"...\\n...\" -- fold to one line\n-:dqstring\n+:dqstr\n # remove all quote pairs\n s/\"\\([^\"]*\\)\"/@!\\1@!/g\n # done if no dangling quote\n@@ -258,13 +258,13 @@ s/\"\\([^\"]*\\)\"/@!\\1@!/g\n # otherwise, slurp next line and try again\n N\n s/\\n//\n-bdqstring\n+bdqstr\n :dqdone\n s/@!/\"/g\n bfolded\n \n # check for multi-line single-quoted string '...\\n...' -- fold to one line\n-:sqstring\n+:sqstr\n # remove all quote pairs\n s/'\\([^']*\\)'/@!\\1@!/g\n # done if no dangling quote\n@@ -272,7 +272,7 @@ s/'\\([^']*\\)'/@!\\1@!/g\n # otherwise, slurp next line and try again\n N\n s/\\n//\n-bsqstring\n+bsqstr\n :sqdone\n s/@!/'/g\n bfolded\n@@ -282,11 +282,11 @@ bfolded\n :heredoc\n s/^\\(.*\\)<<[ \t]*[-\\\\'\"]*\\([A-Za-z0-9_][A-Za-z0-9_]*\\)['\"]*/<\\2>\\1<</\n s/[ \t]*<<//\n-:heredsub\n+:hdocsub\n N\n /^<\\([^>]*\\)>.*\\n[ \t]*\\1[ \t]*$/!{\n \ts/\\n.*$//\n-\tbheredsub\n+\tbhdocsub\n }\n s/^<[^>]*>//\n s/\\n.*$//\n@@ -305,7 +305,7 @@ bcase\n x\n s/?!AMP?!//\n x\n-bcontinue\n+bcont\n \n # found \"done\" closing for-loop or while-loop, or \"fi\" closing if-then -- drop\n # \"suspect\" from final contained line since that line legitimately lacks \"&&\"\n@@ -321,10 +321,10 @@ bchkchn\n # found nested multi-line \"(...\\n...)\" -- pass through untouched\n :nest\n x\n-:nstslurp\n+:nstslrp\n n\n # closing \")\" on own line -- stop nested slurp\n-/^[ \t]*)/bnstclose\n+/^[ \t]*)/bnstcl\n # comment -- not closing \")\" if in comment\n /^[ \t]*#/bnstcnt\n # \"$((...))\" -- arithmetic expansion; not closing \")\"\n@@ -332,11 +332,11 @@ n\n # \"$(...)\" -- command substitution; not closing \")\"\n /\\$([^)][^)]*)[^)]*$/bnstcnt\n # closing \"...)\" -- stop nested slurp\n-/)/bnstclose\n+/)/bnstcl\n :nstcnt\n x\n-bnstslurp\n-:nstclose\n+bnstslrp\n+:nstcl\n s/^/>>/\n # is it \"))\" which closes nested and parent subshells?\n /)[ \t]*)/bslurp\n-- \ngitgitgadget\n\n"},{"id":"403019","messageId":"20200806020407.GR6540@camp.crustytoothpaste.net","threadId":"53996","inReplyTo":"d15ed626de65c51ef2ba31020eeb2111fb8e091f.1596675905.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-08-06T02:04:07Z","receivedAt":"2020-08-06T02:04:46Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-08-06 at 01:05:03, lufia via GitGitGadget wrote:\n> From: lufia <lufia@lufia.org>\n> \n> That haven't any commands: cut, expr and printf.\n\nIs this ANSI/POSIX environment the one mentioned at [0]?  That page\ndescribes it as supporting POSIX 1003.1-1990, which is a bit dated.  I\nthink we generally assume one has the 2001 edition or later, so you'll\nhave your work cut out for you.\n\n> And its sed(1)'s label is limited to maximum seven characters.\n> Therefore I replaced some labels to drop a character.\n> \n> * close -> cl\n> * continue -> cont (cnt is used for count)\n> * line -> ln\n> * hered -> hdoc\n> * shell -> sh\n> * string -> str\n> \n> Signed-off-by: lufia <lufia@lufia.org>\n\nI will note that usually the project prefers to have a human's personal\nname here and in the commit metadata instead of a username.  Junio may\nchime in here with an opinion.\n\n>  command_list () {\n> -\teval \"grep -ve '^#' $exclude_programs\" <\"$1\"\n> +\teval \"grep -v -e '^#' $exclude_programs\" <\"$1\"\n\nIs it really the case that Plan 9's grep cannot deal with bundled short\noptions?  That seems to be a significant departure from POSIX and Unix\nbehavior.  Regardless, this should be explained in the commit message.\n\n>  get_categories () {\n> -\ttr ' ' '\\n'|\n> +\ttr ' ' '\\012'|\n\nOkay, I guess.  Is this something we need to handle elsewhere as well?\nThe commit message should tell us why this is necessary, and what Plan 9\ndoes and doesn't support.\n\n>  \tgrep -v '^$' |\n>  \tsort |\n>  \tuniq\n> @@ -18,13 +18,13 @@ get_categories () {\n>  \n>  category_list () {\n>  \tcommand_list \"$1\" |\n> -\tcut -c 40- |\n> +\tawk '{ print substr($0, 40) }' |\n\nI can tell that you haven't gotten the test suite working because I've\nadded a large number of cut invocations there.  I suspect you're going\nto need to provide a portability wrapper there that implements it using\nawk, sed, or perl.\n\n> +if test -z \"$(echo -n)\"\n> +then\n> +\talias print='echo -n'\n> +else\n> +\talias print='printf %s'\n> +fi\n\nLet's avoid an alias here (especially with a common builtin name) and\ninstead use a shell function.  Maybe like this (not tab-indented):\n\n  print_nonl () {\n    if command -v printf >/dev/null 2>&1\n    then\n      printf \"%s\" \"$@\"\n    else\n      echo -n \"$@\"\n    fi\n  }\n\nNotice also that we prefer the standard form and fall back to the\nnonstandard form if the system is less capable.  I don't know if Plan 9\nsupports \"command -v\"; \"type\" may be preferable, but isn't supported by\nsome other shells (e.g., posh).  For portability reasons, we may need to\ntry to run printf and see if it fails.\n\nThis is also going to need some patching in the testsuite, since we use\nprintf extensively (more than 1300 times).  I do hope you have perl\navailable.\n\n[0] http://doc.cat-v.org/plan_9/4th_edition/papers/ape\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"403020","messageId":"20200806021354.GS6540@camp.crustytoothpaste.net","threadId":"53996","inReplyTo":"1f63b4fc7c2ae1970d7226bbf0b66901528fb9d8.1596675905.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile.","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-08-06T02:13:54Z","receivedAt":"2020-08-06T02:14:03Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-08-06 at 01:05:01, lufia via GitGitGadget wrote:\n> From: lufia <lufia@lufia.org>\n> \n> In the not POSIX environment, like Plan 9, sh might not be looked up\n> in the directories named by the $PATH.\n\nI think Git's editor handling assumes that sh is somewhere in the PATH,\nso it might be fine for us to just ask the user to adjust PATH\nappropriately before running make.  I don't have a strong preference; if\nthis works on a standard Unix machine, which it looks like it should\n(although I haven't tested), I'm fine with it.\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"403021","messageId":"20200806022350.GT6540@camp.crustytoothpaste.net","threadId":"53996","inReplyTo":"pull.694.git.1596675905.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/4] Fit the building tools to Plan 9 environment","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-08-06T02:23:50Z","receivedAt":"2020-08-06T02:23:59Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-08-06 at 01:05:00, KADOTA, Kyohei via GitGitGadget wrote:\n> I've posted some commits for porting git to Plan 9.\n> \n> This pull request is thing that cut off building scripts from #305 and is\n> re-constructed that.\n> \n> I expect this don't change any artifacts.\n\nI took a look at this and left some comments.  I expect you're going to\nhave your work cut out for you in the test suite due to the lack of\ngood, modern POSIX support.\n\nI regret to report that I looked at the source code of the ANSI/POSIX\nenvironment from the Berkeley release and found that it's mostly shell\nscripts (well, rc scripts) and has all of the functionality one would\nexpect from that.  I suspect that this will not make the port any\neasier.\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"403023","messageId":"CAPig+cRe2OUeHXE3XELtkS7b2GrZVxLm0pzduojDB97uLnBZKQ@mail.gmail.com","threadId":"53996","inReplyTo":"20200806021354.GS6540@camp.crustytoothpaste.net","subject":"Re: [PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile.","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-08-06T04:10:09Z","receivedAt":"2020-08-06T04:10:24Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Aug 5, 2020 at 10:14 PM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> On 2020-08-06 at 01:05:01, lufia via GitGitGadget wrote:\n> > In the not POSIX environment, like Plan 9, sh might not be looked up\n> > in the directories named by the $PATH.\n>\n> I think Git's editor handling assumes that sh is somewhere in the PATH,\n> so it might be fine for us to just ask the user to adjust PATH\n> appropriately before running make.  I don't have a strong preference; if\n> this works on a standard Unix machine, which it looks like it should\n> (although I haven't tested), I'm fine with it.\n\nThis does, however, have a bit of a chicken-and-egg feel to it. The\nresults of the \"uname_FOO\" assignments in config.mak.uname are\nconsulted later in the file to _assign_ a value to SHELL_PATH on a\nnumber of platforms. So, making the \"uname_FOO\" assignments themselves\ndepend upon SHELL_PATH is rather circular and confusing.\n"},{"id":"403059","messageId":"CAFMepcn-yWtke7eE006a5RGO6uaScWb2xZe4H5M8X4F_T4Rhbw@mail.gmail.com","threadId":"53996","inReplyTo":"20200806020407.GR6540@camp.crustytoothpaste.net","subject":"Re: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Kyohei Kadota","fromEmail":"lufia@lufia.org","sentAt":"2020-08-06T13:49:43Z","receivedAt":"2020-08-06T17:23:00Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"> On 2020-08-06 at 01:05:03, lufia via GitGitGadget wrote:\n> > From: lufia <lufia@lufia.org>\n> >\n> > That haven't any commands: cut, expr and printf.\n>\n> Is this ANSI/POSIX environment the one mentioned at [0]?  That page\n> describes it as supporting POSIX 1003.1-1990, which is a bit dated.  I\n> think we generally assume one has the 2001 edition or later, so you'll\n> have your work cut out for you.\n\nYes, the layer I told is APE.\nI guess originally APE might be introduced for porting Ghostscript to Plan 9.\n\n> > And its sed(1)'s label is limited to maximum seven characters.\n> > Therefore I replaced some labels to drop a character.\n> >\n> > * close -> cl\n> > * continue -> cont (cnt is used for count)\n> > * line -> ln\n> > * hered -> hdoc\n> > * shell -> sh\n> > * string -> str\n> >\n> > Signed-off-by: lufia <lufia@lufia.org>\n>\n> I will note that usually the project prefers to have a human's personal\n> name here and in the commit metadata instead of a username.  Junio may\n> chime in here with an opinion.\n\nI see. I will rename them.\n\n> >  command_list () {\n> > -     eval \"grep -ve '^#' $exclude_programs\" <\"$1\"\n> > +     eval \"grep -v -e '^#' $exclude_programs\" <\"$1\"\n>\n> Is it really the case that Plan 9's grep cannot deal with bundled short\n> options?  That seems to be a significant departure from POSIX and Unix\n> behavior.  Regardless, this should be explained in the commit message.\n\nThis is awful.\nBut now, APE's grep (/bin/ape/grep) is a simple wrapper for native\ngrep (/bin/grep),\nits option parser is a very rough implementation.\nhttps://github.com/0intro/plan9-contrib/blob/master/rc/bin/ape/grep\n\n> >  get_categories () {\n> > -     tr ' ' '\\n'|\n> > +     tr ' ' '\\012'|\n>\n> Okay, I guess.  Is this something we need to handle elsewhere as well?\n> The commit message should tell us why this is necessary, and what Plan 9\n> does and doesn't support.\n\nYeah. I will edit the message.\nPlan 9's tr(1) handles only \\(16 bit octal) and \\x(16 bit hexadecimal)\nescape sequences.\nIf another character after leading backslash, tr(1) will replace \\c to c.\n\n> >       grep -v '^$' |\n> >       sort |\n> >       uniq\n> > @@ -18,13 +18,13 @@ get_categories () {\n> >\n> >  category_list () {\n> >       command_list \"$1\" |\n> > -     cut -c 40- |\n> > +     awk '{ print substr($0, 40) }' |\n>\n> I can tell that you haven't gotten the test suite working because I've\n> added a large number of cut invocations there.  I suspect you're going\n> to need to provide a portability wrapper there that implements it using\n> awk, sed, or perl.\n\nI see. If I'd like to put those wrappers to the repository, is there\nthe best place for them?\n\n> > +if test -z \"$(echo -n)\"\n> > +then\n> > +     alias print='echo -n'\n> > +else\n> > +     alias print='printf %s'\n> > +fi\n>\n> Let's avoid an alias here (especially with a common builtin name) and\n> instead use a shell function.  Maybe like this (not tab-indented):\n>\n>   print_nonl () {\n>     if command -v printf >/dev/null 2>&1\n>     then\n>       printf \"%s\" \"$@\"\n>     else\n>       echo -n \"$@\"\n>     fi\n>   }\n>\n> Notice also that we prefer the standard form and fall back to the\n> nonstandard form if the system is less capable.  I don't know if Plan 9\n> supports \"command -v\"; \"type\" may be preferable, but isn't supported by\n> some other shells (e.g., posh).  For portability reasons, we may need to\n> try to run printf and see if it fails.\n>\n> This is also going to need some patching in the testsuite, since we use\n> printf extensively (more than 1300 times).  I do hope you have perl\n> available.\n\nIn fact, Plan 9's ape/sh is pdksh, so it supports \"command -v\".\nHowever I think, like the above comment, it might be better to create\nthe printf(1) wrapper.\n\n---\nkadota\n\n> [0] http://doc.cat-v.org/plan_9/4th_edition/papers/ape\n> --\n> brian m. carlson: Houston, Texas, US\n"},{"id":"403063","messageId":"CAFMepckNybt8drZ=5c3x3MvUyruB75nn0cNY34FRpu=supsFiA@mail.gmail.com","threadId":"53996","inReplyTo":"CAPig+cRe2OUeHXE3XELtkS7b2GrZVxLm0pzduojDB97uLnBZKQ@mail.gmail.com","subject":"Re: [PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile.","fromName":"Kyohei Kadota","fromEmail":"lufia@lufia.org","sentAt":"2020-08-06T14:39:02Z","receivedAt":"2020-08-06T17:29:13Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"> On Wed, Aug 5, 2020 at 10:14 PM brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> > On 2020-08-06 at 01:05:01, lufia via GitGitGadget wrote:\n> > > In the not POSIX environment, like Plan 9, sh might not be looked up\n> > > in the directories named by the $PATH.\n> >\n> > I think Git's editor handling assumes that sh is somewhere in the PATH,\n> > so it might be fine for us to just ask the user to adjust PATH\n> > appropriately before running make.  I don't have a strong preference; if\n> > this works on a standard Unix machine, which it looks like it should\n> > (although I haven't tested), I'm fine with it.\n>\n> This does, however, have a bit of a chicken-and-egg feel to it. The\n> results of the \"uname_FOO\" assignments in config.mak.uname are\n> consulted later in the file to _assign_ a value to SHELL_PATH on a\n> number of platforms. So, making the \"uname_FOO\" assignments themselves\n> depend upon SHELL_PATH is rather circular and confusing.\n\nThe problem is, Plan 9 APE's sh is placed on /bin/ape/sh by default.\nBy running /bin/ape/psh\nAPE commands existed under /bin/ape such as sh, uname, etc, will be\nmounted on /bin.\nIn running of ape/psh, APE commands will prioritize than native commands.\nSo I've wanted to run /bin/ape/psh before executing some shell\ncommands by gmake.\n\n----\nkadota\n"},{"id":"403067","messageId":"xmqqeeojlm1s.fsf@gitster.c.googlers.com","threadId":"53996","inReplyTo":"CAPig+cRe2OUeHXE3XELtkS7b2GrZVxLm0pzduojDB97uLnBZKQ@mail.gmail.com","subject":"Re: [PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-06T17:30:07Z","receivedAt":"2020-08-06T17:44:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Wed, Aug 5, 2020 at 10:14 PM brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n>> On 2020-08-06 at 01:05:01, lufia via GitGitGadget wrote:\n>> > In the not POSIX environment, like Plan 9, sh might not be looked up\n>> > in the directories named by the $PATH.\n>>\n>> I think Git's editor handling assumes that sh is somewhere in the PATH,\n>> so it might be fine for us to just ask the user to adjust PATH\n>> appropriately before running make.  I don't have a strong preference; if\n>> this works on a standard Unix machine, which it looks like it should\n>> (although I haven't tested), I'm fine with it.\n>\n> This does, however, have a bit of a chicken-and-egg feel to it. The\n> results of the \"uname_FOO\" assignments in config.mak.uname are\n> consulted later in the file to _assign_ a value to SHELL_PATH on a\n> number of platforms. So, making the \"uname_FOO\" assignments themselves\n> depend upon SHELL_PATH is rather circular and confusing.\n\nIs that just being circular and confusing, or does it produce an\nincorrect result depending on the circumstances?  We would end up\nspecial casing SHELL_PATH (e.g. exclude it from the variables that\nare set based on uname), which I would want to avoid, as I would\nsuspect that there will be even more variables that need similar\ntreatment. \n\nThis does have a bad smell.  Even on a not-so-posix Windows, we do\nnot use such a hack.\n\n"},{"id":"403068","messageId":"xmqqa6z7ll44.fsf@gitster.c.googlers.com","threadId":"53996","inReplyTo":"22f8f3e37a18263d890307701903dc18c98aa54b.1596675905.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/4] Define TAR_CF and TAR_XF variables in Makefile","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-06T17:50:19Z","receivedAt":"2020-08-06T17:51:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"lufia via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: lufia <lufia@lufia.org>\n\nSee Documentation/SubmittingPatches[[real-name]].\n\n> Plan 9's tar(1) don't support o option.\n> So I changed Makefiles to replace tar commands if needed.\n\nThere is a big gap/leap between these two sentences.  The first\nsentence might justify TAR_XF but it does not explain why TAR_CF\nis needed at all.  Also there is \"$(TAR) czf\" that is left without\ngetting turned into $(TAR_CF)z.\n\nAre there still remaining uses of $(TAR) after applying this patch?\nIf with a different justification, a patch that abstracts our use of\n\"tar\" as an archiving tool into different use cases and give one\nMakefile macro to each of them with more meaningful names might be\nmore palatable.  E.g. instead of TAR_CF that abstracts only the \"tar\ncf\" part, make \"take everything in the current directory and send an\narchive of it to the standard output\", i.e. \"tar cf - .\", into a\nMakefile macro, with matching \"take an archive from the standard\ninput and extract it to the current directory\", i.e. \"tar xf -\", as\na matching Makefile macro, perhaps---that way people without a\nworking \"tar\" might be able to use zip, cpio or pax (or a script\nwritten around them) as an alternative \"archiving tool\", for\nexample.\n\n\tSide note.  The above would probably be a huge undertaking\n\tand I am not suggesting it as a serious counterproposal.\n\nA more plausible alternative is to just touch \"$(TAR) xof -\" and\nreplace it with $(TAR_XOF) or even $(EXTRACT_TARBALL_AS_MYSELF)\nwhile leaving $(TAR_CF) alone.  That _might_ be palatable.\n\nI dunno.\n"},{"id":"403087","messageId":"xmqq5z9vlk5q.fsf@gitster.c.googlers.com","threadId":"53996","inReplyTo":"20200806020407.GR6540@camp.crustytoothpaste.net","subject":"Re: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-06T18:10:57Z","receivedAt":"2020-08-06T18:48:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> I will note that usually the project prefers to have a human's personal\n> name here and in the commit metadata instead of a username.  Junio may\n> chime in here with an opinion.\n\nThanks, I just did.\n\n>>  command_list () {\n>> -\teval \"grep -ve '^#' $exclude_programs\" <\"$1\"\n>> +\teval \"grep -v -e '^#' $exclude_programs\" <\"$1\"\n>\n> Is it really the case that Plan 9's grep cannot deal with bundled short\n> options?  That seems to be a significant departure from POSIX and Unix\n> behavior.  Regardless, this should be explained in the commit message.\n\nI am not interested in this ball of wax, but there are some pieces\nthat are worth salvaging.  This is one of those good bits.\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 9db2f4feab..a7cc01caf9 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -26,7 +26,7 @@ else\n \tVN=\"$DEF_VER\"\n fi\n \n-VN=$(expr \"$VN\" : v*'\\(.*\\)')\n+VN=${VN#v}\n \n if test -r $GVF\n then\n\nBUT.\n\nDealing with \"grep\" that cannot take \"-ve\" and forces developers to\nspell it as \"-v -e\" is not one of them.  So is forbidding use of\n\"cut\".\n\n>>  get_categories () {\n>> -\ttr ' ' '\\n'|\n>> +\ttr ' ' '\\012'|\n>\n> Okay, I guess.  Is this something we need to handle elsewhere as well?\n> The commit message should tell us why this is necessary, and what Plan 9\n> does and doesn't support.\n\nYeah, POSIX does want you to understand '\\n' and others, but this is\nwithin reason for portability that I think we could swallow.\n\n>> +if test -z \"$(echo -n)\"\n>> +then\n>> +\talias print='echo -n'\n>> +else\n>> +\talias print='printf %s'\n>> +fi\n>\n> Let's avoid an alias here (especially with a common builtin name) and\n> instead use a shell function.  Maybe like this (not tab-indented):\n>\n>   print_nonl () {\n>     if command -v printf >/dev/null 2>&1\n>     then\n>       printf \"%s\" \"$@\"\n>     else\n>       echo -n \"$@\"\n>     fi\n>   }\n\nI'd rather not to see this done; \"echo -n\" and \"echo '...\\c'\" are\nnot portable and we do want people to use 'printf'.  This directly\ngoes against it.\n\n> This is also going to need some patching in the testsuite, since we use\n> printf extensively (more than 1300 times).  I do hope you have perl\n> available.\n\nEh, so what would Plan9 people do with Perl?  Write a single-liner\n'printf' script and put it in a directory on their $PATH?\n\nI am not sure if it is worth crippling the toolset our developers\nare allowed to choose from and use in our scripts and tests like\nthis patch tries to do.\n\nIf this were Windows, it might have been a different story, but what\nwe are talking about is Plan 9, which had the last \"fourth edition\"\nin 2002, right?  During the 18 years since then, none of its users\nand developers work on porting many OSS packages, whose primary user\nbase are on POSIXy systems, to it and we need to apply patches like\nthese to each and every OSS packages of interest?  I would have\nexpected that any exotic-minority-but-thriving-platform would be\nable to tell its users \"here are ports of POSIXy programs---install\nthem and it can become usable by those who only know Linux\"?\n\nSo, I dunno.\n"},{"id":"403105","messageId":"20200806235139.GB8085@camp.crustytoothpaste.net","threadId":"53996","inReplyTo":"CAFMepcn-yWtke7eE006a5RGO6uaScWb2xZe4H5M8X4F_T4Rhbw@mail.gmail.com","subject":"Re: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-08-06T23:51:39Z","receivedAt":"2020-08-06T23:52:18Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-08-06 at 13:49:43, Kyohei Kadota wrote:\n> I see. If I'd like to put those wrappers to the repository, is there\n> the best place for them?\n\nIf you can stuff them in a shell function, then I'd just put those in a\nfile like t/test-lib-wrappers.sh and conditionally source them from\nt/test-lib.sh.  Otherwise, I'd create a subdirectory of t and then add\nthat to the PATH if necessary.\n\nIf you're going to use it outside of the testsuite, then maybe\ncompat/scripts might be a good idea.\n\n> In fact, Plan 9's ape/sh is pdksh, so it supports \"command -v\".\n> However I think, like the above comment, it might be better to create\n> the printf(1) wrapper.\n\nAwesome.  I haven't used pdksh in a long time, but if it supports that,\nall the better.  I'm surprised it doesn't have printf as a builtin, though.\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"403106","messageId":"CAPig+cSAnwbRYAVB5B8XdBKso=kQt=8CBB-U_Z-Wc+Sp2s54Hw@mail.gmail.com","threadId":"53996","inReplyTo":"20200806235139.GB8085@camp.crustytoothpaste.net","subject":"Re: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-08-06T23:57:04Z","receivedAt":"2020-08-06T23:57:19Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Aug 6, 2020 at 7:52 PM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> On 2020-08-06 at 13:49:43, Kyohei Kadota wrote:\n> > I see. If I'd like to put those wrappers to the repository, is there\n> > the best place for them?\n>\n> If you can stuff them in a shell function, then I'd just put those in a\n> file like t/test-lib-wrappers.sh and conditionally source them from\n> t/test-lib.sh.\n\nThere are already platform-specific shell functions in test-lib.sh[1]\nand some larger compatibility functions in test-lib-functions.sh[2],\nso those might be better locations for Plan9 compatibility wrappers\nthan creating a new file (or not?).\n\n[1]: see the section commented:\n    \"Fix some commands on Windows, and other OS-specific things\"\n[2]: see, for instance, the mingw_test_cmp() function\n"},{"id":"403251","messageId":"CAFMepc=ZGyp=bZRdSkEsrtPCq70+U1amv3OoBk0QMbiwb4W8dA@mail.gmail.com","threadId":"53996","inReplyTo":"xmqqeeojlm1s.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile.","fromName":"Kyohei Kadota","fromEmail":"lufia@lufia.org","sentAt":"2020-08-10T09:04:31Z","receivedAt":"2020-08-10T09:04:44Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"After a moment's thought I decided to run ape/psh before building git.\nIf so then, sh will be found from the directories named in PATH\nbecause it is mounted onto /bin.\n\n2020年8月7日(金) 2:30 Junio C Hamano <gitster@pobox.com>:\n>\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n>\n> > On Wed, Aug 5, 2020 at 10:14 PM brian m. carlson\n> > <sandals@crustytoothpaste.net> wrote:\n> >> On 2020-08-06 at 01:05:01, lufia via GitGitGadget wrote:\n> >> > In the not POSIX environment, like Plan 9, sh might not be looked up\n> >> > in the directories named by the $PATH.\n> >>\n> >> I think Git's editor handling assumes that sh is somewhere in the PATH,\n> >> so it might be fine for us to just ask the user to adjust PATH\n> >> appropriately before running make.  I don't have a strong preference; if\n> >> this works on a standard Unix machine, which it looks like it should\n> >> (although I haven't tested), I'm fine with it.\n> >\n> > This does, however, have a bit of a chicken-and-egg feel to it. The\n> > results of the \"uname_FOO\" assignments in config.mak.uname are\n> > consulted later in the file to _assign_ a value to SHELL_PATH on a\n> > number of platforms. So, making the \"uname_FOO\" assignments themselves\n> > depend upon SHELL_PATH is rather circular and confusing.\n>\n> Is that just being circular and confusing, or does it produce an\n> incorrect result depending on the circumstances?  We would end up\n> special casing SHELL_PATH (e.g. exclude it from the variables that\n> are set based on uname), which I would want to avoid, as I would\n> suspect that there will be even more variables that need similar\n> treatment.\n>\n> This does have a bad smell.  Even on a not-so-posix Windows, we do\n> not use such a hack.\n>\n"},{"id":"403255","messageId":"CAFMepckAe9r1O8xrQemytHoZKeyLSjEpfdH=yP=+SzKPoCOf8w@mail.gmail.com","threadId":"53996","inReplyTo":"xmqq5z9vlk5q.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Kyohei Kadota","fromEmail":"lufia@lufia.org","sentAt":"2020-08-10T10:53:46Z","receivedAt":"2020-08-10T10:54:02Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":">\n> \"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n>\n> > I will note that usually the project prefers to have a human's personal\n> > name here and in the commit metadata instead of a username.  Junio may\n> > chime in here with an opinion.\n>\n> Thanks, I just did.\n>\n> >>  command_list () {\n> >> -    eval \"grep -ve '^#' $exclude_programs\" <\"$1\"\n> >> +    eval \"grep -v -e '^#' $exclude_programs\" <\"$1\"\n> >\n> > Is it really the case that Plan 9's grep cannot deal with bundled short\n> > options?  That seems to be a significant departure from POSIX and Unix\n> > behavior.  Regardless, this should be explained in the commit message.\n>\n> I am not interested in this ball of wax, but there are some pieces\n> that are worth salvaging.  This is one of those good bits.\n>\n> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n> index 9db2f4feab..a7cc01caf9 100755\n> --- a/GIT-VERSION-GEN\n> +++ b/GIT-VERSION-GEN\n> @@ -26,7 +26,7 @@ else\n>         VN=\"$DEF_VER\"\n>  fi\n>\n> -VN=$(expr \"$VN\" : v*'\\(.*\\)')\n> +VN=${VN#v}\n>\n>  if test -r $GVF\n>  then\n>\n> BUT.\n>\n> Dealing with \"grep\" that cannot take \"-ve\" and forces developers to\n> spell it as \"-v -e\" is not one of them.  So is forbidding use of\n> \"cut\".\n\nI see. I will rewrite Plan 9's ape/grep to handle bundled options well.\n\n> >>  get_categories () {\n> >> -    tr ' ' '\\n'|\n> >> +    tr ' ' '\\012'|\n> >\n> > Okay, I guess.  Is this something we need to handle elsewhere as well?\n> > The commit message should tell us why this is necessary, and what Plan 9\n> > does and doesn't support.\n>\n> Yeah, POSIX does want you to understand '\\n' and others, but this is\n> within reason for portability that I think we could swallow.\n\nI'm happy, thanks.\n\n> >> +if test -z \"$(echo -n)\"\n> >> +then\n> >> +    alias print='echo -n'\n> >> +else\n> >> +    alias print='printf %s'\n> >> +fi\n> >\n> > Let's avoid an alias here (especially with a common builtin name) and\n> > instead use a shell function.  Maybe like this (not tab-indented):\n> >\n> >   print_nonl () {\n> >     if command -v printf >/dev/null 2>&1\n> >     then\n> >       printf \"%s\" \"$@\"\n> >     else\n> >       echo -n \"$@\"\n> >     fi\n> >   }\n>\n> I'd rather not to see this done; \"echo -n\" and \"echo '...\\c'\" are\n> not portable and we do want people to use 'printf'.  This directly\n> goes against it.\n>\n> > This is also going to need some patching in the testsuite, since we use\n> > printf extensively (more than 1300 times).  I do hope you have perl\n> > available.\n>\n> Eh, so what would Plan9 people do with Perl?  Write a single-liner\n> 'printf' script and put it in a directory on their $PATH?\n>\n> I am not sure if it is worth crippling the toolset our developers\n> are allowed to choose from and use in our scripts and tests like\n> this patch tries to do.\n\nLike other topics, I decide to implement printf(1).\nThese new POSIX tools will be installed to Plan 9 systems\nfrom other repo or patches before building git.\n\n> If this were Windows, it might have been a different story, but what\n> we are talking about is Plan 9, which had the last \"fourth edition\"\n> in 2002, right?  During the 18 years since then, none of its users\n> and developers work on porting many OSS packages, whose primary user\n> base are on POSIXy systems, to it and we need to apply patches like\n> these to each and every OSS packages of interest?  I would have\n> expected that any exotic-minority-but-thriving-platform would be\n> able to tell its users \"here are ports of POSIXy programs---install\n> them and it can become usable by those who only know Linux\"?\n>\n> So, I dunno.\n\nFinal official distribution from Bell labs was released in Jan 2015.\nNow, There are some distributions that forked from official Plan 9 and\nare maintained by that community,\nsuch as 9legacy, 9front or others.\n\nI will try to implement POSIX toolsets if it is needed because POSIX\nis a large spec.\nThanks for your advice.\n"},{"id":"405276","messageId":"pull.694.v2.git.1599680861.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.git.1596675905.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] Fit the building tools to Plan 9 environment","fromName":"KADOTA, Kyohei via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-09T19:47:39Z","receivedAt":"2020-09-09T19:47:53Z","isPatch":true,"sender":{"key":"name:KADOTA, Kyohei","avatar":null},"body":"I've posted some commits for porting git to Plan 9.\n\nThis pull request is thing that cut off building scripts from #305 and is\nre-constructed that.\n\nI expect this don't change any artifacts.\n\ndiffer from v1\n==============\n\n * drop some adapters, printf, cut, expr or tar\n * drop using SHELL_PATH instead of sh\n * use real name at Signed-off-by signature\n\nKyohei Kadota (2):\n  Fit to Plan 9's ANSI/POSIX compatibility layer\n  Use $(LD) instead of $(CC) for linking the object files\n\n .github/workflows/main.yml |  1 +\n Makefile                   | 15 +++++----\n ci/lib.sh                  |  8 ++++-\n config.mak.in              |  1 +\n config.mak.uname           |  6 ++++\n generate-cmdlist.sh        |  4 +--\n t/chainlint.sed            | 66 +++++++++++++++++++-------------------\n 7 files changed, 58 insertions(+), 43 deletions(-)\n\n\nbase-commit: 3a238e539bcdfe3f9eb5010fd218640c1b499f7a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-694%2Flufia%2Fcompat-p9-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-694/lufia/compat-p9-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/694\n\nRange-diff vs v1:\n\n 1:  1f63b4fc7c < -:  ---------- Use $(SHELL_PATH) instead of sh in Makefile.\n 2:  22f8f3e37a < -:  ---------- Define TAR_CF and TAR_XF variables in Makefile\n 3:  d15ed626de ! 1:  c850888c25 Fit to Plan 9's ANSI/POSIX compatibility layer\n     @@\n       ## Metadata ##\n     -Author: lufia <lufia@lufia.org>\n     +Author: Kyohei Kadota <lufia@lufia.org>\n      \n       ## Commit message ##\n          Fit to Plan 9's ANSI/POSIX compatibility layer\n      \n     -    That haven't any commands: cut, expr and printf.\n     +    tr(1) of ANSI/POSIX environment, aka APE, don't support \\n literal.\n     +    It's handles only octal(\\ooo) or hexadecimal(\\xhhhh) numbers.\n      \n          And its sed(1)'s label is limited to maximum seven characters.\n          Therefore I replaced some labels to drop a character.\n     @@ Commit message\n          * shell -> sh\n          * string -> str\n      \n     -    Signed-off-by: lufia <lufia@lufia.org>\n     -\n     - ## GIT-VERSION-GEN ##\n     -@@ GIT-VERSION-GEN: else\n     - \tVN=\"$DEF_VER\"\n     - fi\n     - \n     --VN=$(expr \"$VN\" : v*'\\(.*\\)')\n     -+VN=${VN#v}\n     - \n     - if test -r $GVF\n     - then\n     +    Signed-off-by: Kyohei Kadota <lufia@lufia.org>\n      \n       ## generate-cmdlist.sh ##\n     -@@ generate-cmdlist.sh: die () {\n     - }\n     - \n     - command_list () {\n     --\teval \"grep -ve '^#' $exclude_programs\" <\"$1\"\n     -+\teval \"grep -v -e '^#' $exclude_programs\" <\"$1\"\n     +@@ generate-cmdlist.sh: command_list () {\n       }\n       \n       get_categories () {\n     @@ generate-cmdlist.sh: die () {\n       \tgrep -v '^$' |\n       \tsort |\n       \tuniq\n     -@@ generate-cmdlist.sh: get_categories () {\n     - \n     - category_list () {\n     - \tcommand_list \"$1\" |\n     --\tcut -c 40- |\n     -+\tawk '{ print substr($0, 40) }' |\n     - \tget_categories\n     - }\n     +@@ generate-cmdlist.sh: category_list () {\n       \n       get_synopsis () {\n       \tsed -n '\n     @@ generate-cmdlist.sh: get_categories () {\n       \t\t${\n       \t\t\tx\n       \t\t\ts/.*'\"$1\"' - \\(.*\\)/N_(\"\\1\")/\n     -@@ generate-cmdlist.sh: define_category_names () {\n     - \techo \"};\"\n     - }\n     - \n     -+if test -z \"$(echo -n)\"\n     -+then\n     -+\talias print='echo -n'\n     -+else\n     -+\talias print='printf %s'\n     -+fi\n     -+\n     - print_command_list () {\n     - \techo \"static struct cmdname_help command_list[] = {\"\n     - \n     - \tcommand_list \"$1\" |\n     - \twhile read cmd rest\n     - \tdo\n     --\t\tprintf \"\t{ \\\"$cmd\\\", $(get_synopsis $cmd), 0\"\n     -+\t\tprint \"\t{ \\\"$cmd\\\", $(get_synopsis $cmd), 0\"\n     - \t\tfor cat in $(echo \"$rest\" | get_categories)\n     - \t\tdo\n     --\t\t\tprintf \" | CAT_$cat\"\n     -+\t\t\tprint \" | CAT_$cat\"\n     - \t\tdone\n     - \t\techo \" },\"\n     - \tdone\n      \n       ## t/chainlint.sed ##\n      @@\n 4:  4ebd56a3c5 ! 2:  6f35562965 Use $(LD) instead of $(CC) for linking the object files\n     @@\n       ## Metadata ##\n     -Author: lufia <lufia@lufia.org>\n     +Author: Kyohei Kadota <lufia@lufia.org>\n      \n       ## Commit message ##\n          Use $(LD) instead of $(CC) for linking the object files\n     @@ Commit message\n          The compilers are called 8c, 6c... for each machine architectures;\n          corresponded loaders are called 8l, 6l...\n      \n     -    Signed-off-by: lufia <lufia@lufia.org>\n     +    Signed-off-by: Kyohei Kadota <lufia@lufia.org>\n      \n       ## .github/workflows/main.yml ##\n      @@ .github/workflows/main.yml: jobs:\n     @@ Makefile: compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n      -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n      +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n       \n     - git-bugreport$X: bugreport.o GIT-LDFLAGS $(GITLIBS)\n     --\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n     -+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n     - \t\t$(LIBS)\n     - \n       git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n      -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n      +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n     @@ Makefile: compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n      +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n       \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n       \n     - git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)\n     --\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \\\n     -+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \\\n     - \t$(VCSSVN_LIB)\n     - \n       $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n      @@ Makefile: $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n       \tcp $< $@\n     @@ Makefile: $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n       \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n       \n       $(LIB_FILE): $(LIB_OBJS)\n     -@@ Makefile: t/helper/test-svn-fe$X: $(VCSSVN_LIB)\n     +@@ Makefile: perf: all\n       t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n       \n       t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n\n-- \ngitgitgadget\n"},{"id":"405277","messageId":"c850888c25d4d1e1c6b0ca40ab4638462c1649fa.1599680861.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.v2.git.1599680861.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Kyohei Kadota via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-09T19:47:40Z","receivedAt":"2020-09-09T19:47:56Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"From: Kyohei Kadota <lufia@lufia.org>\n\ntr(1) of ANSI/POSIX environment, aka APE, don't support \\n literal.\nIt's handles only octal(\\ooo) or hexadecimal(\\xhhhh) numbers.\n\nAnd its sed(1)'s label is limited to maximum seven characters.\nTherefore I replaced some labels to drop a character.\n\n* close -> cl\n* continue -> cont (cnt is used for count)\n* line -> ln\n* hered -> hdoc\n* shell -> sh\n* string -> str\n\nSigned-off-by: Kyohei Kadota <lufia@lufia.org>\n---\n generate-cmdlist.sh |  4 +--\n t/chainlint.sed     | 66 ++++++++++++++++++++++-----------------------\n 2 files changed, 35 insertions(+), 35 deletions(-)\n\ndiff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\nindex 45fecf8bdf..4031623b0e 100755\n--- a/generate-cmdlist.sh\n+++ b/generate-cmdlist.sh\n@@ -10,7 +10,7 @@ command_list () {\n }\n \n get_categories () {\n-\ttr ' ' '\\n'|\n+\ttr ' ' '\\012'|\n \tgrep -v '^$' |\n \tsort |\n \tuniq\n@@ -24,7 +24,7 @@ category_list () {\n \n get_synopsis () {\n \tsed -n '\n-\t\t/^NAME/,/'\"$1\"'/H\n+\t\t/^NAME/,/'\"$1\"'/h\n \t\t${\n \t\t\tx\n \t\t\ts/.*'\"$1\"' - \\(.*\\)/N_(\"\\1\")/\ndiff --git a/t/chainlint.sed b/t/chainlint.sed\nindex 70df40e34b..8a25c5b855 100644\n--- a/t/chainlint.sed\n+++ b/t/chainlint.sed\n@@ -117,7 +117,7 @@\n /^[ \t]*!*[ \t]*(..*)[ \t]*[0-9]*[<>|&]/boneline\n \n # multi-line \"(...\\n...)\"\n-/^[ \t]*(/bsubshell\n+/^[ \t]*(/bsubsh\n \n # innocuous line -- print it and advance to next line\n b\n@@ -130,11 +130,11 @@ b\n }\n b\n \n-:subshell\n+:subsh\n # bare \"(\" line? -- stash for later printing\n /^[ \t]*([\t]*$/ {\n \th\n-\tbnextline\n+\tbnextln\n }\n # \"(...\" line -- split off and stash \"(\", then process \"...\" as its own line\n x\n@@ -143,7 +143,7 @@ x\n s/(//\n bslurp\n \n-:nextline\n+:nextln\n N\n s/.*\\n//\n \n@@ -151,10 +151,10 @@ s/.*\\n//\n # incomplete line \"...\\\"\n /\\\\$/bicmplte\n # multi-line quoted string \"...\\n...\"?\n-/\"/bdqstring\n+/\"/bdqstr\n # multi-line quoted string '...\\n...'? (but not contraction in string \"it's\")\n /'/{\n-\t/\"[^'\"]*'[^'\"]*\"/!bsqstring\n+\t/\"[^'\"]*'[^'\"]*\"/!bsqstr\n }\n :folded\n # here-doc -- swallow it\n@@ -163,8 +163,8 @@ s/.*\\n//\n # before closing \")\", \"done\", \"elsif\", \"else\", or \"fi\" will need to be\n # re-visited to drop \"suspect\" marking since final line of those constructs\n # legitimately lacks \"&&\", so \"suspect\" mark must be removed\n-/^[ \t]*#/bnextline\n-/^[ \t]*$/bnextline\n+/^[ \t]*#/bnextln\n+/^[ \t]*$/bnextln\n # in-line comment -- strip it (but not \"#\" in a string, Bash ${#...} array\n # length, or Perforce \"//depot/path#42\" revision in filespec)\n /[ \t]#/{\n@@ -175,22 +175,22 @@ s/.*\\n//\n # multi-line \"case ... esac\"\n /^[ \t]*case[ \t]..*[ \t]in/bcase\n # multi-line \"for ... done\" or \"while ... done\"\n-/^[ \t]*for[ \t]..*[ \t]in/bcontinue\n-/^[ \t]*while[ \t]/bcontinue\n-/^[ \t]*do[ \t]/bcontinue\n-/^[ \t]*do[ \t]*$/bcontinue\n-/;[ \t]*do/bcontinue\n+/^[ \t]*for[ \t]..*[ \t]in/bcont\n+/^[ \t]*while[ \t]/bcont\n+/^[ \t]*do[ \t]/bcont\n+/^[ \t]*do[ \t]*$/bcont\n+/;[ \t]*do/bcont\n /^[ \t]*done[ \t]*&&[ \t]*$/bdone\n /^[ \t]*done[ \t]*$/bdone\n /^[ \t]*done[ \t]*[<>|]/bdone\n /^[ \t]*done[ \t]*)/bdone\n-/||[ \t]*exit[ \t]/bcontinue\n-/||[ \t]*exit[ \t]*$/bcontinue\n+/||[ \t]*exit[ \t]/bcont\n+/||[ \t]*exit[ \t]*$/bcont\n # multi-line \"if...elsif...else...fi\"\n-/^[ \t]*if[ \t]/bcontinue\n-/^[ \t]*then[ \t]/bcontinue\n-/^[ \t]*then[ \t]*$/bcontinue\n-/;[ \t]*then/bcontinue\n+/^[ \t]*if[ \t]/bcont\n+/^[ \t]*then[ \t]/bcont\n+/^[ \t]*then[ \t]*$/bcont\n+/;[ \t]*then/bcont\n /^[ \t]*elif[ \t]/belse\n /^[ \t]*elif[ \t]*$/belse\n /^[ \t]*else[ \t]/belse\n@@ -234,10 +234,10 @@ s/.*\\n//\n \t}\n }\n # line ends with pipe \"...|\" -- valid; not missing \"&&\"\n-/|[ \t]*$/bcontinue\n+/|[ \t]*$/bcont\n # missing end-of-line \"&&\" -- mark suspect\n /&&[ \t]*$/!s/^/?!AMP?!/\n-:continue\n+:cont\n # retrieve and print previous line\n x\n n\n@@ -250,7 +250,7 @@ s/\\\\\\n//\n bslurp\n \n # check for multi-line double-quoted string \"...\\n...\" -- fold to one line\n-:dqstring\n+:dqstr\n # remove all quote pairs\n s/\"\\([^\"]*\\)\"/@!\\1@!/g\n # done if no dangling quote\n@@ -258,13 +258,13 @@ s/\"\\([^\"]*\\)\"/@!\\1@!/g\n # otherwise, slurp next line and try again\n N\n s/\\n//\n-bdqstring\n+bdqstr\n :dqdone\n s/@!/\"/g\n bfolded\n \n # check for multi-line single-quoted string '...\\n...' -- fold to one line\n-:sqstring\n+:sqstr\n # remove all quote pairs\n s/'\\([^']*\\)'/@!\\1@!/g\n # done if no dangling quote\n@@ -272,7 +272,7 @@ s/'\\([^']*\\)'/@!\\1@!/g\n # otherwise, slurp next line and try again\n N\n s/\\n//\n-bsqstring\n+bsqstr\n :sqdone\n s/@!/'/g\n bfolded\n@@ -282,11 +282,11 @@ bfolded\n :heredoc\n s/^\\(.*\\)<<[ \t]*[-\\\\'\"]*\\([A-Za-z0-9_][A-Za-z0-9_]*\\)['\"]*/<\\2>\\1<</\n s/[ \t]*<<//\n-:heredsub\n+:hdocsub\n N\n /^<\\([^>]*\\)>.*\\n[ \t]*\\1[ \t]*$/!{\n \ts/\\n.*$//\n-\tbheredsub\n+\tbhdocsub\n }\n s/^<[^>]*>//\n s/\\n.*$//\n@@ -305,7 +305,7 @@ bcase\n x\n s/?!AMP?!//\n x\n-bcontinue\n+bcont\n \n # found \"done\" closing for-loop or while-loop, or \"fi\" closing if-then -- drop\n # \"suspect\" from final contained line since that line legitimately lacks \"&&\"\n@@ -321,10 +321,10 @@ bchkchn\n # found nested multi-line \"(...\\n...)\" -- pass through untouched\n :nest\n x\n-:nstslurp\n+:nstslrp\n n\n # closing \")\" on own line -- stop nested slurp\n-/^[ \t]*)/bnstclose\n+/^[ \t]*)/bnstcl\n # comment -- not closing \")\" if in comment\n /^[ \t]*#/bnstcnt\n # \"$((...))\" -- arithmetic expansion; not closing \")\"\n@@ -332,11 +332,11 @@ n\n # \"$(...)\" -- command substitution; not closing \")\"\n /\\$([^)][^)]*)[^)]*$/bnstcnt\n # closing \"...)\" -- stop nested slurp\n-/)/bnstclose\n+/)/bnstcl\n :nstcnt\n x\n-bnstslurp\n-:nstclose\n+bnstslrp\n+:nstcl\n s/^/>>/\n # is it \"))\" which closes nested and parent subshells?\n /)[ \t]*)/bslurp\n-- \ngitgitgadget\n\n"},{"id":"405278","messageId":"6f35562965c2fd7fd7abe4e1c7952d9acd144508.1599680861.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.v2.git.1599680861.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] Use $(LD) instead of $(CC) for linking the object files","fromName":"Kyohei Kadota via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-09T19:47:41Z","receivedAt":"2020-09-09T19:47:56Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"From: Kyohei Kadota <lufia@lufia.org>\n\nPlan 9's loader(aka. linker) is separated from the compiler.\nThe compilers are called 8c, 6c... for each machine architectures;\ncorresponded loaders are called 8l, 6l...\n\nSigned-off-by: Kyohei Kadota <lufia@lufia.org>\n---\n .github/workflows/main.yml |  1 +\n Makefile                   | 15 ++++++++-------\n ci/lib.sh                  |  8 +++++++-\n config.mak.in              |  1 +\n config.mak.uname           |  6 ++++++\n 5 files changed, 23 insertions(+), 8 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 30425404eb..5ece32d4fa 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -252,6 +252,7 @@ jobs:\n             pool: ubuntu-latest\n     env:\n       CC: ${{matrix.vector.cc}}\n+      LD: ${{matrix.vector.cc}}\n       jobname: ${{matrix.vector.jobname}}\n     runs-on: ${{matrix.vector.pool}}\n     steps:\ndiff --git a/Makefile b/Makefile\nindex 86e5411f39..c0c0c280f0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -543,6 +543,7 @@ export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir\n \n # Set our default programs\n CC = cc\n+LD = cc\n AR = ar\n RM = rm -f\n DIFF = diff\n@@ -2121,7 +2122,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \\\n \t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'\n \n git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) \\\n \t\t$(filter %.o,$^) $(LIBS)\n \n help.sp help.s help.o: command-list.h\n@@ -2445,17 +2446,17 @@ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n endif\n \n git-%$X: %.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n \n git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(IMAP_SEND_LDFLAGS) $(LIBS)\n \n git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(LIBS)\n git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n@@ -2465,7 +2466,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n \tcp $< $@\n \n $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n $(LIB_FILE): $(LIB_OBJS)\n@@ -2753,7 +2754,7 @@ perf: all\n t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n \n t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n \n check-sha1:: t/helper/test-tool$X\n \tt/helper/test-sha1.sh\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 3eefec500d..19c5beb277 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -125,6 +125,7 @@ then\n \ttest darwin != \"$CI_OS_NAME\" || CI_OS_NAME=osx\n \tCI_REPO_SLUG=\"$(expr \"$BUILD_REPOSITORY_URI\" : '.*/\\([^/]*/[^/]*\\)$')\"\n \tCC=\"${CC:-gcc}\"\n+\tLD=\"$CC\"\n \n \t# use a subdirectory of the cache dir (because the file share is shared\n \t# among *all* phases)\n@@ -149,6 +150,7 @@ then\n \tCI_REPO_SLUG=\"$GITHUB_REPOSITORY\"\n \tCI_JOB_ID=\"$GITHUB_RUN_ID\"\n \tCC=\"${CC:-gcc}\"\n+\tLD=\"$CC\"\n \n \tcache_dir=\"$HOME/none\"\n \n@@ -184,6 +186,7 @@ linux-clang|linux-gcc)\n \tif [ \"$jobname\" = linux-gcc ]\n \tthen\n \t\texport CC=gcc-8\n+\t\texport LD=\"$CC\"\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n@@ -207,6 +210,7 @@ osx-clang|osx-gcc)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n \t\texport CC=gcc-9\n+\t\texport LD=\"$CC\"\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python2)\"\n@@ -222,12 +226,14 @@ GETTEXT_POISON)\n \t;;\n Linux32)\n \tCC=gcc\n+\tLD=\"$CC\"\n \t;;\n linux-musl)\n \tCC=gcc\n+\tLD=\"$CC\"\n \tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes\"\n \tMAKEFLAGS=\"$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes\"\n \t;;\n esac\n \n-MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc}\"\n+MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc} LD=${LD:-cc}\"\ndiff --git a/config.mak.in b/config.mak.in\nindex e6a6d0f941..76ea7e781e 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -2,6 +2,7 @@\n # @configure_input@\n \n CC = @CC@\n+LD = @CC@\n CFLAGS = @CFLAGS@\n CPPFLAGS = @CPPFLAGS@\n LDFLAGS = @LDFLAGS@\ndiff --git a/config.mak.uname b/config.mak.uname\nindex c7eba69e54..886ce068f8 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -69,6 +69,7 @@ ifeq ($(uname_S),GNU/kFreeBSD)\n endif\n ifeq ($(uname_S),UnixWare)\n \tCC = cc\n+\tLD = $(CC)\n \tNEEDS_SOCKET = YesPlease\n \tNEEDS_NSL = YesPlease\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n@@ -90,6 +91,7 @@ ifeq ($(uname_S),SCO_SV)\n \tendif\n \tifeq ($(uname_R),5)\n \t\tCC = cc\n+\t\tLD = $(CC)\n \t\tBASIC_CFLAGS += -Kthread\n \tendif\n \tNEEDS_SOCKET = YesPlease\n@@ -435,6 +437,7 @@ ifeq ($(uname_S),Windows)\n \tDEFAULT_HELP_FORMAT = html\n \n \tCC = compat/vcbuild/scripts/clink.pl\n+\tLD = $(CC)\n \tAR = compat/vcbuild/scripts/lib.pl\n \tCFLAGS =\n \tBASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE\n@@ -525,6 +528,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n \tifeq ($(uname_R).$(uname_V),L17.02)\n \t\tCC += -WRVU=L16.05\n \tendif\n+\tLD = $(CC)\n \t# Disable all optimization, seems to result in bad code, with -O or -O2\n \t# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects\n \t# abends on \"git push\". Needs more investigation.\n@@ -665,8 +669,10 @@ else\n \t\t\tBASIC_LDFLAGS += -Wl,--large-address-aware\n \t\tendif\n \t\tCC = gcc\n+\t\tLD = $(CC)\n \t\tCOMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \\\n \t\t\t-fstack-protector-strong\n+\t\tBASIC_LDFLAGS += -fstack-protector-strong\n \t\tEXTLIBS += -lntdll\n \t\tINSTALL = /bin/install\n \t\tNO_R_TO_GCC_LINKER = YesPlease\n-- \ngitgitgadget\n"},{"id":"405280","messageId":"CAPig+cQ_KCAGpmfBAymBefB2JSVpw0-bk5HOnm41=SpADEyDnA@mail.gmail.com","threadId":"53996","inReplyTo":"c850888c25d4d1e1c6b0ca40ab4638462c1649fa.1599680861.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 1/2] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-09-09T19:56:42Z","receivedAt":"2020-09-09T19:57:11Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Sep 9, 2020 at 3:48 PM Kyohei Kadota via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> And its sed(1)'s label is limited to maximum seven characters.\n> Therefore I replaced some labels to drop a character.\n>\n> * close -> cl\n> * continue -> cont (cnt is used for count)\n> * line -> ln\n> * hered -> hdoc\n> * shell -> sh\n> * string -> str\n\nThese are reasonable. \"cl\" feels a little odd, but I can't think of\nanything better.\n\n> diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\n> @@ -24,7 +24,7 @@ category_list () {\n>  get_synopsis () {\n>         sed -n '\n> -               /^NAME/,/'\"$1\"'/H\n> +               /^NAME/,/'\"$1\"'/h\n\nThis change is not mentioned in the commit message. \"H\" and \"h\" are\nvery different commands, so it's difficult, at a glance, to tell if\nthis change is even valid. Some explanation in the commit message\nwould help (if it is indeed valid).\n"},{"id":"405286","messageId":"xmqqsgbqu1to.fsf@gitster.c.googlers.com","threadId":"53996","inReplyTo":"CAPig+cQ_KCAGpmfBAymBefB2JSVpw0-bk5HOnm41=SpADEyDnA@mail.gmail.com","subject":"Re: [PATCH v2 1/2] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-09T20:34:11Z","receivedAt":"2020-09-09T20:34:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Wed, Sep 9, 2020 at 3:48 PM Kyohei Kadota via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n>> And its sed(1)'s label is limited to maximum seven characters.\n>> Therefore I replaced some labels to drop a character.\n>>\n>> * close -> cl\n>> * continue -> cont (cnt is used for count)\n>> * line -> ln\n>> * hered -> hdoc\n>> * shell -> sh\n>> * string -> str\n>\n> These are reasonable. \"cl\" feels a little odd, but I can't think of\n> anything better.\n>\n>> diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\n>> @@ -24,7 +24,7 @@ category_list () {\n>>  get_synopsis () {\n>>         sed -n '\n>> -               /^NAME/,/'\"$1\"'/H\n>> +               /^NAME/,/'\"$1\"'/h\n>\n> This change is not mentioned in the commit message. \"H\" and \"h\" are\n> very different commands, so it's difficult, at a glance, to tell if\n> this change is even valid. Some explanation in the commit message\n> would help (if it is indeed valid).\n\nI am glad somebody else caught the same thing as I did.  copying and\nappending will give very different results.\n\nThanks.\n"},{"id":"405298","messageId":"pull.694.v3.git.1599704262.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.v2.git.1599680861.gitgitgadget@gmail.com","subject":"[PATCH v3 0/2] Fit the building tools to Plan 9 environment","fromName":"KADOTA, Kyohei via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-10T02:17:40Z","receivedAt":"2020-09-10T02:19:09Z","isPatch":true,"sender":{"key":"name:KADOTA, Kyohei","avatar":null},"body":"I've posted some commits for porting git to Plan 9.\n\nThis pull request is thing that cut off building scripts from #305 and is\nre-constructed that.\n\nI expect this don't change any artifacts.\n\ndiffer from v1\n==============\n\n * drop some adapters, printf, cut, expr or tar\n * drop using SHELL_PATH instead of sh\n * use real name at Signed-off-by signature\n\nKyohei Kadota (2):\n  Fit to Plan 9's ANSI/POSIX compatibility layer\n  Use $(LD) instead of $(CC) for linking the object files\n\n .github/workflows/main.yml |  1 +\n Makefile                   | 15 +++++----\n ci/lib.sh                  |  8 ++++-\n config.mak.in              |  1 +\n config.mak.uname           |  6 ++++\n generate-cmdlist.sh        |  2 +-\n t/chainlint.sed            | 66 +++++++++++++++++++-------------------\n 7 files changed, 57 insertions(+), 42 deletions(-)\n\n\nbase-commit: 3a238e539bcdfe3f9eb5010fd218640c1b499f7a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-694%2Flufia%2Fcompat-p9-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-694/lufia/compat-p9-v3\nPull-Request: https://github.com/gitgitgadget/git/pull/694\n\nRange-diff vs v2:\n\n 1:  c850888c25 ! 1:  534378c4e5 Fit to Plan 9's ANSI/POSIX compatibility layer\n     @@ generate-cmdlist.sh: command_list () {\n       \tgrep -v '^$' |\n       \tsort |\n       \tuniq\n     -@@ generate-cmdlist.sh: category_list () {\n     - \n     - get_synopsis () {\n     - \tsed -n '\n     --\t\t/^NAME/,/'\"$1\"'/H\n     -+\t\t/^NAME/,/'\"$1\"'/h\n     - \t\t${\n     - \t\t\tx\n     - \t\t\ts/.*'\"$1\"' - \\(.*\\)/N_(\"\\1\")/\n      \n       ## t/chainlint.sed ##\n      @@\n 2:  6f35562965 = 2:  7d33e11867 Use $(LD) instead of $(CC) for linking the object files\n\n-- \ngitgitgadget\n"},{"id":"405299","messageId":"534378c4e558057ce66e291c5a104b7227eb84f3.1599704262.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.v3.git.1599704262.gitgitgadget@gmail.com","subject":"[PATCH v3 1/2] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Kyohei Kadota via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-10T02:17:41Z","receivedAt":"2020-09-10T02:20:46Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"From: Kyohei Kadota <lufia@lufia.org>\n\ntr(1) of ANSI/POSIX environment, aka APE, don't support \\n literal.\nIt's handles only octal(\\ooo) or hexadecimal(\\xhhhh) numbers.\n\nAnd its sed(1)'s label is limited to maximum seven characters.\nTherefore I replaced some labels to drop a character.\n\n* close -> cl\n* continue -> cont (cnt is used for count)\n* line -> ln\n* hered -> hdoc\n* shell -> sh\n* string -> str\n\nSigned-off-by: Kyohei Kadota <lufia@lufia.org>\n---\n generate-cmdlist.sh |  2 +-\n t/chainlint.sed     | 66 ++++++++++++++++++++++-----------------------\n 2 files changed, 34 insertions(+), 34 deletions(-)\n\ndiff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\nindex 45fecf8bdf..9dbbb08e70 100755\n--- a/generate-cmdlist.sh\n+++ b/generate-cmdlist.sh\n@@ -10,7 +10,7 @@ command_list () {\n }\n \n get_categories () {\n-\ttr ' ' '\\n'|\n+\ttr ' ' '\\012'|\n \tgrep -v '^$' |\n \tsort |\n \tuniq\ndiff --git a/t/chainlint.sed b/t/chainlint.sed\nindex 70df40e34b..8a25c5b855 100644\n--- a/t/chainlint.sed\n+++ b/t/chainlint.sed\n@@ -117,7 +117,7 @@\n /^[ \t]*!*[ \t]*(..*)[ \t]*[0-9]*[<>|&]/boneline\n \n # multi-line \"(...\\n...)\"\n-/^[ \t]*(/bsubshell\n+/^[ \t]*(/bsubsh\n \n # innocuous line -- print it and advance to next line\n b\n@@ -130,11 +130,11 @@ b\n }\n b\n \n-:subshell\n+:subsh\n # bare \"(\" line? -- stash for later printing\n /^[ \t]*([\t]*$/ {\n \th\n-\tbnextline\n+\tbnextln\n }\n # \"(...\" line -- split off and stash \"(\", then process \"...\" as its own line\n x\n@@ -143,7 +143,7 @@ x\n s/(//\n bslurp\n \n-:nextline\n+:nextln\n N\n s/.*\\n//\n \n@@ -151,10 +151,10 @@ s/.*\\n//\n # incomplete line \"...\\\"\n /\\\\$/bicmplte\n # multi-line quoted string \"...\\n...\"?\n-/\"/bdqstring\n+/\"/bdqstr\n # multi-line quoted string '...\\n...'? (but not contraction in string \"it's\")\n /'/{\n-\t/\"[^'\"]*'[^'\"]*\"/!bsqstring\n+\t/\"[^'\"]*'[^'\"]*\"/!bsqstr\n }\n :folded\n # here-doc -- swallow it\n@@ -163,8 +163,8 @@ s/.*\\n//\n # before closing \")\", \"done\", \"elsif\", \"else\", or \"fi\" will need to be\n # re-visited to drop \"suspect\" marking since final line of those constructs\n # legitimately lacks \"&&\", so \"suspect\" mark must be removed\n-/^[ \t]*#/bnextline\n-/^[ \t]*$/bnextline\n+/^[ \t]*#/bnextln\n+/^[ \t]*$/bnextln\n # in-line comment -- strip it (but not \"#\" in a string, Bash ${#...} array\n # length, or Perforce \"//depot/path#42\" revision in filespec)\n /[ \t]#/{\n@@ -175,22 +175,22 @@ s/.*\\n//\n # multi-line \"case ... esac\"\n /^[ \t]*case[ \t]..*[ \t]in/bcase\n # multi-line \"for ... done\" or \"while ... done\"\n-/^[ \t]*for[ \t]..*[ \t]in/bcontinue\n-/^[ \t]*while[ \t]/bcontinue\n-/^[ \t]*do[ \t]/bcontinue\n-/^[ \t]*do[ \t]*$/bcontinue\n-/;[ \t]*do/bcontinue\n+/^[ \t]*for[ \t]..*[ \t]in/bcont\n+/^[ \t]*while[ \t]/bcont\n+/^[ \t]*do[ \t]/bcont\n+/^[ \t]*do[ \t]*$/bcont\n+/;[ \t]*do/bcont\n /^[ \t]*done[ \t]*&&[ \t]*$/bdone\n /^[ \t]*done[ \t]*$/bdone\n /^[ \t]*done[ \t]*[<>|]/bdone\n /^[ \t]*done[ \t]*)/bdone\n-/||[ \t]*exit[ \t]/bcontinue\n-/||[ \t]*exit[ \t]*$/bcontinue\n+/||[ \t]*exit[ \t]/bcont\n+/||[ \t]*exit[ \t]*$/bcont\n # multi-line \"if...elsif...else...fi\"\n-/^[ \t]*if[ \t]/bcontinue\n-/^[ \t]*then[ \t]/bcontinue\n-/^[ \t]*then[ \t]*$/bcontinue\n-/;[ \t]*then/bcontinue\n+/^[ \t]*if[ \t]/bcont\n+/^[ \t]*then[ \t]/bcont\n+/^[ \t]*then[ \t]*$/bcont\n+/;[ \t]*then/bcont\n /^[ \t]*elif[ \t]/belse\n /^[ \t]*elif[ \t]*$/belse\n /^[ \t]*else[ \t]/belse\n@@ -234,10 +234,10 @@ s/.*\\n//\n \t}\n }\n # line ends with pipe \"...|\" -- valid; not missing \"&&\"\n-/|[ \t]*$/bcontinue\n+/|[ \t]*$/bcont\n # missing end-of-line \"&&\" -- mark suspect\n /&&[ \t]*$/!s/^/?!AMP?!/\n-:continue\n+:cont\n # retrieve and print previous line\n x\n n\n@@ -250,7 +250,7 @@ s/\\\\\\n//\n bslurp\n \n # check for multi-line double-quoted string \"...\\n...\" -- fold to one line\n-:dqstring\n+:dqstr\n # remove all quote pairs\n s/\"\\([^\"]*\\)\"/@!\\1@!/g\n # done if no dangling quote\n@@ -258,13 +258,13 @@ s/\"\\([^\"]*\\)\"/@!\\1@!/g\n # otherwise, slurp next line and try again\n N\n s/\\n//\n-bdqstring\n+bdqstr\n :dqdone\n s/@!/\"/g\n bfolded\n \n # check for multi-line single-quoted string '...\\n...' -- fold to one line\n-:sqstring\n+:sqstr\n # remove all quote pairs\n s/'\\([^']*\\)'/@!\\1@!/g\n # done if no dangling quote\n@@ -272,7 +272,7 @@ s/'\\([^']*\\)'/@!\\1@!/g\n # otherwise, slurp next line and try again\n N\n s/\\n//\n-bsqstring\n+bsqstr\n :sqdone\n s/@!/'/g\n bfolded\n@@ -282,11 +282,11 @@ bfolded\n :heredoc\n s/^\\(.*\\)<<[ \t]*[-\\\\'\"]*\\([A-Za-z0-9_][A-Za-z0-9_]*\\)['\"]*/<\\2>\\1<</\n s/[ \t]*<<//\n-:heredsub\n+:hdocsub\n N\n /^<\\([^>]*\\)>.*\\n[ \t]*\\1[ \t]*$/!{\n \ts/\\n.*$//\n-\tbheredsub\n+\tbhdocsub\n }\n s/^<[^>]*>//\n s/\\n.*$//\n@@ -305,7 +305,7 @@ bcase\n x\n s/?!AMP?!//\n x\n-bcontinue\n+bcont\n \n # found \"done\" closing for-loop or while-loop, or \"fi\" closing if-then -- drop\n # \"suspect\" from final contained line since that line legitimately lacks \"&&\"\n@@ -321,10 +321,10 @@ bchkchn\n # found nested multi-line \"(...\\n...)\" -- pass through untouched\n :nest\n x\n-:nstslurp\n+:nstslrp\n n\n # closing \")\" on own line -- stop nested slurp\n-/^[ \t]*)/bnstclose\n+/^[ \t]*)/bnstcl\n # comment -- not closing \")\" if in comment\n /^[ \t]*#/bnstcnt\n # \"$((...))\" -- arithmetic expansion; not closing \")\"\n@@ -332,11 +332,11 @@ n\n # \"$(...)\" -- command substitution; not closing \")\"\n /\\$([^)][^)]*)[^)]*$/bnstcnt\n # closing \"...)\" -- stop nested slurp\n-/)/bnstclose\n+/)/bnstcl\n :nstcnt\n x\n-bnstslurp\n-:nstclose\n+bnstslrp\n+:nstcl\n s/^/>>/\n # is it \"))\" which closes nested and parent subshells?\n /)[ \t]*)/bslurp\n-- \ngitgitgadget\n\n"},{"id":"405301","messageId":"7d33e11867e0a75efb1a906610ff81da2ace9717.1599704262.git.gitgitgadget@gmail.com","threadId":"53996","inReplyTo":"pull.694.v3.git.1599704262.gitgitgadget@gmail.com","subject":"[PATCH v3 2/2] Use $(LD) instead of $(CC) for linking the object files","fromName":"Kyohei Kadota via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-10T02:17:42Z","receivedAt":"2020-09-10T02:21:46Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"From: Kyohei Kadota <lufia@lufia.org>\n\nPlan 9's loader(aka. linker) is separated from the compiler.\nThe compilers are called 8c, 6c... for each machine architectures;\ncorresponded loaders are called 8l, 6l...\n\nSigned-off-by: Kyohei Kadota <lufia@lufia.org>\n---\n .github/workflows/main.yml |  1 +\n Makefile                   | 15 ++++++++-------\n ci/lib.sh                  |  8 +++++++-\n config.mak.in              |  1 +\n config.mak.uname           |  6 ++++++\n 5 files changed, 23 insertions(+), 8 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 30425404eb..5ece32d4fa 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -252,6 +252,7 @@ jobs:\n             pool: ubuntu-latest\n     env:\n       CC: ${{matrix.vector.cc}}\n+      LD: ${{matrix.vector.cc}}\n       jobname: ${{matrix.vector.jobname}}\n     runs-on: ${{matrix.vector.pool}}\n     steps:\ndiff --git a/Makefile b/Makefile\nindex 86e5411f39..c0c0c280f0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -543,6 +543,7 @@ export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir\n \n # Set our default programs\n CC = cc\n+LD = cc\n AR = ar\n RM = rm -f\n DIFF = diff\n@@ -2121,7 +2122,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \\\n \t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'\n \n git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) \\\n \t\t$(filter %.o,$^) $(LIBS)\n \n help.sp help.s help.o: command-list.h\n@@ -2445,17 +2446,17 @@ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n endif\n \n git-%$X: %.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n \n git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(IMAP_SEND_LDFLAGS) $(LIBS)\n \n git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(LIBS)\n git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n@@ -2465,7 +2466,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n \tcp $< $@\n \n $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n $(LIB_FILE): $(LIB_OBJS)\n@@ -2753,7 +2754,7 @@ perf: all\n t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n \n t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n+\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n \n check-sha1:: t/helper/test-tool$X\n \tt/helper/test-sha1.sh\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 3eefec500d..19c5beb277 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -125,6 +125,7 @@ then\n \ttest darwin != \"$CI_OS_NAME\" || CI_OS_NAME=osx\n \tCI_REPO_SLUG=\"$(expr \"$BUILD_REPOSITORY_URI\" : '.*/\\([^/]*/[^/]*\\)$')\"\n \tCC=\"${CC:-gcc}\"\n+\tLD=\"$CC\"\n \n \t# use a subdirectory of the cache dir (because the file share is shared\n \t# among *all* phases)\n@@ -149,6 +150,7 @@ then\n \tCI_REPO_SLUG=\"$GITHUB_REPOSITORY\"\n \tCI_JOB_ID=\"$GITHUB_RUN_ID\"\n \tCC=\"${CC:-gcc}\"\n+\tLD=\"$CC\"\n \n \tcache_dir=\"$HOME/none\"\n \n@@ -184,6 +186,7 @@ linux-clang|linux-gcc)\n \tif [ \"$jobname\" = linux-gcc ]\n \tthen\n \t\texport CC=gcc-8\n+\t\texport LD=\"$CC\"\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n@@ -207,6 +210,7 @@ osx-clang|osx-gcc)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n \t\texport CC=gcc-9\n+\t\texport LD=\"$CC\"\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python2)\"\n@@ -222,12 +226,14 @@ GETTEXT_POISON)\n \t;;\n Linux32)\n \tCC=gcc\n+\tLD=\"$CC\"\n \t;;\n linux-musl)\n \tCC=gcc\n+\tLD=\"$CC\"\n \tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes\"\n \tMAKEFLAGS=\"$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes\"\n \t;;\n esac\n \n-MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc}\"\n+MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc} LD=${LD:-cc}\"\ndiff --git a/config.mak.in b/config.mak.in\nindex e6a6d0f941..76ea7e781e 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -2,6 +2,7 @@\n # @configure_input@\n \n CC = @CC@\n+LD = @CC@\n CFLAGS = @CFLAGS@\n CPPFLAGS = @CPPFLAGS@\n LDFLAGS = @LDFLAGS@\ndiff --git a/config.mak.uname b/config.mak.uname\nindex c7eba69e54..886ce068f8 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -69,6 +69,7 @@ ifeq ($(uname_S),GNU/kFreeBSD)\n endif\n ifeq ($(uname_S),UnixWare)\n \tCC = cc\n+\tLD = $(CC)\n \tNEEDS_SOCKET = YesPlease\n \tNEEDS_NSL = YesPlease\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n@@ -90,6 +91,7 @@ ifeq ($(uname_S),SCO_SV)\n \tendif\n \tifeq ($(uname_R),5)\n \t\tCC = cc\n+\t\tLD = $(CC)\n \t\tBASIC_CFLAGS += -Kthread\n \tendif\n \tNEEDS_SOCKET = YesPlease\n@@ -435,6 +437,7 @@ ifeq ($(uname_S),Windows)\n \tDEFAULT_HELP_FORMAT = html\n \n \tCC = compat/vcbuild/scripts/clink.pl\n+\tLD = $(CC)\n \tAR = compat/vcbuild/scripts/lib.pl\n \tCFLAGS =\n \tBASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE\n@@ -525,6 +528,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n \tifeq ($(uname_R).$(uname_V),L17.02)\n \t\tCC += -WRVU=L16.05\n \tendif\n+\tLD = $(CC)\n \t# Disable all optimization, seems to result in bad code, with -O or -O2\n \t# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects\n \t# abends on \"git push\". Needs more investigation.\n@@ -665,8 +669,10 @@ else\n \t\t\tBASIC_LDFLAGS += -Wl,--large-address-aware\n \t\tendif\n \t\tCC = gcc\n+\t\tLD = $(CC)\n \t\tCOMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \\\n \t\t\t-fstack-protector-strong\n+\t\tBASIC_LDFLAGS += -fstack-protector-strong\n \t\tEXTLIBS += -lntdll\n \t\tINSTALL = /bin/install\n \t\tNO_R_TO_GCC_LINKER = YesPlease\n-- \ngitgitgadget\n"},{"id":"405302","messageId":"CAFMepc=wvY3zycHbJkX3Av55SgCPLExnqaxEUP_F403KTsz49A@mail.gmail.com","threadId":"53996","inReplyTo":"CAPig+cQ_KCAGpmfBAymBefB2JSVpw0-bk5HOnm41=SpADEyDnA@mail.gmail.com","subject":"Re: [PATCH v2 1/2] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Kyohei Kadota","fromEmail":"lufia@lufia.org","sentAt":"2020-09-10T00:35:39Z","receivedAt":"2020-09-10T02:46:43Z","isPatch":true,"sender":{"key":"lufia@lufia.org","avatar":"https://avatars.githubusercontent.com/u/1784379?v=4"},"body":"Thank you for your review!\n\n2020年9月10日(木) 4:56 Eric Sunshine <sunshine@sunshineco.com>:\n>\n> On Wed, Sep 9, 2020 at 3:48 PM Kyohei Kadota via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n> > And its sed(1)'s label is limited to maximum seven characters.\n> > Therefore I replaced some labels to drop a character.\n> >\n> > * close -> cl\n> > * continue -> cont (cnt is used for count)\n> > * line -> ln\n> > * hered -> hdoc\n> > * shell -> sh\n> > * string -> str\n>\n> These are reasonable. \"cl\" feels a little odd, but I can't think of\n> anything better.\n>\n> > diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\n> > @@ -24,7 +24,7 @@ category_list () {\n> >  get_synopsis () {\n> >         sed -n '\n> > -               /^NAME/,/'\"$1\"'/H\n> > +               /^NAME/,/'\"$1\"'/h\n>\n> This change is not mentioned in the commit message. \"H\" and \"h\" are\n> very different commands, so it's difficult, at a glance, to tell if\n> this change is even valid. Some explanation in the commit message\n> would help (if it is indeed valid).\n\nI missed, this change was not needed. It is remnants of trial and error.\n"},{"id":"405314","messageId":"xmqqa6xyrz7g.fsf@gitster.c.googlers.com","threadId":"53996","inReplyTo":"534378c4e558057ce66e291c5a104b7227eb84f3.1599704262.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v3 1/2] Fit to Plan 9's ANSI/POSIX compatibility layer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-10T05:13:39Z","receivedAt":"2020-09-10T05:13:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kyohei Kadota via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Kyohei Kadota <lufia@lufia.org>\n>\n> tr(1) of ANSI/POSIX environment, aka APE, don't support \\n literal.\n> It's handles only octal(\\ooo) or hexadecimal(\\xhhhh) numbers.\n>\n> And its sed(1)'s label is limited to maximum seven characters.\n> Therefore I replaced some labels to drop a character.\n>\n> * close -> cl\n> * continue -> cont (cnt is used for count)\n> * line -> ln\n> * hered -> hdoc\n> * shell -> sh\n> * string -> str\n>\n> Signed-off-by: Kyohei Kadota <lufia@lufia.org>\n> ---\n\nThis round, without the confusion between 'h' and 'H' commands, I\nsee nothing funny in it.\n\nWill queue.  Thanks.\n"},{"id":"405315","messageId":"xmqq4ko6ryei.fsf@gitster.c.googlers.com","threadId":"53996","inReplyTo":"7d33e11867e0a75efb1a906610ff81da2ace9717.1599704262.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v3 2/2] Use $(LD) instead of $(CC) for linking the object files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-10T05:31:01Z","receivedAt":"2020-09-10T05:31:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kyohei Kadota via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> diff --git a/Makefile b/Makefile\n> index 86e5411f39..c0c0c280f0 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -543,6 +543,7 @@ export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir\n>  \n>  # Set our default programs\n>  CC = cc\n> +LD = cc\n\nThis is good that any system that use 'cc' to link now will reach\nthe same 'cc' via $(LD) instead of $(CC).\n\nBut those who customize $(CC) to their taste now needs to override\nnot just CC but also LD.  Can we avoid regressing for them?  Perhaps\ndefault the value of LD to $(CC) instead of hardcoded 'cc'?\n\n> @@ -2121,7 +2122,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \\\n>  \t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'\n>  \n>  git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \\\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) \\\n>  \t\t$(filter %.o,$^) $(LIBS)\n\nAre there those who depended on ALL_CFLAGS on the command line when\nthe final linking happens?\n\nFor example, people have '-g -O2' on CFLAGS, and that will be\nincluded in ALL_CFLAGS and passed to the final linking phase.  GNU\nld has \"-O\" option to optimize; when existing systems link with \"cc\n-g -O2 -o $@ ...\", it is likely that \"-O2\" given to \"cc\" will cause\nthe \"-O\" option to be passed to underlying \"ld\".\n\nBut with the updated procedure (where LD is 'cc' for them), the\nlinkage will be done without ALL_CFLAGS passed on the command line,\nand results in \"cc -o $@ ...\", without \"-g -O2\".\n\nThat sounds like a regression.\n\n> @@ -2445,17 +2446,17 @@ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n>  endif\n>  \n>  git-%$X: %.o GIT-LDFLAGS $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n>  \n>  git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n>  \t\t$(IMAP_SEND_LDFLAGS) $(LIBS)\n>  \n>  git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n>  \t\t$(CURL_LIBCURL) $(LIBS)\n>  git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n>  \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n>  \n>  $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n> @@ -2465,7 +2466,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n>  \tcp $< $@\n>  \n>  $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n>  \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n>\n> @@ -2753,7 +2754,7 @@ perf: all\n>  t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n>  \n>  t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n> -\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n> +\t$(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n\nLikewise for all of the above.\n\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 3eefec500d..19c5beb277 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -125,6 +125,7 @@ then\n\nAll changes to this file to pass LD=cc everywhere CC=cc is passed\nlook good to me.\n\n> diff --git a/config.mak.in b/config.mak.in\n> index e6a6d0f941..76ea7e781e 100644\n> --- a/config.mak.in\n> +++ b/config.mak.in\n> @@ -2,6 +2,7 @@\n>  # @configure_input@\n>  \n>  CC = @CC@\n> +LD = @CC@\n>  CFLAGS = @CFLAGS@\n>  CPPFLAGS = @CPPFLAGS@\n>  LDFLAGS = @LDFLAGS@\n\nOK.\n\n> diff --git a/config.mak.uname b/config.mak.uname\n> index c7eba69e54..886ce068f8 100644\n> --- a/config.mak.uname\n> +++ b/config.mak.uname\n> @@ -69,6 +69,7 @@ ifeq ($(uname_S),GNU/kFreeBSD)\n>  endif\n>  ifeq ($(uname_S),UnixWare)\n>  \tCC = cc\n> +\tLD = $(CC)\n>  \tNEEDS_SOCKET = YesPlease\n>  \tNEEDS_NSL = YesPlease\n>  \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n> @@ -90,6 +91,7 @@ ifeq ($(uname_S),SCO_SV)\n>  \tendif\n>  \tifeq ($(uname_R),5)\n>  \t\tCC = cc\n> +\t\tLD = $(CC)\n>  \t\tBASIC_CFLAGS += -Kthread\n>  \tendif\n>  \tNEEDS_SOCKET = YesPlease\n> @@ -435,6 +437,7 @@ ifeq ($(uname_S),Windows)\n>  \tDEFAULT_HELP_FORMAT = html\n>  \n>  \tCC = compat/vcbuild/scripts/clink.pl\n> +\tLD = $(CC)\n>  \tAR = compat/vcbuild/scripts/lib.pl\n>  \tCFLAGS =\n>  \tBASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE\n> @@ -525,6 +528,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n>  \tifeq ($(uname_R).$(uname_V),L17.02)\n>  \t\tCC += -WRVU=L16.05\n>  \tendif\n> +\tLD = $(CC)\n>  \t# Disable all optimization, seems to result in bad code, with -O or -O2\n>  \t# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects\n>  \t# abends on \"git push\". Needs more investigation.\n\nDitto.\n\n> @@ -665,8 +669,10 @@ else\n>  \t\t\tBASIC_LDFLAGS += -Wl,--large-address-aware\n>  \t\tendif\n>  \t\tCC = gcc\n> +\t\tLD = $(CC)\n>  \t\tCOMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \\\n>  \t\t\t-fstack-protector-strong\n> +\t\tBASIC_LDFLAGS += -fstack-protector-strong\n>  \t\tEXTLIBS += -lntdll\n>  \t\tINSTALL = /bin/install\n>  \t\tNO_R_TO_GCC_LINKER = YesPlease\n\nThis is an example of the problem we discussed earlier for not\npassing ALL_CFLAGS to the linking phase.  I am not sure what the\nbest solution is, though.\n\nThanks.\n"}]}