git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] scalar: fix wrong shell hashbang

From
ZheNing Hu via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 17, 2022, 13:11 UTC
Message-ID
<pull.1355.git.1663420281187.gitgitgadget@gmail.com>
From: ZheNing Hu <adlternative@gmail.com>

$SHELL_PATH_SQ haven't been set in scalar's Makefile, bin-wrappers/scalar will begin with wrong hashbang "#!", fix it by setting $SHELL_PATH and $SHELL_PATH_SQ in scalar's Makefile.

Signed-off-by: ZheNing Hu <adlternative@gmail.com>
---
    scalar: fix wrong shell hashbang
    
    The bin-wrappers/scalar seems like missing setting $SHELL_PATH_SQ which
    lead to I can't execute bin-wrappers/scalar correctly, which output
    error:
    
    zsh: exec format error: scalar
    
    (this bug will not turn out in bash)
    
    The bin-wrappers/scalar begin with wrong hashbang "#!", which cannot
    figure out by zsh. So this patch want to fix this problem.
    
    v1: Setting $SHELL_PATH and $SHELL_PATH_SQ in scalar/Makefile.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1355%2Fadlternative%2Fzh%2Fscalar-fix-hashbang-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1355/adlternative/zh/scalar-fix-hashbang-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1355
 contrib/scalar/Makefile | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile
index 37f283f35d7..b2a81d9eb45 100644
--- a/contrib/scalar/Makefile
+++ b/contrib/scalar/Makefile
@@ -8,6 +8,9 @@ include ../../config.mak.uname
 -include ../../config.mak.autogen
 -include ../../config.mak
 
+SHELL_PATH ?= $(SHELL)
+SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+
 TARGETS = scalar$(X) scalar.o
 GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a
 

base-commit: d3fa443f97e3a8d75b51341e2d5bac380b7422df
-- 
gitgitgadget
Next: Victoria Dye
Message 1 of 4 in “scalar: fix wrong shell hashbang”
  1. scalar: fix wrong shell hashbangZheNing Hu via GitGitGadget, Sep 17, 2022
  2. Victoria DyeSep 18, 2022
  3. Junio C HamanoSep 19, 2022
  4. ZheNing HuSep 20, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.