← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~larsks/cloud-init:feature/move-to-git into cloud-init:master

 

Lars Kellogg-Stedman has proposed merging ~larsks/cloud-init:feature/move-to-git into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~larsks/cloud-init/+git/cloud-init/+merge/300953

This is set of changes for moving cloud-init from bzr to git.
-- 
Your team cloud init development team is requested to review the proposed merge of ~larsks/cloud-init:feature/move-to-git into cloud-init:master.
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f8b0f3e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+.tox
+dist
+cloud_init.egg-info
+__pycache__
+build
diff --git a/HACKING.rst b/HACKING.rst
index 6bfe4b4..63a5bde 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -2,47 +2,71 @@
 Hacking on cloud-init
 =====================
 
-To get changes into cloud-init, the process to follow is:
+This document describes how to contribute changes to cloud-init.
+
+Do these things once
+--------------------
 
 * If you have not already, be sure to sign the CCA:
 
   - `Canonical Contributor Agreement`_
 
-* Get your changes into a local bzr branch.
-  Initialize a repo, and checkout trunk (init repo is to share bzr info across multiple checkouts, its different than git):
+* Clone the `LaunchPad`_ repository:
+
+    git clone YOUR_USERNAME@xxxxxxxxxxxxxxxxx:cloud-init
+    cd cloud-init
+
+  If you would prefer a bzr style `git clone lp:cloud-init`, see
+  the `Instructions on LaunchPad`_ for more information.
 
-  - ``bzr init-repo cloud-init``
-  - ``bzr branch lp:cloud-init trunk.dist``
-  - ``bzr branch trunk.dist my-topic-branch``
+* Create a new remote pointing to your personal LaunchPad
+  repository::
+
+    git remote add YOUR_USERNAME YOUR_USERNAME@xxxxxxxxxxxxxxxxx:~YOUR_USERNAME/cloud-init
+
+.. _Canonical Contributor Agreement: http://www.canonical.com/contributors
 
-* Commit your changes (note, you can make multiple commits, fixes, more commits.):
+Do these things for each feature or bug
+---------------------------------------
 
-  - ``bzr commit``
+* Create a new topic branch for your work::
 
-* Check pep8 and test, and address any issues:
+    git checkout -b my-topic-branch
 
-  - ``make test pep8``
+.. _Instructions on launchpad: https://help.launchpad.net/Code/Git
 
-* Push to launchpad to a personal branch:
+* Make and commit your changes (note, you can make multiple commits,
+  fixes, more commits.)::
 
-  - ``bzr push lp:~<YOUR_USERNAME>/cloud-init/<BRANCH_NAME>``
+    git commit
 
-* Propose that for a merge into lp:cloud-init via web browser.
+* Check pep8 and test, and address any issues::
 
-  - Open the branch in `Launchpad`_
+    make test pep8
 
-    - It will typically be at ``https://code.launchpad.net/<YOUR_USERNAME>/<PROJECT>/<BRANCH_NAME>``
-    - ie. https://code.launchpad.net/~smoser/cloud-init/mybranch
+* Push your changes to your personal LaunchPad repository::
 
-* Click 'Propose for merging'
-* Select 'lp:cloud-init' as the target branch
+    git push -u YOUR_USERNAME my-topic-branch
 
-Then, someone on cloud-init-dev (currently `Scott Moser`_ and `Joshua Harlow`_) will 
-review your changes and follow up in the merge request.
+* Use your browser to create a merge request:
 
-Feel free to ping and/or join #cloud-init on freenode (irc) if you have any questions.
+  - Open the branch on `LaunchPad`_
+
+    - It will typically be at
+      ``https://code.launchpad.net/~YOUR_USERNAME/cloud-init/+git/cloud-init/+ref/BRANCHNAME``
+      for example
+      https://code.launchpad.net/~larsks/cloud-init/+git/cloud-init/+ref/feature/move-to-git
+
+  - Click 'Propose for merging`
+  - Select ``cloud-init`` as the target repository
+  - Select ``master`` as the target reference path
+
+Then, someone on cloud-init-dev (currently `Scott Moser`_ and `Joshua
+Harlow`_) will review your changes and follow up in the merge request.
+
+Feel free to ping and/or join ``#cloud-init`` on freenode (irc) if you
+have any questions.
 
 .. _Launchpad: https://launchpad.net
-.. _Canonical Contributor Agreement: http://www.canonical.com/contributors
 .. _Scott Moser: https://launchpad.net/~smoser
 .. _Joshua Harlow: https://launchpad.net/~harlowja
diff --git a/MANIFEST.in b/MANIFEST.in
index 90f6c7d..9426464 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,5 +4,7 @@ graft tools
 prune build
 prune dist
 prune .tox
+prune .git
 prune .bzr
