[m-dev.] Source dist. archives on github

Peter Wang novalazy at gmail.com
Tue Jan 29 17:27:11 AEDT 2019


On Tue, 29 Jan 2019 17:01:58 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> 
> 
> On Tue, 29 Jan 2019 00:20:10 +0000 (UTC), Julien Fischer <jfischer at opturion.com> wrote:
> > Peter and I have been discussing hosting the source distributions
> > on github in addition to distributing as .tar.gz files.  The basic
> > idea is that there will be a new repository on github and each all
> > the files for the source distribution will be committed to it.
> > Specifically, each source distribution will just be a tagged commit
> > off an empty initial commit.  This should allows us to provide
> > a much more extensive archive of source distributions.
> 
> I am not sure I understand *exactly* what you are proposing. What does
> "off an empty initial commit" mean?

The repository will be created with an initial commit that adds no
files:

    mkdir mercury-release-archive
    cd mercury-release-archive
    git init
    git commit --allow-empty -m 'Initial commit'

Every release will then be imported as a single commit, with that empty
commit as the parent (see the attached script). Historical releases can
be imported in any order.

There will also be a master branch containing a README.

Peter
-------------- next part --------------
#!/bin/sh
set -eu

archive=$1
test -f "$archive" || exit 1
basename=$(basename "$archive" .tar.gz)
version=${basename#mercury-*-}
tag=$version

# sanity check
case $version in
    rotd-20??-??-??*) ;;
    ??.??*) ;;
    *)
	echo "unexpected version $version" >&1
	exit 1
	;;
esac

initialcommit=$( git rev-list --max-parents=0 HEAD | tail -n 1 )
git checkout --detach "$initialcommit"
git clean -fdxq .
tar xf "$archive" --strip-components=1
git add .
git commit -q -m "Imported $basename"
git tag -a -m "Tag $version" "$tag"
#git push ...


More information about the developers mailing list