Re: Of Branches and pages

2011-02-25 Thread Chris Wanstrath
Not sure if this helps but I heard github-tools has ways to auto generate a 
gh-pages branch using sphinx:

 http://dinoboff.github.com/github-tools/

On Feb 25, 2011, at 9:25 AM, Adam Faulconbridge afaulconbri...@googlemail.com 
wrote:

 Hello. I've been looking for a solution to a problem, but can't seem to find 
 one. I am new to git, so may be missing something.
 
 * I have a project hosted on GitHub
 * The code is in the master branch.
 * I also have web pages in the gh-pages branch.
 * The documentation is auto-generated from the code (in this case by Sphinx 
 (http://sphinx.pocoo.org/), but it doesn't really matter how.) and this 
 includes a HTML version.
 * I want the html auto-generated documentation to be in the gh-pages branch 
 so that it is published to the web.
 * I do not want anything else to be in the gh-pages branch.
 * I want to be able to generate new documentation from the master branch 
 code and put it in the gh-pages branch for publication.
 * How do I do this?
 
 I've tried using cherry-pick but that looks for specific commits which isn't 
 what I want and is fiddly to use.
 
 I've tried using different .gitignore and excludesfiles configurations, but 
 cant get it to apply to one branch (as described 
 http://cogniton-mind.tumblr.com/post/1423976659/howto-gitignore-for-different-branches)
 
 I've tried using git pull to pull copies of the documentation into the 
 gh-pages branch from the master branch, but that doesn't keep history.
 
 I could set up two local repositories and have a script copy things from one 
 to the other, but that seems inelegant to me.
 
 
 Any other suggestions / tips? Wouldn't think this would be too unusual a 
 workflow.
 -- 
 You received this message because you are subscribed to the Google Groups 
 GitHub group.
 To post to this group, send email to github@googlegroups.com.
 To unsubscribe from this group, send email to 
 github+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/github?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
GitHub group.
To post to this group, send email to github@googlegroups.com.
To unsubscribe from this group, send email to 
github+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.



Re: Of Branches and pages

2011-02-25 Thread Paul Miller


On Feb 25, 1:22 pm, Jeremiah Dodds jeremiah.do...@gmail.com wrote:
 What about a submodule?  http://book.git-scm.com/5_submodules.html

Personally, I'm rarely interested in keeping the deltas on autogen
pages...

I've been using something like this in my makefile (similar anyway,
the below is not tested):

git checkout -b _docs
git add -f doc-directory
git commit -m docs
git filter-branch --prune-empty --subdirectory-filter doc-directory
git symbolic-ref HEAD refs/heads/gh-pages
git push github -f _docs:gh-pages
git checkout master
git branch -D _docs

That way there's really only ever one commit in my gh-pages and I can
build it from my makefile

-- 
You received this message because you are subscribed to the Google Groups 
GitHub group.
To post to this group, send email to github@googlegroups.com.
To unsubscribe from this group, send email to 
github+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.



Re: Of Branches and pages

2011-02-25 Thread Roban
I use a trick I got from this page:
http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/

You keep all of the gh-pages content in a directory in the master
branch, from which it is copied to the gh-pages branch.

I just run this script after I've updated the contents of the www/
directory:

https://github.com/roban/CosmoloPy/blob/master/commit_www.bash

The only problem I have with this system is remembering to run the the
script before I push to github.

-Roban

On Feb 25, 6:25 pm, Adam Faulconbridge afaulconbri...@googlemail.com
wrote:
 Hello. I've been looking for a solution to a problem, but can't seem to find
 one. I am new to git, so may be missing something.

 * I have a project hosted on GitHub
 * The code is in the master branch.
 * I also have web pages in the gh-pages branch.
 * The documentation is auto-generated from the code (in this case by Sphinx
 (http://sphinx.pocoo.org/), but it doesn't really matter how.) and this
 includes a HTML version.
 * I want the html auto-generated documentation to be in the gh-pages
 branch so that it is published to the web.
 * I do not want anything else to be in the gh-pages branch.
 * I want to be able to generate new documentation from the master branch
 code and put it in the gh-pages branch for publication.
 * How do I do this?

 I've tried using cherry-pick but that looks for specific commits which isn't
 what I want and is fiddly to use.

 I've tried using different .gitignore and excludesfiles configurations, but
 cant get it to apply to one branch (as 
 describedhttp://cogniton-mind.tumblr.com/post/1423976659/howto-gitignore-for-d...
 )

 I've tried using git pull to pull copies of the documentation into the
 gh-pages branch from the master branch, but that doesn't keep history.

 I could set up two local repositories and have a script copy things from one
 to the other, but that seems inelegant to me.

 Any other suggestions / tips? Wouldn't think this would be too unusual a
 workflow.

-- 
You received this message because you are subscribed to the Google Groups 
GitHub group.
To post to this group, send email to github@googlegroups.com.
To unsubscribe from this group, send email to 
github+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.



Re: Of Branches and pages

2011-02-25 Thread Diego Zamboni

* How do I do this?
...
I could set up two local repositories and have a script copy things 
from one to the other, but that seems inelegant to me.
I have a project that does something like this, where parts of the web 
page are generated from the code (http://zzamboni.org/grabcartoons/). I 
make use of the fact that untracked files stay in the directory when you 
switch branches, to copy files from one to the other. Here's the 
relevant target from my Makefile:


# Update the web pages branch. For developer use only
updweb:
./grabcartoons.pl --htmllist  lom.html
./grabcartoons.pl --templates | perl -pe 's!(\S+\.com)!a 
href=http://$$1/;$$1/a!'  templates.txt

./grabcartoons.pl --help | sed '/default: /d'  usage.txt
./grabcartoons.pl --version | sed 's/^GrabCartoons version //' 
 version.txt

git co gh-pages
mv lom.html templates.txt usage.txt version.txt _includes
@echo ### You are now in the gh-pages branch. Please review 
and commit changes ###


So I generate the appropriate files, switch to the gh-pages branch 
(which leaves those files there, because they are untracked in both 
branches), and after the switch move them to the _includes directory 
(where they are tracked in the gh-pages branch). just for manual review 
and check-in.


It's crude, but at least for a simple case like this, it works quite well.

--Diego

--
You received this message because you are subscribed to the Google Groups 
GitHub group.
To post to this group, send email to github@googlegroups.com.
To unsubscribe from this group, send email to 
github+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.



Re: Of Branches and pages

2011-02-25 Thread trans
I use a Ruby tool called Grancher. Maybe you could port it to Python.

-- 
You received this message because you are subscribed to the Google Groups 
GitHub group.
To post to this group, send email to github@googlegroups.com.
To unsubscribe from this group, send email to 
github+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.



Re: Of Branches and pages

2011-02-25 Thread Dustin

On Feb 25, 12:16 pm, Paul Miller jett...@gmail.com wrote:
 On Feb 25, 1:22 pm, Jeremiah Dodds jeremiah.do...@gmail.com wrote:

  What about a submodule?  http://book.git-scm.com/5_submodules.html

 Personally, I'm rarely interested in keeping the deltas on autogen
 pages...

 I've been using something like this in my makefile (similar anyway,
 the below is not tested):

 git checkout -b _docs
 git add -f doc-directory
 git commit -m docs
 git filter-branch --prune-empty --subdirectory-filter doc-directory
 git symbolic-ref HEAD refs/heads/gh-pages
 git push github -f _docs:gh-pages
 git checkout master
 git branch -D _docs

  I wrote this for gh-pages without history:
https://github.com/dustin/bindir/blob/master/git-baseless-commit

-- 
You received this message because you are subscribed to the Google Groups 
GitHub group.
To post to this group, send email to github@googlegroups.com.
To unsubscribe from this group, send email to 
github+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/github?hl=en.