diff --git a/docs/Makefile b/docs/Makefile index f835fdf..5d34cb7 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -133,7 +133,10 @@ nightly: dist rsync -avH --delete dist/ ipython:www/doc/nightly gh-pages: clean html - python gh-pages.py + # if VERSION is unspecified, it will be dev + # For releases, VERSION should be just the major version, + # e.g. VERSION=2 make gh-pages + python gh-pages.py $(VERSION) texinfo: mkdir -p $(BUILDDIR)/texinfo diff --git a/docs/gh-pages.py b/docs/gh-pages.py index de50269..3294bf8 100755 --- a/docs/gh-pages.py +++ b/docs/gh-pages.py @@ -82,10 +82,7 @@ if __name__ == '__main__': try: tag = sys.argv[1] except IndexError: - try: - tag = sh2('git describe --exact-match') - except CalledProcessError: - tag = "dev" # Fallback + tag = "dev" startdir = os.getcwdu() if not os.path.exists(pages_dir): @@ -117,8 +114,7 @@ if __name__ == '__main__': try: cd(pages_dir) - status = sh2('git status | head -1') - branch = re.match('\# On branch (.*)$', status).group(1) + branch = sh2('git rev-parse --abbrev-ref HEAD').strip() if branch != 'gh-pages': e = 'On %r, git branch is %r, MUST be "gh-pages"' % (pages_dir, branch)