From 543d0e81a54f8285d74a7f8ff59596ec3e901a57 Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Thu, 4 Sep 2014 14:55:18 +1000 Subject: [PATCH] Automatically initialize git when finished. PBR will refuse to work or allow users to run tests until there is a git repository set up. It is easier to just do this automatically than have to explain it in the docs. Change-Id: Ied9ccab2665c4542e2ec2ee42174c3e15e166880 --- README.rst | 6 ++++-- hooks/post_gen_project.sh | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 hooks/post_gen_project.sh diff --git a/README.rst b/README.rst index 3515956..5f750dd 100644 --- a/README.rst +++ b/README.rst @@ -19,8 +19,10 @@ Generate a Python package project:: cookiecutter https://git.openstack.org/openstack-dev/cookiecutter.git -OpenStack projects require a working git repo for pbr to work, so you need to -init a repo and commit to it before doing anything else:: +OpenStack projects require a working git repo for pbr to work, on newer +versions of cookiecutter (>= 0.7.0 released 2013-11-09) this inital commit will +be done automatically. Otherwise you will need to init a repo and commit to it +before doing anything else:: cd $repo_name git init diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh new file mode 100755 index 0000000..4fe45be --- /dev/null +++ b/hooks/post_gen_project.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +git init +git add . +git commit -a -m "Initial Cookiecutter Commit."