about summary refs log tree commit diff
path: root/third_party/git/contrib/fast-import/import-zips.py
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/contrib/fast-import/import-zips.py
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/contrib/fast-import/import-zips.py')
-rwxr-xr-xthird_party/git/contrib/fast-import/import-zips.py78
1 files changed, 0 insertions, 78 deletions
diff --git a/third_party/git/contrib/fast-import/import-zips.py b/third_party/git/contrib/fast-import/import-zips.py
deleted file mode 100755
index d12c2962230b..000000000000
--- a/third_party/git/contrib/fast-import/import-zips.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-
-## zip archive frontend for git-fast-import
-##
-## For example:
-##
-##  mkdir project; cd project; git init
-##  python import-zips.py *.zip
-##  git log --stat import-zips
-
-from os import popen, path
-from sys import argv, exit, hexversion, stderr
-from time import mktime
-from zipfile import ZipFile
-
-if hexversion < 0x01060000:
-    # The limiter is the zipfile module
-    stderr.write("import-zips.py: requires Python 1.6.0 or later.\n")
-    exit(1)
-
-if len(argv) < 2:
-    print 'usage:', argv[0], '<zipfile>...'
-    exit(1)
-
-branch_ref = 'refs/heads/import-zips'
-committer_name = 'Z Ip Creator'
-committer_email = 'zip@example.com'
-
-fast_import = popen('git fast-import --quiet', 'w')
-def printlines(list):
-    for str in list:
-        fast_import.write(str + "\n")
-
-for zipfile in argv[1:]:
-    commit_time = 0
-    next_mark = 1
-    common_prefix = None
-    mark = dict()
-
-    zip = ZipFile(zipfile, 'r')
-    for name in zip.namelist():
-        if name.endswith('/'):
-            continue
-        info = zip.getinfo(name)
-
-        if commit_time < info.date_time:
-            commit_time = info.date_time
-        if common_prefix == None:
-            common_prefix = name[:name.rfind('/') + 1]
-        else:
-            while not name.startswith(common_prefix):
-                last_slash = common_prefix[:-1].rfind('/') + 1
-                common_prefix = common_prefix[:last_slash]
-
-        mark[name] = ':' + str(next_mark)
-        next_mark += 1
-
-        printlines(('blob', 'mark ' + mark[name], \
-                    'data ' + str(info.file_size)))
-        fast_import.write(zip.read(name) + "\n")
-
-    committer = committer_name + ' <' + committer_email + '> %d +0000' % \
-        mktime(commit_time + (0, 0, 0))
-
-    printlines(('commit ' + branch_ref, 'committer ' + committer, \
-        'data <<EOM', 'Imported from ' + zipfile + '.', 'EOM', \
-        '', 'deleteall'))
-
-    for name in mark.keys():
-        fast_import.write('M 100644 ' + mark[name] + ' ' +
-            name[len(common_prefix):] + "\n")
-
-    printlines(('',  'tag ' + path.basename(zipfile), \
-        'from ' + branch_ref, 'tagger ' + committer, \
-        'data <<EOM', 'Package ' + zipfile, 'EOM', ''))
-
-if fast_import.close():
-    exit(1)