{"thread":{"id":"3619","subject":"Cogito: Cleanup documentation building and add quick reference","startedAt":"2006-03-10T14:41:06Z","lastAt":"2006-03-11T13:12:40Z","messageCount":6,"participants":["Jonas Fonseca"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"17432","messageId":"20060310144106.GA7920@diku.dk","threadId":"3619","inReplyTo":null,"subject":"Cogito: Cleanup documentation building and add quick reference","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-03-10T14:41:06Z","receivedAt":"2006-03-10T14:41:06Z","isPatch":false,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Hi,\n\nHere are a few patches that makes it possible to build documentation as\nPDF using docbook2pdf (chosen because xmlto doesn't seem to be able to\ngenerate PDFs).\n\nAll the patches leads up to adding a quick reference with often used\nCogito commands and associated option. It is inspired by svn-ref and the\ngoal is to have the PDF version under two pages long. The grouping of\ncommands could need some more comments.\n\nThe quick reference can be translated into HTML, PDF and cg-ref(7)\nmanpage. The last one is achieved by stripping much of the markup from\nthe 'default' version since manpages cannot have table layout. Note the\nHTML and PDF versions are generated as quick-reference.{html,pdf}. We\nmight want to generate cg-ref.{html,pdf} instead.\n\n-- \nJonas Fonseca\n"},{"id":"17433","messageId":"20060310144308.GB7920@diku.dk","threadId":"3619","inReplyTo":"20060310144106.GA7920@diku.dk","subject":"[PATCH 1/4] Simplify wildcards for match files to be ignored","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-03-10T14:43:08Z","receivedAt":"2006-03-10T14:43:08Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\n Documentation/Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 3aad2fb..661c259 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -1,4 +1,4 @@\n-CG_IGNORE=$(wildcard ../cg-X* ../cg-*.orig ../cg-*.rej ../cg-*.in)\n+CG_IGNORE=$(wildcard ../cg-X* ../cg-*.*)\n CG_SRC=$(filter-out $(CG_IGNORE), $(wildcard ../cg*))\n \n PACKAGE=cogito\n\n-- \nJonas Fonseca\n"},{"id":"17434","messageId":"20060310144357.GC7920@diku.dk","threadId":"3619","inReplyTo":"20060310144106.GA7920@diku.dk","subject":"[PATCH 2/4] Encode the manpage section in the file name","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-03-10T14:43:57Z","receivedAt":"2006-03-10T14:43:57Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"This makes it easier to handle other document types.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\n Documentation/Makefile |   39 +++++++++++++++++++++++++++------------\n 1 files changed, 27 insertions(+), 12 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 661c259..00e9276 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -3,13 +3,13 @@ CG_SRC=$(filter-out $(CG_IGNORE), $(wild\n \n PACKAGE=cogito\n \n-MAN1_TXT=$(patsubst ../cg%,cg%.txt,$(CG_SRC))\n-MAN7_TXT=$(PACKAGE).txt\n+MAN1_TXT=$(patsubst ../cg%,cg%.1.txt,$(CG_SRC))\n+MAN7_TXT=$(PACKAGE).7.txt\n \n DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) introduction.html\n \n-DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))\n-DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))\n+DOC_MAN1=$(patsubst %.txt,%,$(MAN1_TXT))\n+DOC_MAN7=$(patsubst %.txt,%,$(MAN7_TXT))\n \n prefix=$(HOME)\n bin=$(prefix)/bin\n@@ -56,28 +56,43 @@ install-html: html\n \t$(INSTALL) $(DOC_HTML) $(DESTDIR)/$(htmldir)\n \n clean:\n-\trm -f *.xml *.html *.1 *.7 cg*.txt $(PACKAGE).txt\n+\trm -f *.xml *.html *.1 *.7 cg*.[17].txt $(PACKAGE).7.txt\n \n .PRECIOUS: cg%.txt\n \n introduction.html: ../README\n \tasciidoc -b xhtml11 -d article -f asciidoc.conf -o $@ $<\n \n-%.html : %.txt\n+%.1.html : %.1.txt\n \tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\n \n-%.1 %.7 : %.xml\n-\txmlto man $<\n+%.7.html : %.7.txt\n+\tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\n \n-%.xml : %.txt\n+%.html : %.txt\n+\tasciidoc -b xhtml11 -d article -f asciidoc.conf -o $@ $<\n+\n+%.1.xml : %.1.txt\n \tasciidoc -b docbook -d manpage -f asciidoc.conf $<\n \n-$(PACKAGE).txt : make-$(PACKAGE)-asciidoc\n+%.7.xml : %.7.txt\n+\tasciidoc -b docbook -d manpage -f asciidoc.conf $<\n+\n+%.xml : %.txt\n+\tasciidoc -b docbook -d article -f asciidoc.conf $<\n+\n+%.1 : %.1.xml\n+\txmlto man $<\n+\n+%.7 : %.7.xml\n+\txmlto man $<\n+\n+$(PACKAGE).7.txt : make-$(PACKAGE)-asciidoc\n \t./make-$(PACKAGE)-asciidoc > $@\n \n # It seems that cg%.txt won't match this so use an explicit rule\n-cg.txt : ../cg make-cg-asciidoc\n+cg.1.txt : ../cg make-cg-asciidoc\n \tCGPACKAGE=$(PACKAGE) ./make-cg-asciidoc $< > $@\n \n-cg-%.txt : ../cg-% make-cg-asciidoc\n+cg-%.1.txt : ../cg-% make-cg-asciidoc\n \tCGPACKAGE=$(PACKAGE) ./make-cg-asciidoc $< > $@\n\n-- \nJonas Fonseca\n"},{"id":"17435","messageId":"20060310144454.GD7920@diku.dk","threadId":"3619","inReplyTo":"20060310144106.GA7920@diku.dk","subject":"[PATCH 3/4] Generate PDF documents using docbook2pdf","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-03-10T14:44:54Z","receivedAt":"2006-03-10T14:44:54Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Unfortunately xmlto cannot be used for this,\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\n Documentation/Makefile |   14 ++++++++++++--\n 1 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 00e9276..d316a14 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -11,6 +11,8 @@ DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_\n DOC_MAN1=$(patsubst %.txt,%,$(MAN1_TXT))\n DOC_MAN7=$(patsubst %.txt,%,$(MAN7_TXT))\n \n+DOC_PDF=$(patsubst %.txt,%.pdf,$(MAN1_TXT) $(MAN7_TXT)) introduction.pdf\n+\n prefix=$(HOME)\n bin=$(prefix)/bin\n mandir=$(prefix)/man\n@@ -35,15 +37,17 @@ all: html man txt\n \n html: $(DOC_HTML)\n \n-\n man: man1 man7\n man1: $(DOC_MAN1)\n man7: $(DOC_MAN7)\n \n+pdf: $(DOC_PDF)\n+\n txt: txt1 txt7\n txt1: $(MAN1_TXT)\n txt7: $(MAN7_TXT)\n \n+\n install: man txt\n \t$(INSTALL) -m755 -d $(DESTDIR)/$(txtdir)\n \t$(INSTALL) $(MAN1_TXT) $(MAN7_TXT) $(DESTDIR)/$(txtdir)\n@@ -56,13 +60,16 @@ install-html: html\n \t$(INSTALL) $(DOC_HTML) $(DESTDIR)/$(htmldir)\n \n clean:\n-\trm -f *.xml *.html *.1 *.7 cg*.[17].txt $(PACKAGE).7.txt\n+\trm -f *.xml *.html *.pdf *.1 *.7 cg*.[17].txt $(PACKAGE).7.txt\n \n .PRECIOUS: cg%.txt\n \n introduction.html: ../README\n \tasciidoc -b xhtml11 -d article -f asciidoc.conf -o $@ $<\n \n+introduction.xml: ../README\n+\tasciidoc -b docbook -d article -f asciidoc.conf -o $@ $<\n+\n %.1.html : %.1.txt\n \tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\n \n@@ -87,6 +94,9 @@ introduction.html: ../README\n %.7 : %.7.xml\n \txmlto man $<\n \n+%.pdf : %.xml\n+\tdocbook2pdf $<\n+\n $(PACKAGE).7.txt : make-$(PACKAGE)-asciidoc\n \t./make-$(PACKAGE)-asciidoc > $@\n \n-- \nJonas Fonseca\n"},{"id":"17436","messageId":"20060310144835.GE7920@diku.dk","threadId":"3619","inReplyTo":"20060310144106.GA7920@diku.dk","subject":"[PATCH 4/4] Add quick reference","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-03-10T14:48:35Z","receivedAt":"2006-03-10T14:48:35Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\n If someone wants to have a look, I've put it here:\n http://www.diku.dk/hjemmesider/studerende/fonseca/cg-ref.pdf\n\n Documentation/Makefile             |    9 ++-\n Documentation/asciidoc.conf        |    4 +\n Documentation/make-cg-ref-asciidoc |   61 +++++++++++++++++++\n Documentation/quick-reference.txt  |  114 ++++++++++++++++++++++++++++++++++++\n 4 files changed, 185 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex d316a14..439d20f 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -4,14 +4,14 @@ CG_SRC=$(filter-out $(CG_IGNORE), $(wild\n PACKAGE=cogito\n \n MAN1_TXT=$(patsubst ../cg%,cg%.1.txt,$(CG_SRC))\n-MAN7_TXT=$(PACKAGE).7.txt\n+MAN7_TXT=$(PACKAGE).7.txt cg-ref.7.txt\n \n-DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) introduction.html\n+DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) quick-reference.html introduction.html\n \n DOC_MAN1=$(patsubst %.txt,%,$(MAN1_TXT))\n DOC_MAN7=$(patsubst %.txt,%,$(MAN7_TXT))\n \n-DOC_PDF=$(patsubst %.txt,%.pdf,$(MAN1_TXT) $(MAN7_TXT)) introduction.pdf\n+DOC_PDF=$(patsubst %.txt,%.pdf,$(MAN1_TXT) $(MAN7_TXT)) quick-reference.pdf introduction.pdf\n \n prefix=$(HOME)\n bin=$(prefix)/bin\n@@ -100,6 +100,9 @@ introduction.xml: ../README\n $(PACKAGE).7.txt : make-$(PACKAGE)-asciidoc\n \t./make-$(PACKAGE)-asciidoc > $@\n \n+cg-ref.7.txt : quick-reference.txt make-cg-ref-asciidoc\n+\tCGPACKAGE=$(PACKAGE) ./make-cg-ref-asciidoc $< > $@\n+\n # It seems that cg%.txt won't match this so use an explicit rule\n cg.1.txt : ../cg make-cg-asciidoc\n \tCGPACKAGE=$(PACKAGE) ./make-cg-asciidoc $< > $@\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex baefb2f..69f1646 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -19,3 +19,7 @@ ifdef::backend-xhtml11[]\n [gitlink-inlinemacro]\n <a href=\"{target}.html\">{target}{0?({0})}</a>\n endif::backend-xhtml11[]\n+\n+[attributes]\n+# Five non breaking spaces used for option indentation in the quick reference\n+cg-refopt=&#160;&#160;&#160;&#160;&#160;\ndiff --git a/Documentation/make-cg-ref-asciidoc b/Documentation/make-cg-ref-asciidoc\nnew file mode 100755\nindex 0000000..7fd60ca\n--- /dev/null\n+++ b/Documentation/make-cg-ref-asciidoc\n@@ -0,0 +1,61 @@\n+#!/usr/bin/env bash\n+#\n+# Generate asciidoc manpage markup from Cogito quick reference file.\n+# Copyright (c) Jonas Fonseca, 2006\n+#\n+# Takes the path to the reference file. Prints the manpage to stdout.\n+\n+PACKAGE=${CGPACKAGE:-cogito}\n+\n+ref=$1\n+\n+cat <<__END__\n+cg-ref(7)\n+=========\n+\n+NAME\n+----\n+cg-ref - Cogito quick reference\n+\n+SYNOPSIS\n+--------\n+A list of frequently used commands grouped with related commands.\n+\n+DESCRIPTION\n+-----------\n+\n+__END__\n+\n+sed '0,/^$/d' < \"$ref\" | \\\n+sed '/^`/d' | \\\n+sed 's/--/../g' | \\\n+sed '/frame=\"none\"/,1d' | \\\n+sed 's/\\\\$//' | \\\n+while read line; do\n+\tif echo \"$line\" | grep -q '^.*:$'; then\n+\t\techo \"$line\"\n+\t\techo \"$line\" | sed \"s/[^~]/~/g\"\n+\t\techo\n+\t\techo \"[verse]\"\n+\telse\n+\t\tentry=$(echo \"$line\" | sed \"s/^\\([^\t]*\\)\t/\\1/\")\n+\t\tspace=$(echo \"$entry\" | sed \"s/[^*']//g\" | sed \"s/[*']/ /g\")\n+\n+\t\techo \"$line\" | sed \"s/^\\([^\t]*\\)\t/\\1$space\t/\"\n+\tfi\n+done | \\\n+sed 's/.*cg-refopt} \\(-[^\t]*\\)/    \\1        /' | \\\n+sed \"s/[*]\\([^*]*\\)[*]/\\1/g\" | \\\n+sed \"s/[']\\([^']*\\)[']/\\1/g\"\n+\n+cat << __END__\n+\n+COPYRIGHT\n+---------\n+Copyright (C) Jonas Fonseca, 2006.\n+\n+SEE ALSO\n+--------\n+gitlink:cg-ref[7] is part of gitlink:${PACKAGE}[7],\n+a toolkit for managing gitlink:git[7] trees.\n+__END__\ndiff --git a/Documentation/quick-reference.txt b/Documentation/quick-reference.txt\nnew file mode 100644\nindex 0000000..11c0a13\n--- /dev/null\n+++ b/Documentation/quick-reference.txt\n@@ -0,0 +1,114 @@\n+Cogito Quick Reference\n+======================\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Getting help:\n+------------------------------------------------------------------------------\n+*cg help* 'command'\t\tShow help for a command\n+*cg* 'command' -h\t\tShow usage summary for a command\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Repository creation:\n+------------------------------------------------------------------------------\n+*cg init*\t\t\tCreate a repository in the current directory\n+*cg clone* 'url'\t\tClone a remote repository\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+File operations:\n+------------------------------------------------------------------------------\n+*cg add* 'file'\t\t\tAdd file to the working tree\n+*cg add* -r 'directory'\t\tRecursively add files in directory\n+*cg rm* 'file'\t\t\tRemove file or directory from the working tree\n+*cg rm* -r 'directory'\t\tRecursively remove files in directory\n+{cg-refopt} -f\t\t\tDelete file from disk\n+*cg mv* 'file' 'dest'\t\tMove file or directory to new location\n+{cg-refopt} -f\t\t\tOverwrite existing destination files\n+*cg restore* 'file'\t\tRestore file\n+{cg-refopt} -r 'rev'\t\tBring back file from revision (and add it)\n+{cg-refopt} -f\t\t\tOverwrite uncommitted changes\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Examining History:\n+------------------------------------------------------------------------------\n+*cg log* '[file]'\t\tView commit log\n+{cg-refopt} -r 'rev'\t\tLimit to revision range\n+{cg-refopt} -f\t\t\tList affected files\n+{cg-refopt} -s\t\t\tSummarize commits to one line\n+*cg diff* '[file]'\t\tShow diff of changes\n+{cg-refopt} -r 'rev'\t\tDiff revision instead of working tree\n+{cg-refopt} -p\t\t\tDiff against parent\n+{cg-refopt} -s\t\t\tShow diff stat\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Working tree:\n+------------------------------------------------------------------------------\n+*cg status* '[file]'\t\tShow branches and status of the working tree\n+*cg commit*\t\t\tCommit the working tree\n+{cg-refopt} -m 'message'\tAppend message to commit log\n+*cg admin-uncommit*\t\tUndo commit\n+*cg reset*\t\t\tReset the working treeUndo commit\n+*cg seek* 'rev'\t\t\tTemporarily switch the working tree\n+*cg clean*\t\t\tRemove file not under revision control\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Remote branches:\n+------------------------------------------------------------------------------\n+*cg branch-ls*\t\t\tList remote branches\n+*cg branch-add* 'branch' 'url'\tAdd remote branch\n+*cg branch-chg* 'branch' 'url'\tChange URL of existing branch\n+*cg fetch* 'branch'\t\tFetch changes from a remote branch\n+*cg update* 'branch'\t\tFetch and merge changes from a remote branch\n+*cg push* 'branch'\t\tPush changes to a remote branch\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Local branches:\n+------------------------------------------------------------------------------\n+*cg merge* 'branch'\t\tMerge changes from branch\n+*cg switch* 'branch'\t\tSwitch the working tree to branch\n+{cg-refopt} -r 'rev'\t\tCreate branch from revision\n+{cg-refopt} -f\t\t\tOverwrite existing branch\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Exporting and importing:\n+------------------------------------------------------------------------------\n+*cg patch*\t\t\tApply patch\n+*cg mkpatch*\t\t\tFormat a patch with log message and diffstat\n+{cg-refopt} -r 'rev'\t\tLimit to revision range\n+*cg export* 'directory'\t\tExport \"snapshot\" to directory\n+{cg-refopt} -r 'rev'\t\t\t\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Tags:\n+------------------------------------------------------------------------------\n+*cg tag* 'name' 'rev'\t\tCreate tag for a given revision\n+{cg-refopt} -s\t\t\tSign tag with your private key using GPG\n+*cg tag-ls*\t\t\tShow name and revision for all tags\n+------------------------------------------------------------------------------\n+\n+`-------------------------------`---------------------------------------------\n+File status flags:\n+------------------------------------------------------------------------------\n+?\t\t\t\tfile is unknown\n+A\t\t\t\tfile has been added.\n+D\t\t\t\tfile has been deleted.\n+!\t\t\t\tfile is not in working tree\n+M\t\t\t\tfile has been touched or modified\n+m\t\t\t\tfile has been touched or modified (during merge)\n+------------------------------------------------------------------------------\n\n-- \nJonas Fonseca\n"},{"id":"17457","messageId":"20060311131240.GA26418@diku.dk","threadId":"3619","inReplyTo":"20060310144835.GE7920@diku.dk","subject":"[PATCH 4/4] Add quick reference","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-03-11T13:12:40Z","receivedAt":"2006-03-11T13:12:40Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\n This renames quick-reference.txt to cg-ref.txt to address the\n cg-ref.pdf issue, makes the script more robust by using printf for\n alignment, and improves the reference itself a bit.\n\n Documentation/Makefile             |    9 ++-\n Documentation/asciidoc.conf        |    4 +\n Documentation/cg-ref.txt           |  116 ++++++++++++++++++++++++++++++++++++\n Documentation/make-cg-ref-asciidoc |   70 ++++++++++++++++++++++\n 4 files changed, 196 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex d316a14..b38fc4d 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -4,14 +4,14 @@ CG_SRC=$(filter-out $(CG_IGNORE), $(wild\n PACKAGE=cogito\n \n MAN1_TXT=$(patsubst ../cg%,cg%.1.txt,$(CG_SRC))\n-MAN7_TXT=$(PACKAGE).7.txt\n+MAN7_TXT=$(PACKAGE).7.txt cg-ref.7.txt\n \n-DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) introduction.html\n+DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) cg-ref.html introduction.html\n \n DOC_MAN1=$(patsubst %.txt,%,$(MAN1_TXT))\n DOC_MAN7=$(patsubst %.txt,%,$(MAN7_TXT))\n \n-DOC_PDF=$(patsubst %.txt,%.pdf,$(MAN1_TXT) $(MAN7_TXT)) introduction.pdf\n+DOC_PDF=$(patsubst %.txt,%.pdf,$(MAN1_TXT) $(MAN7_TXT)) cg-ref.pdf introduction.pdf\n \n prefix=$(HOME)\n bin=$(prefix)/bin\n@@ -100,6 +100,9 @@ introduction.xml: ../README\n $(PACKAGE).7.txt : make-$(PACKAGE)-asciidoc\n \t./make-$(PACKAGE)-asciidoc > $@\n \n+cg-ref.7.txt : cg-ref.txt make-cg-ref-asciidoc\n+\tCGPACKAGE=$(PACKAGE) ./make-cg-ref-asciidoc $< > $@\n+\n # It seems that cg%.txt won't match this so use an explicit rule\n cg.1.txt : ../cg make-cg-asciidoc\n \tCGPACKAGE=$(PACKAGE) ./make-cg-asciidoc $< > $@\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex baefb2f..69f1646 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -19,3 +19,7 @@ ifdef::backend-xhtml11[]\n [gitlink-inlinemacro]\n <a href=\"{target}.html\">{target}{0?({0})}</a>\n endif::backend-xhtml11[]\n+\n+[attributes]\n+# Five non breaking spaces used for option indentation in the quick reference\n+cg-refopt=&#160;&#160;&#160;&#160;&#160;\ndiff --git a/Documentation/cg-ref.txt b/Documentation/cg-ref.txt\nnew file mode 100644\nindex 0000000..ab2321b\n--- /dev/null\n+++ b/Documentation/cg-ref.txt\n@@ -0,0 +1,116 @@\n+Cogito Quick Reference\n+======================\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Getting help:\n+------------------------------------------------------------------------------\n+*cg help* 'command'\t\tShow help for a command\n+*cg* 'command' -h\t\tShow usage summary for a command\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Repository creation:\n+------------------------------------------------------------------------------\n+*cg init*\t\t\tCreate a repository in the current directory\n+*cg clone* 'url'\t\tClone a remote repository into a subdirectory\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+File operations:\n+------------------------------------------------------------------------------\n+*cg add* 'file'\t\t\tAdd file to the working tree\n+*cg add* -r 'directory'\t\tRecursively add files in directory\n+*cg rm* 'file'\t\t\tRemove file or directory from the working tree\n+*cg rm* -r 'directory'\t\tRecursively remove files in directory\n+{cg-refopt} -f\t\t\tDelete file from disk\n+*cg mv* 'file' 'destination'\tMove file or directory to new location\n+{cg-refopt} -f\t\t\tOverwrite existing destination files\n+*cg restore* 'file'\t\tRestore file\n+{cg-refopt} -r 'revision'\tBring back file from revision (and add it)\n+{cg-refopt} -f\t\t\tOverwrite uncommitted changes\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Working tree:\n+------------------------------------------------------------------------------\n+*cg status* '[file]'\t\tShow branches and status of the working tree\n+*cg reset*\t\t\tReset the working tree\n+*cg clean*\t\t\tClean unknown files from the working tree\n+*cg commit* '[file]'\t\tCommit the working tree\n+{cg-refopt} -m 'message'\tAppend message to commit log\n+*cg admin-uncommit*\t\tUndo commit\n+*cg seek* 'revision'\t\tTemporarily switch the working tree\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Examining History:\n+------------------------------------------------------------------------------\n+*cg log* '[file]'\t\tView commit log\n+{cg-refopt} -r 'revision'\tLimit to revision range\n+{cg-refopt} -f\t\t\tList affected files\n+{cg-refopt} -s\t\t\tSummarize commits to one line\n+*cg diff* '[file]'\t\tShow diff of changes\n+{cg-refopt} -r 'revision'\tDiff revision instead of working tree\n+{cg-refopt} -p\t\t\tDiff against parent\n+{cg-refopt} -s\t\t\tShow diff stat\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Remote branches:\n+------------------------------------------------------------------------------\n+*cg fetch* '[branch]'\t\tFetch changes from a remote branch\n+*cg update* '[branch]'\t\tFetch and merge changes from a remote branch\n+*cg push* '[branch]'\t\tPush changes to a remote branch\n+*cg branch-ls*\t\t\tList remote branches\n+*cg branch-add* 'branch' 'url'\tAdd remote branch\n+*cg branch-chg* 'branch' 'url'\tChange URL of existing branch\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Local branches:\n+------------------------------------------------------------------------------\n+*cg merge* 'branch'\t\tMerge changes from branch\n+*cg switch* 'branch'\t\tSwitch the working tree to branch\n+{cg-refopt} -r 'revision'\tCreate branch from revision\n+{cg-refopt} -f\t\t\tOverwrite existing branch\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Exporting and importing:\n+------------------------------------------------------------------------------\n+*cg patch* < 'file'\t\tApply patch from stdin\n+*cg mkpatch*\t\t\tFormat a patch with log message and diffstat\n+{cg-refopt} -r 'revision'\tLimit to revision range\n+*cg export* 'directory'\t\tExport snapshot to directory\n+*cg export* 'file.tar.gz'\tExport snapshot to tar file\n+{cg-refopt} -r 'revision'\tBase snapshot on revision\t\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+Tags:\n+------------------------------------------------------------------------------\n+*cg tag* 'name' 'revision'\tCreate tag for a given revision\n+{cg-refopt} -s\t\t\tSign tag with your private key using GPG\n+*cg tag-ls*\t\t\tShow name and revision for all tags\n+------------------------------------------------------------------------------\n+\n+[frame=\"none\"]\n+`-------------------------------`---------------------------------------------\n+File status flags:\n+------------------------------------------------------------------------------\n+`?` unknown\t\t\tFile is not under revision control\n+`A` added\t\t\tFile has been added\n+`D` deleted\t\t\tFile has been deleted\n+`!` disappeared\t\t\tFile is not in the working tree\n+`M` modified\t\t\tFile has been touched or modified\n+`m` modified (while merging)\tFile was modified prior to the merge\n+------------------------------------------------------------------------------\ndiff --git a/Documentation/make-cg-ref-asciidoc b/Documentation/make-cg-ref-asciidoc\nnew file mode 100755\nindex 0000000..960e711\n--- /dev/null\n+++ b/Documentation/make-cg-ref-asciidoc\n@@ -0,0 +1,70 @@\n+#!/usr/bin/env bash\n+#\n+# Generate asciidoc manpage markup from Cogito quick reference file.\n+# Copyright (c) Jonas Fonseca, 2006\n+#\n+# Takes the path to the reference file. Prints the manpage to stdout.\n+\n+PACKAGE=${CGPACKAGE:-cogito}\n+\n+ref=$1\n+\n+cat <<__END__\n+cg-ref(7)\n+=========\n+\n+NAME\n+----\n+cg-ref - Cogito quick reference\n+\n+SYNOPSIS\n+--------\n+A list of frequently used commands grouped with related commands.\n+\n+DESCRIPTION\n+-----------\n+\n+__END__\n+\n+sed '\n+\t0,/^$/d\n+\t/^`---/d\n+\t/frame=\"none\"/,1d\n+\ts/\\\\$//\n+\ts/[*]\\([^*]*\\)[*]/\\1/g\n+\ts/[`]\\([^`]*\\)[`]/\\1/g\n+\ts/['\\'']\\([^'\\'']*\\)['\\'']/\\1/g\n+' < \"$ref\" | \\\n+while read line; do\n+\tcol1=$(echo \"$line\" | cut -f 1)\n+\tcase \"$line\" in\n+\t*\":\")\n+\t\techo \"$line\"\n+\t\techo \"$line\" | sed \"s/[^~]/~/g\"\n+\t\techo\n+\t\techo \"[verse]\"\n+\t\tcontinue\n+\t\t;;\n+\t\"-----\"*|\"\")\n+\t\techo \"$line\" | sed 's/-/./g'\n+\t\tcontinue\n+\t\t;;\n+\t\"{cg-refopt}\"*)\n+\t\tcol1=$(echo \"$col1\" | sed 's/.*cg-refopt}/   /')\n+\t\t;;\n+\tesac\n+\tcol2=$(echo \"$line\" | sed 's/.*[\t]\\+//')\n+\tprintf \"%-30s  %s\\n\" \"$col1\" \"$col2\"\n+done\n+\n+cat << __END__\n+\n+COPYRIGHT\n+---------\n+Copyright (C) Jonas Fonseca, 2006.\n+\n+SEE ALSO\n+--------\n+gitlink:cg-ref[7] is part of gitlink:${PACKAGE}[7],\n+a toolkit for managing gitlink:git[7] trees.\n+__END__\n\n-- \nJonas Fonseca\n"}]}