git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "lufia via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, lufia <lufia@lufia.org>
Subject: [PATCH 5/6] Add plan9/wrap.c
Date: Sat, 03 Aug 2019 16:52:12 -0700 (PDT)	[thread overview]
Message-ID: <d00bbdce0d5104f1793b7fa0dce14f678e9fb331.1564876327.git.gitgitgadget@gmail.com> (raw)
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


  parent reply	other threads:[~2019-08-03 23:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-03 23:52 [PATCH 0/6] Port git to Plan 9 KADOTA, Kyohei via GitGitGadget
2019-08-03 23:52 ` [PATCH 1/6] Change HOME, PATH, and .gitconfig paths to be customizable lufia via GitGitGadget
2019-08-03 23:52 ` [PATCH 2/6] Fix C syntactic errors for the Plan 9 C compiler lufia via GitGitGadget
2019-08-03 23:52 ` [PATCH 3/6] GIT-VERSION-GEN: Use sed instead of expr lufia via GitGitGadget
2019-08-05 22:37   ` Junio C Hamano
2019-08-03 23:52 ` [PATCH 4/6] Port generate-cmdline.sh to rc lufia via GitGitGadget
2019-08-03 23:52 ` lufia via GitGitGadget [this message]
2019-08-04  0:03   ` [PATCH 5/6] Add plan9/wrap.c brian m. carlson
2019-08-04  1:26     ` Kyohei Kadota
2019-08-03 23:52 ` [PATCH 6/6] Add mkfile to build git and subcommands for Plan 9 lufia via GitGitGadget
2019-08-04  0:38 ` [PATCH 0/6] Port git to " brian m. carlson
2019-08-04  2:22   ` Kyohei Kadota
2019-08-04 20:22     ` Jonathan Nieder
2019-08-27 13:46 ` [PATCH v2 0/3] " KADOTA, Kyohei via GitGitGadget
2019-08-27 13:46   ` [PATCH v2 1/3] Change HOME, PATH, and .gitconfig paths to be customizable lufia via GitGitGadget
2019-08-27 13:46   ` [PATCH v2 2/3] Fix C syntactic errors for the Plan 9 C compiler lufia via GitGitGadget
2019-08-27 13:46   ` [PATCH v2 3/3] Support Plan 9 dialect lufia via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d00bbdce0d5104f1793b7fa0dce14f678e9fb331.1564876327.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lufia@lufia.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).