+exclude .gitignore
 exclude .bzrignore
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..e56e663
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,15 @@
+Cloud-init
+==========
+
+Cloud-init is the defacto multi-distribution package that handles
+early initialization of a cloud instance.
+
+The package is hosted at <https://github.com/cloud-init/cloud-init/>.
+
+Additional documentation can be found in the `doc/` subdirectory.
+
+Contributing
+------------
+
+For information about how to contribute to cloud-init development, see
+the file ``HACKING.rst`` included in this distribution.
diff --git a/tools/make-dist-tarball b/tools/make-dist-tarball
deleted file mode 100755
index 5b07851..0000000
--- a/tools/make-dist-tarball
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-Usage() {
-   cat <<EOF
-Usage: ${0##*/} version
-   make a tarball of 'version'
-   must be in a bzr directory, and 'version' must be a tag
-
-EOF
-}
-
-topdir="$PWD"
-tag="$1"
-
-[ -n "$tag" ] || { Usage 1>&2 ; exit 1; }
-
-out="${topdir}/cloud-init-${tag}.tar.gz"
-
-bzr export --format=tgz --root="cloud-init-$tag" \
-    "--revision=tag:${tag}" "$out" "$topdir" &&
-    echo "Wrote ${out}"
diff --git a/tools/make-tarball b/tools/make-tarball
index b703915..ac9129f 100755
--- a/tools/make-tarball
+++ b/tools/make-tarball
@@ -1,39 +1,24 @@
 #!/bin/sh
 set -e
 
-find_root() {
-   local topd
-   if [ -z "${CLOUD_INIT_TOP_D}" ]; then
-      topd=$(cd "$(dirname "${0}")" && cd .. && pwd)
-   else
-      topd=$(cd "${CLOUD_INIT_TOP_D}" && pwd)
-   fi
-   [ $? -eq 0 -a -f "${topd}/setup.py" ] || return
-   ROOT_DIR="$topd"
-}
-
-if ! find_root; then
-    echo "Unable to locate 'setup.py' file that should" \
-          "exist in the cloud-init root directory." 1>&2
-    exit 1;
-fi
-
-REVNO=$(bzr revno "$ROOT_DIR")
-
-if [ ! -z "$1" ]; then
-    ARCHIVE_FN="$1"
+rev=${1:-HEAD}
+if [ "$rev" = HEAD ]; then
+    revname=$(git describe --tags)
 else
-    VERSION=$("$ROOT_DIR/tools/read-version")
-    ARCHIVE_FN="$PWD/cloud-init-$VERSION~bzr$REVNO.tar.gz"
+    revname="$rev"
 fi
 
-export_uncommitted=""
-if [ "${UNCOMMITTED:-0}" != "0" ]; then
-   export_uncommitted="--uncommitted"
+archive_prefix="cloud-init-$revname"
+archive_name="$archive_prefix.tar.gz"
+
+if [ "$rev" = HEAD ] && ! git diff-index --quiet HEAD --; then
+    echo "ERROR: There are uncommitted changes." >&2
+    exit 1
 fi
 
-bzr export ${export_uncommitted} \
-   --format=tgz --root="cloud-init-$VERSION~bzr$REVNO" \
-    "--revision=${REVNO}" "${ARCHIVE_FN}" "$ROOT_DIR"
+git archive \
+    --format=tar \
+    --prefix "$archive_prefix/" $rev |
+    gzip > $archive_name
 
-echo "$ARCHIVE_FN"
+echo $archive_name
diff --git a/tools/read-dependencies b/tools/read-dependencies
index 6a6f3e1..1cc78f3 100755
--- a/tools/read-dependencies
+++ b/tools/read-dependencies
@@ -1,29 +1,5 @@
-#!/usr/bin/env python
+#!/bin/sh
 
-import os
-import re
-import sys
-
-if 'CLOUD_INIT_TOP_D' in os.environ:
-    topd = os.path.realpath(os.environ.get('CLOUD_INIT_TOP_D'))
-else:
-    topd = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-
-for fname in ("setup.py", "requirements.txt"):
-    if not os.path.isfile(os.path.join(topd, fname)):
-        sys.stderr.write("Unable to locate '%s' file that should "
-                         "exist in cloud-init root directory." % fname)
-        sys.exit(1)
-
-if len(sys.argv) > 1:
-   reqfile = sys.argv[1]
-else:
-   reqfile = "requirements.txt"
-   
-with open(os.path.join(topd, reqfile), "r") as fp:
-    for line in fp:
-        if not line.strip() or line.startswith("#"):
-            continue
-        sys.stdout.write(re.split("[>=.<]*", line)[0].strip() + "\n")
-
-sys.exit(0)
+cd $(git rev-parse --show-toplevel)
+egrep -v '^$|^#' requirements.txt |
+    sed 's/;.*//'
diff --git a/tools/read-version b/tools/read-version
index d02651e..18aebf1 100755
--- a/tools/read-version
+++ b/tools/read-version
@@ -1,26 +1,3 @@
-#!/usr/bin/env python
+#!/bin/sh
 
-import os
-import re
-import sys
-
-if 'CLOUD_INIT_TOP_D' in os.environ:
-    topd = os.path.realpath(os.environ.get('CLOUD_INIT_TOP_D'))
-else:
-    topd = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-
-for fname in ("setup.py", "ChangeLog"):
-    if not os.path.isfile(os.path.join(topd, fname)):
-        sys.stderr.write("Unable to locate '%s' file that should "
-                         "exist in cloud-init root directory." % fname)
-        sys.exit(1)
-
-vermatch = re.compile(r"^[0-9]+[.][0-9]+[.][0-9]+:$")
-
-with open(os.path.join(topd, "ChangeLog"), "r") as fp:
-    for line in fp:
-        if vermatch.match(line):
-            sys.stdout.write(line.strip()[:-1] + "\n")
-            break
-
-sys.exit(0)
+git describe --tags

Follow ups