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

[PATCH 5/6] Add plan9/wrap.c

From
LGlufia via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 3, 2019, 23:52 UTC
Message-ID
<d00bbdce0d5104f1793b7fa0dce14f678e9fb331.1564876327.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.305.git.gitgitgadget@gmail.com>
From: lufia <lufia@lufia.org>

Plan 9 has bind(1) instead of ln(1), but bind isn't persisted to the disk. However it isn't efficient to copy git to git- subcommands such as git-add. Therefore Plan 9 needs wrap.c to switch behavior by executable name.

Signed-off-by: lufia <lufia@lufia.org>
---
 plan9/wrap.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 plan9/wrap.c
diff --git a/plan9/wrap.c b/plan9/wrap.c
new file mode 100644
index 0000000000..589d13bf5d
--- /dev/null
+++ b/plan9/wrap.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#define _POSIX_SOURCE
+#include <unistd.h>
+
+int
+main(int argc, char *argv[])
+{
+	USED(argc);
+	if(execv("/bin/git", argv) < 0){
+		fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
+		return 1;
+	}
+	return 0; /* can't happen */
+}
-- 
gitgitgadget
Previous: Junio C HamanoNext: brian m. carlson
Message 7 of 17 in “Port git to Plan 9”
  1. 0/6 Port git to Plan 9KADOTA, Kyohei via GitGitGadget, Aug 3, 2019
  2. 2/6 Fix C syntactic errors for the Plan 9 C compilerlufia via GitGitGadget, Aug 3, 2019
  3. 4/6 Port generate-cmdline.sh to rclufia via GitGitGadget, Aug 3, 2019
  4. 1/6 Change HOME, PATH, and .gitconfig paths to be customizablelufia via GitGitGadget, Aug 3, 2019
  5. 3/6 GIT-VERSION-GEN: Use sed instead of exprlufia via GitGitGadget, Aug 3, 2019
  6. Junio C HamanoAug 5, 2019
  7. 5/6 Add plan9/wrap.clufia via GitGitGadget, Aug 3, 2019
  8. brian m. carlsonAug 4, 2019
  9. Kyohei KadotaAug 4, 2019
  10. 6/6 Add mkfile to build git and subcommands for Plan 9lufia via GitGitGadget, Aug 3, 2019
  11. brian m. carlsonAug 4, 2019
  12. Kyohei KadotaAug 4, 2019
  13. Jonathan NiederAug 4, 2019
  14. 0/3 Port git to Plan 9KADOTA, Kyohei via GitGitGadget, Aug 27, 2019
  15. 1/3 Change HOME, PATH, and .gitconfig paths to be customizablelufia via GitGitGadget, Aug 27, 2019
  16. 2/3 Fix C syntactic errors for the Plan 9 C compilerlufia via GitGitGadget, Aug 27, 2019
  17. 3/3 Support Plan 9 dialectlufia via GitGitGadget, Aug 27, 2019

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.