git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "KADOTA, Kyohei via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/3] Port git to Plan 9
Date: Tue, 27 Aug 2019 06:46:16 -0700 (PDT)	[thread overview]
Message-ID: <pull.305.v2.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.305.git.gitgitgadget@gmail.com>

Changes from v1
===============

 * Use gmake
 * Use sh
 * Remove dependencies to Plan 9 tools; rc and mk

What I did
==========

I ported git, and git subcommands with gmake to Plan 9. This pull request
contains patches for existing codes, and new files to build git in Plan 9.

I added three new options into Makefile.

 * USER_GITCONFIG - default ~/.gitconfig
 * USER_GITCREDENTIALS - default ~/.git-credentials
 * USER_GITCREDENTIAL_CACHE - default ~/.git-credential-cache
 * USE_EXEC_WRAPPER - default empty

In Plan 9, user configuration files are stored at $home/lib, instead of
dotfiles.
http://xahlee.info/UnixResource_dir/writ/unix_origin_of_dot_filename.html

And Plan 9 haven't hard link and symbolic link. Thus I added exec-wrapper to
want to shrink disk usage.
http://doc.cat-v.org/plan_9/4th_edition/papers/lexnames

Installation
============

# ANSI/POSIX commands are installed at /bin only in current namespace.
% bind -a /bin/ape /bin

# Plan 9 C compiler can't initialize struct fields that is bit field so remove bit fields from all C files.
% ./remove-bitfields.sh

# build Git toolchain with /n/sources/contrib/andrey/make-3.81.tgz
% gmake 'prefix=' 'gitexecdir=bin/git-core' 'sysconfdir=sys/lib/git' 'template_dir=sys/lib/git/templates' install

lufia (3):
  Change HOME, PATH, and .gitconfig paths to be customizable
  Fix C syntactic errors for the Plan 9 C compiler
  Support Plan 9 dialect

 GIT-VERSION-GEN               |  2 +-
 Makefile                      | 81 +++++++++++++++++++++++-----
 builtin/config.c              |  2 +-
 compat/plan9/openssl/crypto.h |  5 ++
 compat/regex/regex_internal.h |  3 ++
 config.c                      |  5 +-
 config.mak.uname              | 99 +++++++++++++++++++++++++++++++++++
 credential-cache.c            |  2 +-
 credential-store.c            |  2 +-
 exec-cmd.c                    |  4 +-
 exec-wrapper.c                | 16 ++++++
 generate-cmdlist.sh           | 24 ++++++---
 git-compat-util.h             | 17 +++++-
 help.c                        |  2 +-
 parse-options.h               | 18 +++----
 path.c                        |  6 +--
 remove-bitfields.sh           | 17 ++++++
 run-command.c                 |  4 +-
 sequencer.c                   |  2 +-
 shell.c                       |  2 +-
 t/chainlint.sed               | 66 +++++++++++------------
 templates/Makefile            | 12 ++++-
 22 files changed, 311 insertions(+), 80 deletions(-)
 create mode 100644 compat/plan9/openssl/crypto.h
 create mode 100644 exec-wrapper.c
 create mode 100755 remove-bitfields.sh


base-commit: 745f6812895b31c02b29bdfe4ae8e5498f776c26
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-305%2Flufia%2Fplan9-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-305/lufia/plan9-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/305

Range-diff vs v1:

 1:  fa539c75b2 ! 1:  63e7e7794e Change HOME, PATH, and .gitconfig paths to be customizable
     @@ -10,12 +10,26 @@
       --- a/Makefile
       +++ b/Makefile
      @@
     + localedir = $(sharedir)/locale
     + template_dir = share/git-core/templates
       htmldir = $(prefix)/share/doc/git-doc
     - ETC_GITCONFIG = $(sysconfdir)/gitconfig
     - ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
     -+USER_GITCONFIG = ~/.gitconfig
     -+USER_GITCREDENTIALS = ~/.git-credentials
     -+USER_GITCREDENTIAL_CACHE = ~/.git-credential-cache
     +-ETC_GITCONFIG = $(sysconfdir)/gitconfig
     +-ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
     ++ifndef ETC_GITCONFIG
     ++	ETC_GITCONFIG = $(sysconfdir)/gitconfig
     ++endif
     ++ifndef ETC_GITATTRIBUTES
     ++	ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
     ++endif
     ++ifndef USER_GITCONFIG
     ++	USER_GITCONFIG = ~/.gitconfig
     ++endif
     ++ifndef USER_GITCREDENTIALS
     ++	USER_GITCREDENTIALS = ~/.git-credentials
     ++endif
     ++ifndef USER_GITCREDENTIAL_CACHE
     ++	USER_GITCREDENTIAL_CACHE = ~/.git-credential-cache
     ++endif
       lib = lib
       # DESTDIR =
       pathsep = :
 2:  301a796de9 ! 2:  7abbd36e1d Fix C syntactic errors for the Plan 9 C compiler
     @@ -114,22 +114,25 @@
        * It's okay for the caller to consume argv/argc in the usual way.
        * Other fields of that structure are private to parse-options and should not
      
     - diff --git a/remove-bitfields.rc b/remove-bitfields.rc
     - new file mode 100644
     + diff --git a/remove-bitfields.sh b/remove-bitfields.sh
     + new file mode 100755
       --- /dev/null
     - +++ b/remove-bitfields.rc
     + +++ b/remove-bitfields.sh
      @@
     -+#!/bin/rc
     ++#!/bin/ape/sh
      +# Plan 9 C compiler rejects initialization a structure including bit field.
     -+# usage: remove-bitfields.rc [dir ...]
     ++# usage: remove-bitfields.sh [dir ...]
     ++
     ++if ! echo abc | sed 's/(ab)c/\1/' >/dev/null 2>&1
     ++then
     ++	alias sed='sed -E'
     ++fi
      +
     -+fn sigexit sighup sigint sigquit sigterm {
     -+	rm -f /tmp/remove-bitfields.$pid
     -+	exit
     -+}
     ++trap 'rm -f /tmp/remove-bitfields.$pid; exit 1' 1 2 3 15 EXIT
      +
     -+files=`{du -a $* | awk '/\.[ch]$/ { print $2 }'}
     -+for(i in $files){
     ++files=$(du -a $* | awk '/\.[ch]$/ { print $2 }')
     ++for i in $files
     ++do
      +	sed '/(^[ 	]*\*|\?)/!s/([a-z]+[a-z0-9]*) *: *[0-9]+([,;])/\1\2/g' $i >/tmp/remove-bitfields.$pid
      +	cp /tmp/remove-bitfields.$pid $i
     -+}
     ++done
 3:  df67a7e1d3 < -:  ---------- GIT-VERSION-GEN: Use sed instead of expr
 4:  d25bcb43e1 < -:  ---------- Port generate-cmdline.sh to rc
 5:  d00bbdce0d < -:  ---------- Add plan9/wrap.c
 6:  0494971306 < -:  ---------- Add mkfile to build git and subcommands for Plan 9
 -:  ---------- > 3:  7505e85fc5 Support Plan 9 dialect

-- 
gitgitgadget

  parent reply	other threads:[~2019-08-27 13:46 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 ` [PATCH 5/6] Add plan9/wrap.c lufia via GitGitGadget
2019-08-04  0:03   ` 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 ` KADOTA, Kyohei via GitGitGadget [this message]
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=pull.305.v2.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).