diff options
author | Joey Hess <joey@kitenet.net> | 2007-11-27 00:34:17 -0500 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2007-11-27 00:34:17 -0500 |
commit | 491847ed5311123b3ce58c636451c56a2a0f191b (patch) | |
tree | c5489bec4a7b0e6cf08c0b943d8506d7810dcb7d /doc | |
parent | 892c981f47cf23e5d88d6849e9c628657dcdceef (diff) | |
download | ikiwiki-491847ed5311123b3ce58c636451c56a2a0f191b.tar ikiwiki-491847ed5311123b3ce58c636451c56a2a0f191b.tar.gz |
* Add a new ikiwiki-makerepo program, that automates setting up a repo
and importing existing content for svn, git, and mercurial. This makes
the setup process much simpler.
* Reorganised git documentation.
* Actually install the ikiwiki-update-wikilist program.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ikiwiki-makerepo.mdwn | 23 | ||||
-rw-r--r-- | doc/rcs/git.mdwn | 23 | ||||
-rw-r--r-- | doc/setup.mdwn | 67 | ||||
-rw-r--r-- | doc/setup/git_pitfalls.mdwn | 22 |
4 files changed, 58 insertions, 77 deletions
diff --git a/doc/ikiwiki-makerepo.mdwn b/doc/ikiwiki-makerepo.mdwn new file mode 100644 index 000000000..19f891d0e --- /dev/null +++ b/doc/ikiwiki-makerepo.mdwn @@ -0,0 +1,23 @@ +# NAME + +ikiwiki-makerepo - check an ikiwiki srcdir into revision control + +# SYNOPSIS + +ikiwiki-makerepo svn|git srcdir repository +ikiwiki-makerepo mercurial srcdir + +# DESCRIPTION + +`ikiwiki-makerepo` injects a `srcdir` directory, containing an ikiwiki wiki, +into a `repository` that it creates. The repository can be a svn, git, or +mercurial repository. + +Note that for mercurial, the srcdir is converted into a mercurial +repository. There is no need to have a separate repository with mercurial. + +# AUTHOR + +Joey Hess <joey@ikiwiki.info> + +Warning: this page is automatically made into ikiwiki-makerepo's man page, edit with care diff --git a/doc/rcs/git.mdwn b/doc/rcs/git.mdwn index 55e2f1d55..504ded17a 100644 --- a/doc/rcs/git.mdwn +++ b/doc/rcs/git.mdwn @@ -5,13 +5,26 @@ the Linux kernel. Ikiwiki supports storing a wiki in git. [git]: http://git.or.cz/ -Ikiwiki can run as a post-update hook to update a wiki whenever commits +Ikiwiki can run as a `post-update` hook to update a wiki whenever commits come in. When running as a [[cgi]] with Git, ikiwiki automatically commits edited pages, and uses the Git history to generate the [[RecentChanges]] page. -[[Setup]] documents current best practice for using git with ikiwiki. This -involves setting up a pair of git repositories. This method isn't the most -obvious, but it works the best. +## git repository setup -See also: [[common_git_pitfalls|/setup/git_pitfalls]] +When using Git, you probably want to set up two repositories, of which +one should be bare (meaning that it does not have a working tree +checked out), and the other one with a working tree will be used as +ikiwiki's srcdir for compiling the wiki. [[ikiwiki-makerepo]] can automate +setting this up. Using a pair of repositories isn't the most obvious set up, +but it works the best for typical ikiwiki use. +[[tips/Laptop_wiki_with_git]] describes a different way to set up ikiwiki +and git. + +It is **paramount** that you **never** push to the non-bare repository +([this FAQ entry explains why](http://git.or.cz/gitwiki/GitFaq#head-b6a3d85f677763313159eb39f7dbf4579d4ee28b)). +Instead, if you want to work on the wiki from a remote machine, clone +the bare repository, using either the `git` transport (if available), or +`ssh`. + +The ikiwiki `post-commit` hook should be put in the bare repository. diff --git a/doc/setup.mdwn b/doc/setup.mdwn index 213146a7a..7e8973bbc 100644 --- a/doc/setup.mdwn +++ b/doc/setup.mdwn @@ -107,56 +107,32 @@ At this point you might want to check your wiki in to a revision control system so you can keep track of changes and revert edits. Depending on the revision control system you choose, the way this is done varies. -There's little that's ikiwiki specific about these instructions; this is -just how you put a directory under revision control using the various -systems that ikiwiki supports. Note that the .ikiwiki subdirectory is -where ikiwiki keeps its state, and should be preserved, but not checked -into revision control. +Note that the .ikiwiki subdirectory is where ikiwiki keeps its state, and +should be preserved, but not checked into revision control. + +The new [[ikiwiki-makerepo]] command automates setting up a wiki in +revision control. [[toggle id=subversion text="Subversion"]] [[toggleable id=subversion text=""" REPOSITORY=~/wikirepo - svnadmin create $REPOSITORY - svn mkdir file://$REPOSITORY/trunk -m "create trunk" - cd $SRCDIR - svn co file://$REPOSITORY/trunk . - svn add * - svn commit -m "initial import" + ikiwiki-makerepo svn $SRCDIR $REPOSITORY """]] [[toggle id=git text="Git"]] [[toggleable id=git text=""" -When using Git, you probably want to set up two repositories, of which -one should be bare (meaning that it does not have a working tree -checked out). We call the bare repository the "repository" and the -other will be the "srcdir" (which `ikiwiki` uses to compile the wiki). -There are [other -ways](http://blog.madduck.net/vcs/2007.07.11_publishing-git-repositories) -to do the following, but this might be easiest: - REPOSITORY=~/wiki.git - GIT_DIR=$REPOSITORY git --bare init --shared - cd $SRCDIR - git init - echo /.ikiwiki > .gitignore - git add . - git commit -m "initial commit" - git remote add origin $REPOSITORY - git config branch.master.merge refs/heads/master - git push --all - -It is **paramount** that you **never** push to the Git repository in -`$SRCDIR` ([this FAQ entry explains -why](http://git.or.cz/gitwiki/GitFaq#head-b6a3d85f677763313159eb39f7dbf4579d4ee28b)). -Instead, if you want to work on the wiki from a remote machine, clone -`$REPOSITORY`, using either the `git` transport (if available), or -`ssh`. - -If at any point you commit changes in `$SRCDIR`, make sure to `git -push` them to the `$REPOSITORY`. ikiwiki will do this automatically -for any changes made via the web. - -Finally, see [[Git_pitfalls]] if you experience problems. + ikiwiki-makerepo git $SRCDIR $REPOSITORY + + Please see [[rcs/git]] for detailed documentation about how + ikiwiki uses git repositories, and some important caveats + about using the git repositories. +"""]] + +[[toggle id=mercurial text="Mercurial"]] +[[toggleable id=mercurial text=""" + REPOSITORY=$SRCDIR + ikiwiki-makerepo mercurial $SRCDIR """]] [[toggle id=tla text="TLA"]] @@ -173,15 +149,6 @@ Finally, see [[Git_pitfalls]] if you experience problems. tla import """]] -[[toggle id=mercurial text="Mercurial"]] -[[toggleable id=mercurial text=""" - REPOSITORY=$SRCDIR - hg init $REPOSITORY - cd $REPOSITORY - hg add * - hg commit -m "initial import" -"""]] - [[toggle id=monotone text="Monotone"]] [[toggleable id=monotone text=""" # These instructions are standard instructions to import a directory into monotone diff --git a/doc/setup/git_pitfalls.mdwn b/doc/setup/git_pitfalls.mdwn deleted file mode 100644 index c3584775b..000000000 --- a/doc/setup/git_pitfalls.mdwn +++ /dev/null @@ -1,22 +0,0 @@ -I want to collect common problems and their solutions when using Ikiwiki with Git here. Nothing here yet though, so feel free to add... - -> Well, I have a question. :-) -> -> If I follow the instructions, I get a bare $REPOSITORY and a $SRCDIR that -> is cloned off of it. Web edits change the SRCDIR and ikiwiki automatically -> pushes to origin, which updates REPOSITORY. But the instructions say not -> to clone from SRCDIR; so I clone from REPOSITORY. Now if I manually edit -> a file and push the commit, it goes to REPOSITORY. The wiki isn't -> updated. -> -> Seems like REPOSITORY needs a post-receive hook that cd's to SRCDIR and -> does a git pull, and manually triggers ikiwiki. Which seems very messy. -> -> Am I doing something wrong? --[[Joey]] -> -> Hmm, perhaps I installed the wrapper to the wrong place? I had thought -> it would go in $SRCDIR/.git/hooks/post-commit, but on second read, I see -> that [[setup]] says it should be $REPOSITORY/hooks/post-update -> -> That seems to have sorted it. Based on [[this|rcs/git/discussion]], I'm -> not the only one to trip over how to do this. --[[Joey]] |