Commit: ac99c1f8a836239e82c48fa24393242495796c70
Parent: d8f6eebc88ff368e31b6c1ef10abdd5d5fa60d9e
Author: Randy Palamar
Date: Tue, 3 Oct 2023 19:56:40 -0600
add git from oasis (bumped to v2.42.0)
additionally GIT_EXEC_PATH now properly considers config.prefix
Diffstat:
16 files changed, 1153 insertions(+), 0 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -10,6 +10,10 @@
[submodule "pkg/crypt/fspec-sync/src"]
path = pkg/devel/fspec-sync/src
url = https://github.com/oasislinux/fspec-sync.git
+[submodule "pkg/devel/git/src"]
+ path = pkg/devel/git/src
+ url = https://github.com/git/git.git
+ ignore = all
[submodule "pkg/devel/samurai/src"]
path = pkg/devel/samurai/src
url = https://github.com/michaelforney/samurai.git
diff --git a/pkg/devel/gen.lua b/pkg/devel/gen.lua
@@ -1,4 +1,5 @@
subgen('fspec-sync')
+subgen('git')
subgen('linux-headers')
subgen('man-pages-posix')
subgen('samurai')
diff --git a/pkg/devel/git/.gitignore b/pkg/devel/git/.gitignore
@@ -0,0 +1,3 @@
+/git-manpages-2.42.0.tar.gz
+/man
+/man.ninja
diff --git a/pkg/devel/git/commands.txt b/pkg/devel/git/commands.txt
@@ -0,0 +1,197 @@
+# 2,<cd src/Documentation && printf '%s\n' git*.txt
+git-add.txt
+git-am.txt
+git-annotate.txt
+git-apply.txt
+git-archimport.txt
+git-archive.txt
+git-bisect-lk2009.txt
+git-bisect.txt
+git-blame.txt
+git-branch.txt
+git-bugreport.txt
+git-bundle.txt
+git-cat-file.txt
+git-check-attr.txt
+git-check-ignore.txt
+git-check-mailmap.txt
+git-check-ref-format.txt
+git-checkout-index.txt
+git-checkout.txt
+git-cherry-pick.txt
+git-cherry.txt
+git-citool.txt
+git-clean.txt
+git-clone.txt
+git-column.txt
+git-commit-graph.txt
+git-commit-tree.txt
+git-commit.txt
+git-config.txt
+git-count-objects.txt
+git-credential-cache--daemon.txt
+git-credential-cache.txt
+git-credential-store.txt
+git-credential.txt
+git-cvsexportcommit.txt
+git-cvsimport.txt
+git-cvsserver.txt
+git-daemon.txt
+git-describe.txt
+git-diagnose.txt
+git-diff-files.txt
+git-diff-index.txt
+git-diff-tree.txt
+git-diff.txt
+git-difftool.txt
+git-fast-export.txt
+git-fast-import.txt
+git-fetch-pack.txt
+git-fetch.txt
+git-filter-branch.txt
+git-fmt-merge-msg.txt
+git-for-each-ref.txt
+git-for-each-repo.txt
+git-format-patch.txt
+git-fsck-objects.txt
+git-fsck.txt
+git-fsmonitor--daemon.txt
+git-gc.txt
+git-get-tar-commit-id.txt
+git-grep.txt
+git-gui.txt
+git-hash-object.txt
+git-help.txt
+git-hook.txt
+git-http-backend.txt
+git-http-fetch.txt
+git-http-push.txt
+git-imap-send.txt
+git-index-pack.txt
+git-init-db.txt
+git-init.txt
+git-instaweb.txt
+git-interpret-trailers.txt
+git-log.txt
+git-ls-files.txt
+git-ls-remote.txt
+git-ls-tree.txt
+git-mailinfo.txt
+git-mailsplit.txt
+git-maintenance.txt
+git-merge-base.txt
+git-merge-file.txt
+git-merge-index.txt
+git-merge-one-file.txt
+git-merge-tree.txt
+git-merge.txt
+git-mergetool--lib.txt
+git-mergetool.txt
+git-mktag.txt
+git-mktree.txt
+git-multi-pack-index.txt
+git-mv.txt
+git-name-rev.txt
+git-notes.txt
+git-p4.txt
+git-pack-objects.txt
+git-pack-redundant.txt
+git-pack-refs.txt
+git-patch-id.txt
+git-prune-packed.txt
+git-prune.txt
+git-pull.txt
+git-push.txt
+git-quiltimport.txt
+git-range-diff.txt
+git-read-tree.txt
+git-rebase.txt
+git-receive-pack.txt
+git-reflog.txt
+git-remote-ext.txt
+git-remote-fd.txt
+git-remote.txt
+git-repack.txt
+git-replace.txt
+git-request-pull.txt
+git-rerere.txt
+git-reset.txt
+git-restore.txt
+git-rev-list.txt
+git-rev-parse.txt
+git-revert.txt
+git-rm.txt
+git-send-email.txt
+git-send-pack.txt
+git-sh-i18n--envsubst.txt
+git-sh-i18n.txt
+git-sh-setup.txt
+git-shell.txt
+git-shortlog.txt
+git-show-branch.txt
+git-show-index.txt
+git-show-ref.txt
+git-show.txt
+git-sparse-checkout.txt
+git-stage.txt
+git-stash.txt
+git-status.txt
+git-stripspace.txt
+git-submodule.txt
+git-svn.txt
+git-switch.txt
+git-symbolic-ref.txt
+git-tag.txt
+git-tools.txt
+git-unpack-file.txt
+git-unpack-objects.txt
+git-update-index.txt
+git-update-ref.txt
+git-update-server-info.txt
+git-upload-archive.txt
+git-upload-pack.txt
+git-var.txt
+git-verify-commit.txt
+git-verify-pack.txt
+git-verify-tag.txt
+git-version.txt
+git-web--browse.txt
+git-whatchanged.txt
+git-worktree.txt
+git-write-tree.txt
+git.txt
+gitattributes.txt
+gitcli.txt
+gitcore-tutorial.txt
+gitcredentials.txt
+gitcvs-migration.txt
+gitdiffcore.txt
+giteveryday.txt
+gitfaq.txt
+gitformat-bundle.txt
+gitformat-chunk.txt
+gitformat-commit-graph.txt
+gitformat-index.txt
+gitformat-pack.txt
+gitformat-signature.txt
+gitglossary.txt
+githooks.txt
+gitignore.txt
+gitk.txt
+gitmailmap.txt
+gitmodules.txt
+gitnamespaces.txt
+gitprotocol-capabilities.txt
+gitprotocol-common.txt
+gitprotocol-http.txt
+gitprotocol-pack.txt
+gitprotocol-v2.txt
+gitremote-helpers.txt
+gitrepository-layout.txt
+gitrevisions.txt
+gitsubmodules.txt
+gittutorial-2.txt
+gittutorial.txt
+gitweb.conf.txt
+gitweb.txt
+gitworkflows.txt
diff --git a/pkg/devel/git/config.h b/pkg/devel/git/config.h
@@ -0,0 +1,30 @@
+#define DEFAULT_EDITOR "ed"
+#define DEFAULT_PAGER ""
+#define ETC_GITATTRIBUTES "/etc/gitattributes"
+#define ETC_GITCONFIG "/etc/gitconfig"
+#define GIT_BUILT_FROM_COMMIT "43c8a30d150ecede9709c1f2527c8fba92c65f40"
+#define GIT_HOST_CPU "unknown"
+#define GIT_USER_AGENT "git/" GIT_VERSION
+#define GIT_VERSION "2.42.0"
+#define HAVE_ALLOCA_H
+#define HAVE_PATHS_H
+#define HAVE_DEV_TTY
+#define HAVE_CLOCK_GETTIME
+#define HAVE_CLOCK_MONOTONIC
+#define HAVE_SYNC_FILE_RANGE
+#define HAVE_GETRANDOM
+#define HAVE_GETDELIM
+#define NO_GETTEXT
+#define NO_OPENSSL
+#define NO_SYS_POLL_H
+#define SUPPORTS_SIMPLE_IPC
+#define PAGER_ENV "LESS=FRX LV=-c"
+#define USE_CURL_FOR_IMAP_SEND
+
+#define SHA1_DC
+#define SHA1DC_NO_STANDARD_INCLUDES
+#define SHA1DC_INIT_SAFE_HASH_DEFAULT 0
+#define SHA1DC_CUSTOM_INCLUDE_SHA1_C "git-compat-util.h"
+#define SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C "git-compat-util.h"
+
+#define SHA256_BLK
diff --git a/pkg/devel/git/configs.txt b/pkg/devel/git/configs.txt
@@ -0,0 +1,92 @@
+# 2,<cd src/Documentation && printf '%s\n' *config.txt config/*.txt
+config.txt
+git-config.txt
+config/add.txt
+config/advice.txt
+config/alias.txt
+config/am.txt
+config/apply.txt
+config/blame.txt
+config/branch.txt
+config/browser.txt
+config/bundle.txt
+config/checkout.txt
+config/clean.txt
+config/clone.txt
+config/color.txt
+config/column.txt
+config/commit.txt
+config/commitgraph.txt
+config/completion.txt
+config/core.txt
+config/credential.txt
+config/diff.txt
+config/difftool.txt
+config/extensions.txt
+config/fastimport.txt
+config/feature.txt
+config/fetch.txt
+config/filter.txt
+config/fmt-merge-msg.txt
+config/format.txt
+config/fsck.txt
+config/fsmonitor--daemon.txt
+config/gc.txt
+config/gitcvs.txt
+config/gitweb.txt
+config/gpg.txt
+config/grep.txt
+config/gui.txt
+config/guitool.txt
+config/help.txt
+config/http.txt
+config/i18n.txt
+config/imap.txt
+config/includeif.txt
+config/index.txt
+config/init.txt
+config/instaweb.txt
+config/interactive.txt
+config/log.txt
+config/lsrefs.txt
+config/mailinfo.txt
+config/mailmap.txt
+config/maintenance.txt
+config/man.txt
+config/merge.txt
+config/mergetool.txt
+config/notes.txt
+config/pack.txt
+config/pager.txt
+config/pretty.txt
+config/protocol.txt
+config/pull.txt
+config/push.txt
+config/rebase.txt
+config/receive.txt
+config/remote.txt
+config/remotes.txt
+config/repack.txt
+config/rerere.txt
+config/revert.txt
+config/safe.txt
+config/sendemail.txt
+config/sequencer.txt
+config/showbranch.txt
+config/sparse.txt
+config/splitindex.txt
+config/ssh.txt
+config/stash.txt
+config/status.txt
+config/submodule.txt
+config/tag.txt
+config/tar.txt
+config/trace2.txt
+config/transfer.txt
+config/uploadarchive.txt
+config/uploadpack.txt
+config/url.txt
+config/user.txt
+config/versionsort.txt
+config/web.txt
+config/worktree.txt
diff --git a/pkg/devel/git/fetch.sh b/pkg/devel/git/fetch.sh
@@ -0,0 +1,18 @@
+set -e
+
+sh scripts/fetch-git.sh "$@"
+
+cd "$1"
+shift
+
+if [ -e src/man ] ; then
+ rm -rf src/man
+fi
+
+if ! sh "$OLDPWD/scripts/checksum.sh" -c sha256 2>/dev/null ; then
+ curl -L -O -K url
+ sh "$OLDPWD/scripts/checksum.sh" -c sha256
+fi
+
+read -r _ archive <sha256
+sh "$OLDPWD/scripts/extract.sh" "$archive" -s ',^\.,src/man,'
diff --git a/pkg/devel/git/gen.lua b/pkg/devel/git/gen.lua
@@ -0,0 +1,515 @@
+cflags({
+ '-include $dir/config.h',
+ '-I $srcdir',
+ '-I $srcdir/compat/regex',
+ '-I $outdir',
+ '-isystem $builddir/pkg/net/curl/include',
+ '-isystem $builddir/pkg/libs/zlib/include',
+})
+
+pkg.deps = {
+ '$outdir/command-list.h',
+ '$outdir/config-list.h',
+ '$outdir/hook-list.h',
+ 'pkg/net/curl/headers',
+ 'pkg/libs/zlib/headers',
+}
+
+rule('cmdlist', 'cd $srcdir && ./generate-cmdlist.sh $$OLDPWD/$in >$$OLDPWD/$out')
+build('cmdlist', '$outdir/command-list.h', {
+ '$srcdir/command-list.txt',
+ '|', '$srcdir/generate-cmdlist.sh', expand({'$srcdir/Documentation/', lines('commands.txt')}),
+})
+
+rule('configlist', 'cd $srcdir && ./generate-configlist.sh >$$OLDPWD/$out')
+build('configlist', '$outdir/config-list.h', {
+ '|', '$srcdir/generate-configlist.sh', expand({'$srcdir/Documentation/', lines('configs.txt')}),
+})
+
+rule('hooklist', 'cd $srcdir && ./generate-hooklist.sh >$$OLDPWD/$out')
+build('hooklist', '$outdir/hook-list.h', {
+ '|', '$srcdir/generate-hooklist.sh', '$srcdir/Documentation/githooks.txt'
+})
+
+cc('setup.c', nil, {cflags=string.format(
+ [[$cflags '-D DEFAULT_GIT_TEMPLATE_DIR="%s/share/git-core/templates"']],
+ config.prefix)
+})
+cc('exec-cmd.c', nil, {cflags=string.format(
+ [[$cflags '-DFALLBACK_RUNTIME_PREFIX=""' '-D GIT_EXEC_PATH="%s/libexec/git-core"']],
+ config.prefix)
+})
+cc('common-main.c')
+cc('http.c')
+cc('compat/regex/regex.c', nil, {cflags='$cflags -DGAWK -DNO_MBSUPPORT'})
+
+-- src/Makefile:/^LIB_OBJS.\+=
+lib('libgit.a', [[
+ abspath.c
+ add-interactive.c
+ add-patch.c
+ advice.c
+ alias.c
+ alloc.c
+ apply.c
+ archive-tar.c
+ archive-zip.c
+ archive.c
+ attr.c
+ base85.c
+ bisect.c
+ blame.c
+ blob.c
+ bloom.c
+ branch.c
+ bulk-checkin.c
+ bundle-uri.c
+ bundle.c
+ cache-tree.c
+ cbtree.c
+ chdir-notify.c
+ checkout.c
+ chunk-format.c
+ color.c
+ column.c
+ combine-diff.c
+ commit-graph.c
+ commit-reach.c
+ commit.c
+ compat/nonblock.c
+ compat/obstack.c
+ compat/qsort_s.c
+ compat/regex/regex.c.o
+ compat/terminal.c
+ compat/zlib-uncompress2.c
+ config.c
+ connect.c
+ connected.c
+ convert.c
+ copy.c
+ credential.c
+ csum-file.c
+ ctype.c
+ date.c
+ decorate.c
+ delta-islands.c
+ diagnose.c
+ diff-delta.c
+ diff-merges.c
+ diff-lib.c
+ diff-no-index.c
+ diff.c
+ diffcore-break.c
+ diffcore-delta.c
+ diffcore-order.c
+ diffcore-pickaxe.c
+ diffcore-rename.c
+ diffcore-rotate.c
+ dir-iterator.c
+ dir.c
+ editor.c
+ entry.c
+ environment.c
+ ewah/bitmap.c
+ ewah/ewah_bitmap.c
+ ewah/ewah_io.c
+ ewah/ewah_rlw.c
+ exec-cmd.c.o
+ fetch-negotiator.c
+ fetch-pack.c
+ fmt-merge-msg.c
+ fsck.c
+ fsmonitor.c
+ fsmonitor-ipc.c
+ fsmonitor-settings.c
+ gettext.c
+ git-zlib.c
+ gpg-interface.c
+ graph.c
+ grep.c
+ hash-lookup.c
+ hashmap.c
+ help.c
+ hex.c
+ hook.c
+ ident.c
+ json-writer.c
+ kwset.c
+ levenshtein.c
+ line-log.c
+ line-range.c
+ linear-assignment.c
+ list-objects-filter-options.c
+ list-objects-filter.c
+ list-objects.c
+ lockfile.c
+ log-tree.c
+ ls-refs.c
+ mailinfo.c
+ mailmap.c
+ match-trees.c
+ mem-pool.c
+ merge-blobs.c
+ merge-ll.c
+ merge-ort.c
+ merge-ort-wrappers.c
+ merge-recursive.c
+ merge.c
+ midx.c
+ name-hash.c
+ negotiator/default.c
+ negotiator/noop.c
+ negotiator/skipping.c
+ notes-cache.c
+ notes-merge.c
+ notes-utils.c
+ notes.c
+ object-file.c
+ object-name.c
+ object.c
+ oid-array.c
+ oidmap.c
+ oidset.c
+ oidtree.c
+ pack-bitmap-write.c
+ pack-bitmap.c
+ pack-check.c
+ pack-mtimes.c
+ pack-objects.c
+ pack-revindex.c
+ pack-write.c
+ packfile.c
+ pager.c
+ parallel-checkout.c
+ parse-options-cb.c
+ parse-options.c
+ patch-delta.c
+ patch-ids.c
+ path.c
+ pathspec.c
+ pkt-line.c
+ preload-index.c
+ pretty.c
+ prio-queue.c
+ progress.c
+ promisor-remote.c
+ prompt.c
+ protocol.c
+ protocol-caps.c
+ prune-packed.c
+ quote.c
+ range-diff.c
+ reachable.c
+ read-cache.c
+ rebase-interactive.c
+ rebase.c
+ ref-filter.c
+ reflog-walk.c
+ reflog.c
+ refs.c
+ refs/debug.c
+ refs/files-backend.c
+ refs/iterator.c
+ refs/packed-backend.c
+ refs/ref-cache.c
+ refspec.c
+ remote.c
+ replace-object.c
+ repo-settings.c
+ repository.c
+ rerere.c
+ reset.c
+ resolve-undo.c
+ revision.c
+ run-command.c
+ send-pack.c
+ sequencer.c
+ serve.c
+ server-info.c
+ setup.c.o
+ shallow.c
+ sideband.c
+ sigchain.c
+ sparse-index.c
+ split-index.c
+ stable-qsort.c
+ statinfo.c
+ strbuf.c
+ streaming.c
+ string-list.c
+ strmap.c
+ strvec.c
+ sub-process.c
+ submodule-config.c
+ submodule.c
+ symlinks.c
+ tag.c
+ tempfile.c
+ thread-utils.c
+ tmp-objdir.c
+ trace.c
+ trace2.c
+ trace2/(
+ tr2_cfg.c
+ tr2_cmd_name.c
+ tr2_ctr.c
+ tr2_dst.c
+ tr2_sid.c
+ tr2_sysenv.c
+ tr2_tbuf.c
+ tr2_tgt_event.c
+ tr2_tgt_normal.c
+ tr2_tgt_perf.c
+ tr2_tls.c
+ tr2_tmr.c
+ )
+ trailer.c
+ transport-helper.c
+ transport.c
+ tree-diff.c
+ tree-walk.c
+ tree.c
+ unpack-trees.c
+ upload-pack.c
+ url.c
+ urlmatch.c
+ usage.c
+ userdiff.c
+ utf8.c
+ varint.c
+ version.c
+ versioncmp.c
+ walker.c
+ wildmatch.c
+ worktree.c
+ wrapper.c
+ write-or-die.c
+ ws.c
+ wt-status.c
+ xdiff-interface.c
+
+ unix-socket.c
+ unix-stream-server.c
+
+ compat/simple-ipc/(ipc-shared.c ipc-unix-socket.c)
+
+ sha1dc_git.c
+ sha1dc/sha1.c
+ sha1dc/ubc_check.c
+
+ sha256/block/sha256.c
+
+ compat/linux/procinfo.c
+
+ libxdiff.a
+ $builddir/pkg/libs/zlib/libz.a
+]])
+
+-- src/Makefile:/^XDIFF_OBJS.\+=
+lib('libxdiff.a', [[xdiff/(
+ xdiffi.c
+ xemit.c
+ xhistogram.c
+ xmerge.c
+ xpatience.c
+ xprepare.c
+ xutils.c
+)]])
+
+-- src/Makefile:/^BUILTIN_OBJS.\+=
+local builtins = {
+ 'add',
+ 'am',
+ 'annotate',
+ 'apply',
+ 'archive',
+ 'bisect',
+ 'blame',
+ 'branch',
+ 'bugreport',
+ 'bundle',
+ 'cat-file',
+ 'check-attr',
+ 'check-ignore',
+ 'check-mailmap',
+ 'check-ref-format',
+ 'checkout--worker',
+ 'checkout-index',
+ 'checkout',
+ 'clean',
+ 'clone',
+ 'column',
+ 'commit-graph',
+ 'commit-tree',
+ 'commit',
+ 'config',
+ 'count-objects',
+ 'credential-cache--daemon',
+ 'credential-cache',
+ 'credential-store',
+ 'credential',
+ 'describe',
+ 'diagnose',
+ 'diff-files',
+ 'diff-index',
+ 'diff-tree',
+ 'diff',
+ 'difftool',
+ 'fast-export',
+ 'fast-import',
+ 'fetch-pack',
+ 'fetch',
+ 'fmt-merge-msg',
+ 'for-each-ref',
+ 'for-each-repo',
+ 'fsck',
+ 'fsmonitor--daemon',
+ 'gc',
+ 'get-tar-commit-id',
+ 'grep',
+ 'hash-object',
+ 'hook',
+ 'index-pack',
+ 'init-db',
+ 'interpret-trailers',
+ 'log',
+ 'ls-files',
+ 'ls-remote',
+ 'ls-tree',
+ 'mailinfo',
+ 'mailsplit',
+ 'merge-base',
+ 'merge-file',
+ 'merge-index',
+ 'merge-ours',
+ 'merge-recursive',
+ 'merge-tree',
+ 'merge',
+ 'mktag',
+ 'mktree',
+ 'multi-pack-index',
+ 'mv',
+ 'name-rev',
+ 'notes',
+ 'pack-objects',
+ 'pack-redundant',
+ 'pack-refs',
+ 'patch-id',
+ 'prune-packed',
+ 'prune',
+ 'pull',
+ 'push',
+ 'range-diff',
+ 'read-tree',
+ 'rebase',
+ 'receive-pack',
+ 'reflog',
+ 'remote-ext',
+ 'remote-fd',
+ 'remote',
+ 'repack',
+ 'replace',
+ 'rerere',
+ 'reset',
+ 'rev-list',
+ 'rev-parse',
+ 'revert',
+ 'rm',
+ 'send-pack',
+ 'shortlog',
+ 'show-branch',
+ 'show-index',
+ 'show-ref',
+ 'sparse-checkout',
+ 'stash',
+ 'stripspace',
+ 'submodule--helper',
+ 'symbolic-ref',
+ 'tag',
+ 'unpack-file',
+ 'unpack-objects',
+ 'update-index',
+ 'update-ref',
+ 'update-server-info',
+ 'upload-archive',
+ 'upload-pack',
+ 'var',
+ 'verify-commit',
+ 'verify-pack',
+ 'verify-tag',
+ 'worktree',
+ 'write-tree',
+}
+
+local docdefs = string.format([['-D GIT_INFO_PATH="%s/share/info"' ]]
+ .. [['-D GIT_MAN_PATH="%s/share/man"' ]]
+ .. [['-D GIT_HTML_PATH="%s/share/doc/git-doc"']],
+ config.prefix, config.prefix, config.prefix)
+cc('git.c', nil, {cflags=[[$cflags ]] .. docdefs})
+cc('builtin/help.c', nil, {cflags=[[$cflags ]] .. docdefs})
+
+exe('git', {'git.c.o', 'common-main.c.o', 'builtin/help.c.o', expand({'builtin/', builtins, '.c'}), 'libgit.a.d'})
+file('bin/git', '755', '$outdir/git')
+
+local programs = {
+ -- src/Makefile:/^PROGRAM_OBJS./+=
+ {'daemon'},
+ {'http-backend'},
+ {'imap-send', {'imap-send.c', 'http.c.o', '$builddir/pkg/net/curl/libcurl.a.d'}},
+ {'sh-i18n--envsubst'},
+ {'shell'},
+
+ {'remote-http', {'remote-curl.c', 'http.c.o', 'http-walker.c', '$builddir/pkg/net/curl/libcurl.a.d'}},
+}
+
+for _, prog in ipairs(programs) do
+ local name, srcs = prog[1], prog[2]
+ exe('git-'..name, {srcs or name..'.c', 'common-main.c.o', 'libgit.a.d'})
+ file('libexec/git-core/git-'..name, '755', '$outdir/git-'..name)
+end
+
+for _, remote in ipairs({'https', 'ftp', 'ftps'}) do
+ sym('libexec/git-core/git-remote-'..remote, 'git-remote-http')
+end
+
+local scripts = {
+ -- src/Makefile:/^SCRIPT_SH.\+=
+ {'difftool--helper', '755'},
+ {'filter-branch', '755'},
+ {'merge-octopus', '755'},
+ {'merge-one-file', '755'},
+ {'merge-resolve', '755'},
+ {'mergetool', '755'},
+ {'quiltimport', '755'},
+ {'request-pull', '755'},
+ {'submodule', '755'},
+ {'web--browse', '755'},
+
+ -- src/Makefile:/^SCRIPT_LIB.\+=
+ {'mergetool--lib', '644'},
+ {'sh-i18n', '644'},
+ {'sh-setup', '644'},
+}
+
+rule('sh_gen', 'sed -f $dir/sh_gen.sed $in >$out')
+for _, script in ipairs(scripts) do
+ local name, mode = script[1], script[2]
+ build('sh_gen', '$outdir/git-'..name, {'$srcdir/git-'..name..'.sh', '|', '$dir/sh_gen.sed'})
+ file('libexec/git-core/git-'..name, mode, '$outdir/git-'..name)
+end
+
+sym('bin/git-shell', '../libexec/git-core/git-shell')
+for _, name in ipairs({'git-receive-pack', 'git-upload-archive', 'git-upload-pack'}) do
+ sym('bin/'..name, 'git')
+end
+
+-- templates
+dir('share/git-core/templates/branches', '755')
+file('share/git-core/templates/description', '644', '$srcdir/templates/this--description')
+file('share/git-core/templates/info/exclude', '644', '$srcdir/templates/info--exclude')
+-- Skip the sample hooks and install an empty directory instead.
+dir('share/git-core/templates/hooks', '755')
+
+man(expand({'man/', lines('man.txt')}))
+
+fetch('local')
diff --git a/pkg/devel/git/man.txt b/pkg/devel/git/man.txt
@@ -0,0 +1,196 @@
+# 2,<cd src/man && find man* -name '*.[1-9]' | sort
+man1/git-add.1
+man1/git-am.1
+man1/git-annotate.1
+man1/git-apply.1
+man1/git-archimport.1
+man1/git-archive.1
+man1/git-bisect.1
+man1/git-blame.1
+man1/git-branch.1
+man1/git-bugreport.1
+man1/git-bundle.1
+man1/git-cat-file.1
+man1/git-check-attr.1
+man1/git-check-ignore.1
+man1/git-check-mailmap.1
+man1/git-check-ref-format.1
+man1/git-checkout-index.1
+man1/git-checkout.1
+man1/git-cherry-pick.1
+man1/git-cherry.1
+man1/git-citool.1
+man1/git-clean.1
+man1/git-clone.1
+man1/git-column.1
+man1/git-commit-graph.1
+man1/git-commit-tree.1
+man1/git-commit.1
+man1/git-config.1
+man1/git-count-objects.1
+man1/git-credential-cache--daemon.1
+man1/git-credential-cache.1
+man1/git-credential-store.1
+man1/git-credential.1
+man1/git-cvsexportcommit.1
+man1/git-cvsimport.1
+man1/git-cvsserver.1
+man1/git-daemon.1
+man1/git-describe.1
+man1/git-diagnose.1
+man1/git-diff-files.1
+man1/git-diff-index.1
+man1/git-diff-tree.1
+man1/git-diff.1
+man1/git-difftool.1
+man1/git-fast-export.1
+man1/git-fast-import.1
+man1/git-fetch-pack.1
+man1/git-fetch.1
+man1/git-filter-branch.1
+man1/git-fmt-merge-msg.1
+man1/git-for-each-ref.1
+man1/git-for-each-repo.1
+man1/git-format-patch.1
+man1/git-fsck-objects.1
+man1/git-fsck.1
+man1/git-fsmonitor--daemon.1
+man1/git-gc.1
+man1/git-get-tar-commit-id.1
+man1/git-grep.1
+man1/git-gui.1
+man1/git-hash-object.1
+man1/git-help.1
+man1/git-hook.1
+man1/git-http-backend.1
+man1/git-http-fetch.1
+man1/git-http-push.1
+man1/git-imap-send.1
+man1/git-index-pack.1
+man1/git-init-db.1
+man1/git-init.1
+man1/git-instaweb.1
+man1/git-interpret-trailers.1
+man1/git-log.1
+man1/git-ls-files.1
+man1/git-ls-remote.1
+man1/git-ls-tree.1
+man1/git-mailinfo.1
+man1/git-mailsplit.1
+man1/git-maintenance.1
+man1/git-merge-base.1
+man1/git-merge-file.1
+man1/git-merge-index.1
+man1/git-merge-one-file.1
+man1/git-merge-tree.1
+man1/git-merge.1
+man1/git-mergetool--lib.1
+man1/git-mergetool.1
+man1/git-mktag.1
+man1/git-mktree.1
+man1/git-multi-pack-index.1
+man1/git-mv.1
+man1/git-name-rev.1
+man1/git-notes.1
+man1/git-p4.1
+man1/git-pack-objects.1
+man1/git-pack-redundant.1
+man1/git-pack-refs.1
+man1/git-patch-id.1
+man1/git-prune-packed.1
+man1/git-prune.1
+man1/git-pull.1
+man1/git-push.1
+man1/git-quiltimport.1
+man1/git-range-diff.1
+man1/git-read-tree.1
+man1/git-rebase.1
+man1/git-receive-pack.1
+man1/git-reflog.1
+man1/git-remote-ext.1
+man1/git-remote-fd.1
+man1/git-remote.1
+man1/git-repack.1
+man1/git-replace.1
+man1/git-request-pull.1
+man1/git-rerere.1
+man1/git-reset.1
+man1/git-restore.1
+man1/git-rev-list.1
+man1/git-rev-parse.1
+man1/git-revert.1
+man1/git-rm.1
+man1/git-send-email.1
+man1/git-send-pack.1
+man1/git-sh-i18n--envsubst.1
+man1/git-sh-i18n.1
+man1/git-sh-setup.1
+man1/git-shell.1
+man1/git-shortlog.1
+man1/git-show-branch.1
+man1/git-show-index.1
+man1/git-show-ref.1
+man1/git-show.1
+man1/git-sparse-checkout.1
+man1/git-stage.1
+man1/git-stash.1
+man1/git-status.1
+man1/git-stripspace.1
+man1/git-submodule.1
+man1/git-svn.1
+man1/git-switch.1
+man1/git-symbolic-ref.1
+man1/git-tag.1
+man1/git-unpack-file.1
+man1/git-unpack-objects.1
+man1/git-update-index.1
+man1/git-update-ref.1
+man1/git-update-server-info.1
+man1/git-upload-archive.1
+man1/git-upload-pack.1
+man1/git-var.1
+man1/git-verify-commit.1
+man1/git-verify-pack.1
+man1/git-verify-tag.1
+man1/git-version.1
+man1/git-web--browse.1
+man1/git-whatchanged.1
+man1/git-worktree.1
+man1/git-write-tree.1
+man1/git.1
+man1/gitk.1
+man1/gitweb.1
+man1/scalar.1
+man5/gitattributes.5
+man5/gitformat-bundle.5
+man5/gitformat-chunk.5
+man5/gitformat-commit-graph.5
+man5/gitformat-index.5
+man5/gitformat-pack.5
+man5/gitformat-signature.5
+man5/githooks.5
+man5/gitignore.5
+man5/gitmailmap.5
+man5/gitmodules.5
+man5/gitprotocol-capabilities.5
+man5/gitprotocol-common.5
+man5/gitprotocol-http.5
+man5/gitprotocol-pack.5
+man5/gitprotocol-v2.5
+man5/gitrepository-layout.5
+man5/gitweb.conf.5
+man7/gitcli.7
+man7/gitcore-tutorial.7
+man7/gitcredentials.7
+man7/gitcvs-migration.7
+man7/gitdiffcore.7
+man7/giteveryday.7
+man7/gitfaq.7
+man7/gitglossary.7
+man7/gitnamespaces.7
+man7/gitremote-helpers.7
+man7/gitrevisions.7
+man7/gitsubmodules.7
+man7/gittutorial-2.7
+man7/gittutorial.7
+man7/gitworkflows.7
diff --git a/pkg/devel/git/patch/0001-request-pull-use-awk-instead-of-perl-to-parse-ls-rem.patch b/pkg/devel/git/patch/0001-request-pull-use-awk-instead-of-perl-to-parse-ls-rem.patch
@@ -0,0 +1,84 @@
+From 1b87b640fac0fa52de5da8d2c57d038cc0cef5b1 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 16 Mar 2021 17:21:31 -0700
+Subject: [PATCH] request-pull: use awk instead of perl to parse ls-remote
+ output
+
+---
+ git-request-pull.sh | 48 +++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 19 deletions(-)
+
+diff --git a/git-request-pull.sh b/git-request-pull.sh
+index 2d0e44656c..0e3cf644e0 100755
+--- a/git-request-pull.sh
++++ b/git-request-pull.sh
+@@ -82,37 +82,47 @@ die "fatal: No commits in common between $base and $head"
+ # Find a ref with the same name as $head that exists at the remote
+ # and points to the same commit as the local object.
+ find_matching_ref='
+- my ($head,$headrev) = (@ARGV);
+- my $pattern = qr{/\Q$head\E$};
+- my ($remote_sha1, $found);
++ function endswith(s, t) {
++ n = length(s)
++ m = length(t)
++ return m <= n && substr(s, n - m + 1) == t
++ }
+
+- while (<STDIN>) {
+- chomp;
+- my ($sha1, $ref, $deref) = /^(\S+)\s+([^^]+)(\S*)$/;
++ {
++ sha1 = $1
++ ref = $2
+
+- if ($sha1 eq $head) {
+- $found = $remote_sha1 = $sha1;
+- break;
++ if (sha1 == head) {
++ found = remote_sha1 = sha1
++ exit
+ }
+
+- if ($ref eq $head || $ref =~ $pattern) {
+- if ($deref eq "") {
++ deref = index(ref, "^")
++ if (deref)
++ ref = substr(ref, 1, deref - 1)
++
++ if (ref == head || endswith(ref, "/" head)) {
++ if (!deref) {
+ # Remember the matching object on the remote side
+- $remote_sha1 = $sha1;
++ remote_sha1 = sha1
+ }
+- if ($sha1 eq $headrev) {
+- $found = $ref;
+- break;
++ if (sha1 == headrev) {
++ found = ref
++ exit
+ }
+ }
+ }
+- if ($found) {
+- $remote_sha1 = $headrev if ! defined $remote_sha1;
+- print "$remote_sha1 $found\n";
++
++ END {
++ if (found) {
++ if (!remote_sha1)
++ remote_sha1 = headrev
++ print remote_sha1 " " found
++ }
+ }
+ '
+
+-set fnord $(git ls-remote "$url" | @@PERL@@ -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
++set fnord $(git ls-remote "$url" | awk -v "head=${remote:-HEAD}" -v "headrev=$headrev" "$find_matching_ref")
+ remote_sha1=$2
+ ref=$3
+
+--
+2.34.0
+
diff --git a/pkg/devel/git/sh_gen.sed b/pkg/devel/git/sh_gen.sed
@@ -0,0 +1,8 @@
+s|@SHELL_PATH@|/bin/sh|
+s|@@DIFF@@|diff|
+s|@@LOCALEDIR@@|/share/locale|g
+s|@@USE_GETTEXT_SCHEME@@||g
+/^\# @@BROKEN_PATH_FIX@@$/d
+s|@@GITWEBDIR@@|/share/gitweb|g
+s|@@PERL@@|/bin/perl|g
+s|@@PAGER_ENV@@|LESS=FRX LV=-c|g
diff --git a/pkg/devel/git/sha256 b/pkg/devel/git/sha256
@@ -0,0 +1 @@
+51643c53d70ce15dde83b6da2bad76ba0c7bbcd4f944d7c378f03a15b9f2e1de git-manpages-2.42.0.tar.gz
diff --git a/pkg/devel/git/src b/pkg/devel/git/src
@@ -0,0 +1 @@
+Subproject commit 43c8a30d150ecede9709c1f2527c8fba92c65f40
diff --git a/pkg/devel/git/url b/pkg/devel/git/url
@@ -0,0 +1 @@
+url = "https://www.kernel.org/pub/software/scm/git/git-manpages-2.42.0.tar.gz"
diff --git a/pkg/devel/git/ver b/pkg/devel/git/ver
@@ -0,0 +1 @@
+2.37.3 r0
diff --git a/sets.lua b/sets.lua
@@ -4,6 +4,7 @@ S.bin = {
'awk',
'cmark',
'curl',
+ 'git',
'hyx',
'man-pages-posix',
'mandoc',