From ca7a1de4e382bfdecd9509adb35644cc7cb7d0dd Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sun, 19 Dec 2010 01:05:52 -0800 Subject: [PATCH] Add Documentation/git-{import,export}.do scripts. These export and import, respectively, the generated man pages to/from the git branch called 'man'. You can use it to retrieve the .1 files if you don't have a working pandoc. --- Documentation/git-export.do | 15 +++++++++++++++ Documentation/git-import.do | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 Documentation/git-export.do create mode 100644 Documentation/git-import.do diff --git a/Documentation/git-export.do b/Documentation/git-export.do new file mode 100644 index 0000000..dc6d04f --- /dev/null +++ b/Documentation/git-export.do @@ -0,0 +1,15 @@ +# update the local 'man' branch with pregenerated output files, for people +# who don't have pandoc (and maybe to aid in google searches or something) +redo-ifchange all +git update-ref refs/heads/man origin/man '' 2>/dev/null || true + +export GIT_INDEX_FILE=gitindex.tmp +rm -f $GIT_INDEX_FILE +git add -f *.1 + +MSG="Autogenerated man pages for $(git describe)" +TREE=$(git write-tree --prefix=Documentation) +git show-ref refs/heads/man >/dev/null && PARENT="-p refs/heads/man" +COMMITID=$(echo "$MSG" | git commit-tree $TREE $PARENT) + +git update-ref refs/heads/man $COMMITID diff --git a/Documentation/git-import.do b/Documentation/git-import.do new file mode 100644 index 0000000..74eeb2b --- /dev/null +++ b/Documentation/git-import.do @@ -0,0 +1,8 @@ +exec >&2 +if git show-ref refs/heads/man >/dev/null; then + (cd .. && git archive man) | tar -xvf - +else + (cd .. && git archive origin/man) | tar -xvf - +fi + +