Browse files

Refactor gitteh.coffee to use CS classes and brought in basic sphinx …

…quickstart.
  • Loading branch information...
1 parent b3c8765 commit c2ec2d5dc6d29837e282dbe0f8414b3806f0fb9e @samcday samcday committed Jul 23, 2013
Showing with 2,202 additions and 581 deletions.
  1. +1 −0 docs/.gitignore
  2. +177 −0 docs/Makefile
  3. +253 −0 docs/conf.py
  4. +87 −0 docs/index.html
  5. +25 −0 docs/index.rst
  6. +396 −0 docs/resources/base.css
  7. +700 −0 docs/src/gitteh.coffee.html
  8. +18 −9 src/args.coffee
  9. +545 −572 src/gitteh.coffee
View
1 docs/.gitignore
@@ -0,0 +1 @@
+_build/
View
177 docs/Makefile
@@ -0,0 +1,177 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " xml to make Docutils-native XML files"
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/node-gitteh.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/node-gitteh.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/node-gitteh"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/node-gitteh"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
View
253 docs/conf.py
@@ -0,0 +1,253 @@
+# -*- coding: utf-8 -*-
+#
+# node-gitteh documentation build configuration file, created by
+# sphinx-quickstart on Tue Jul 23 14:08:21 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ["sphinx.ext.autodoc", "sphinxcontrib.coffeedomain"]
+
+coffee_src_dir = os.path.abspath('../src')
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'node-gitteh'
+copyright = u'2013, Sam Day'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.17.2'
+# The full version, including alpha/beta/rc tags.
+release = '0.17.2'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'node-gittehdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'node-gitteh.tex', u'node-gitteh Documentation',
+ u'Sam Day', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'node-gitteh', u'node-gitteh Documentation',
+ [u'Sam Day'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'node-gitteh', u'node-gitteh Documentation',
+ u'Sam Day', 'node-gitteh', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
+
+
+primary_domain = 'coffee'
View
87 docs/index.html
@@ -0,0 +1,87 @@
+<!doctype html>
+
+<!-- Documentation generated by [CoffeeDoc](http://github.com/omarkhan/coffeedoc) -->
+
+<html>
+<head>
+ <title>CoffeeDoc</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" media="all" href="resources/base.css" />
+</head>
+<body>
+ <header>
+ <h1>CoffeeDoc &mdash; Module Index</h1>
+ </header>
+ <div class="container">
+ <div class="sidebar column">
+ <ul id="modulelist">
+
+ <li><a href="src/gitteh.coffee.html">src/gitteh.coffee</a></li>
+
+ </ul>
+ </div>
+ <div class="content column">
+
+ <div class="module">
+ <div class="header">
+ <a href="src/gitteh.coffee.html"><h1>gitteh.coffee</h1></a>
+ </div>
+ <div class="module-content">
+
+
+ <h3>Classes</h3>
+ <ul class="classlist">
+
+ <li><a href="src/gitteh.coffee.html#Signature">Signature</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Refspec">Refspec</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Commit">Commit</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Tree">Tree</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Blob">Blob</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Tag">Tag</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Remote">Remote</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Index">Index</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Reference">Reference</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Repository">Repository</a></li>
+
+ </ul>
+
+
+ <h3>Functions</h3>
+ <ul class="functionlist">
+
+ <li><a href="src/gitteh.coffee.html#Gitteh.openRepository">Gitteh.openRepository()</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Gitteh.initRepository">Gitteh.initRepository()</a></li>
+
+ <li><a href="src/gitteh.coffee.html#Gitteh.clone">Gitteh.clone()</a></li>
+
+
+
+ <li><a href="src/gitteh.coffee.html#_getPrivate">_getPrivate(obj)</a></li>
+
+ <li><a href="src/gitteh.coffee.html#_createPrivate">_createPrivate(obj)</a></li>
+
+ <li><a href="src/gitteh.coffee.html#_wrapCallback">_wrapCallback(orig, cb)</a></li>
+
+ <li><a href="src/gitteh.coffee.html#_immutable">_immutable(obj, src)</a></li>
+
+
+ </ul>
+
+ </div>
+ </div>
+
+ </div>
+ </div>
+</body>
+</html>
View
25 docs/index.rst
@@ -0,0 +1,25 @@
+.. node-gitteh documentation master file, created by
+ sphinx-quickstart on Tue Jul 23 14:08:21 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to node-gitteh's documentation!
+=======================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+
+.. automodule:: gitteh
+
View
396 docs/resources/base.css
@@ -0,0 +1,396 @@
+/*
+ * Skeleton V1.1
+ * Copyright 2011, Dave Gamache
+ * www.getskeleton.com
+ * Free to use under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+ * 8/17/2011
+ */
+
+
+/* #Reset & Basics (Inspired by E. Meyers)
+================================================== */
+ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline; }
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
+ display: block; }
+ body {
+ line-height: 1; }
+ ol, ul {
+ list-style: none; }
+ blockquote, q {
+ quotes: none; }
+ blockquote:before, blockquote:after,
+ q:before, q:after {
+ content: '';
+ content: none; }
+ table {
+ border-collapse: collapse;
+ border-spacing: 0; }
+
+
+/* #Basic Styles
+================================================== */
+ body {
+ background: #fff;
+ font: 14px/21px "Helvetica Neue", Helvetica, Arial, sans-serif;
+ color: #444;
+ -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */
+ -webkit-text-size-adjust: 100%;
+ }
+
+
+/* #Typography
+================================================== */
+ h1, h2, h3, h4, h5, h6 {
+ font-family: "Georgia", serif;
+ font-weight: normal; }
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; }
+ h1 { font-size: 34px; line-height: 50px; margin-bottom: 14px;}
+ h2 { font-size: 28px; line-height: 40px; margin-bottom: 10px; }
+ h3 { font-size: 23px; line-height: 34px; margin-bottom: 8px; }
+ h4 { font-size: 19px; line-height: 30px; margin-bottom: 4px; }
+ h5 { font-size: 16px; line-height: 24px; }
+ h6 { font-size: 14px; line-height: 21px; }
+
+ p { margin: 0 0 20px 0; }
+ p img { margin: 0; }
+
+ em { font-style: italic; }
+ strong { font-weight: bold; color: #333; }
+ small { font-size: 80%; }
+
+/* Blockquotes */
+ blockquote, blockquote p { font-size: 17px; line-height: 24px; color: #777; font-style: italic; }
+ blockquote { margin: 0 0 20px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; }
+ blockquote cite { display: block; font-size: 12px; color: #555; }
+ blockquote cite:before { content: "\2014 \0020"; }
+ blockquote cite a, blockquote cite a:visited, blockquote cite a:visited { color: #555; }
+
+ hr { border: solid #ddd; border-width: 1px 0 0; clear: both; margin: 10px 0 30px; height: 0; }
+
+
+/* #Links
+================================================== */
+ a, a:visited {
+ color: #2d81c5;
+ text-decoration: none; outline: 0;
+ -webkit-transition: color 250ms ease-in-out;
+ -moz-transition: color 250ms ease-in-out;
+ transition: color 250ms ease-in-out;
+ }
+ a:hover, a:focus {
+ color: #2569a0;
+ }
+ p a, p a:visited { line-height: inherit; }
+
+
+/* #Lists
+================================================== */
+ ul, ol { margin-bottom: 20px; }
+ ul { list-style: none outside; }
+ ol { list-style: decimal; }
+ ol, ul.square, ul.circle, ul.disc { margin-left: 30px; }
+ ul.square { list-style: square outside; }
+ ul.circle { list-style: circle outside; }
+ ul.disc { list-style: disc outside; }
+ ul ul, ul ol,
+ ol ol, ol ul { margin: 4px 0 5px 30px; font-size: 90%; }
+ ul ul li, ul ol li,
+ ol ol li, ol ul li { margin-bottom: 6px; }
+ li { line-height: 18px; margin-bottom: 12px; }
+ ul.large li { line-height: 21px; }
+ li p { line-height: 21px; }
+
+
+/* #Images
+================================================== */
+
+ img.scale-with-grid {
+ max-width: 100%;
+ height: auto; }
+
+
+/* #Misc
+================================================== */
+ .remove-bottom { margin-bottom: 0 !important; }
+ .half-bottom { margin-bottom: 10px !important; }
+ .add-bottom { margin-bottom: 20px !important; }
+
+
+/* #Base 960 Grid
+================================================== */
+
+ .container { position: relative; width: 960px; margin: 0 auto; padding: 0; }
+ .container .column { float: left; display: inline; margin-left: 10px; margin-right: 10px; }
+ .row { margin-bottom: 20px; }
+
+ /* Base Grid */
+ .container .sidebar.column { width: 220px; }
+ .container .content.column { width: 700px; }
+
+
+/* #Tablet (Portrait)
+================================================== */
+
+ /* Note: Design for a width of 768px */
+
+ @media only screen and (min-width: 768px) and (max-width: 959px) {
+ .container { width: 768px; }
+ .container .column { margin-left: 10px; margin-right: 10px; }
+
+ .container .sidebar.column { width: 172px; }
+ .container .content.column { width: 556px; }
+ }
+
+
+/* #Mobile (Portrait)
+================================================== */
+
+ /* Note: Design for a width of 320px */
+
+ @media only screen and (max-width: 767px) {
+ .container { width: 300px; }
+ .container .column { margin: 0; }
+
+ .container .sidebar.column,
+ .container .content.column { width: 300px; }
+ }
+
+
+/* #Mobile (Landscape)
+================================================== */
+
+ /* Note: Design for a width of 480px */
+
+ @media only screen and (min-width: 480px) and (max-width: 767px) {
+ .container { width: 420px; }
+ .container .column { margin: 0; }
+
+ .container .sidebar.column,
+ .container .content.column { width: 420px; }
+ }
+
+
+/* #Clearing
+================================================== */
+
+ /* Self Clearing Goodness */
+ .container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }
+
+
+/* #CoffeeDoc styles
+================================================== */
+
+code {
+ color: #000;
+ background: #f6f6f6;
+ padding: 2px 4px;
+ border: 1px solid #ccc;
+ font-size: 12px; line-height: 18px;
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ border-radius: 2px;
+}
+pre code {
+ display: block;
+ border-radius: 4px;
+ margin-bottom: 20px;
+ padding: 10px;
+}
+header {
+ width: 100%;
+ border-bottom: 1px solid #bbb;
+ margin-bottom: 20px;
+ background-image: -webkit-linear-gradient(top, #fff, #d0d0d0);
+ background-image: -moz-linear-gradient(top, #fff, #d0d0d0);
+ background-image: linear-gradient(top, #fff, #d0d0d0);
+}
+header h1 {
+ margin: 0;
+ line-height: 50px;
+ font-size: 20px;
+ text-align: center;
+}
+h1, h2 {
+ border-bottom: 1px solid #ccc;
+}
+h3 {
+ border-bottom: 1px solid #ddd;
+}
+
+
+/* #Module index
+================================================== */
+
+.module {
+ margin-bottom: 25px;
+}
+.module .header h1 {
+ margin-bottom: 20px;
+ border-bottom: none;
+ box-shadow: 0 5px 5px -6px rgba(45, 129, 197, 0.4);
+ -webkit-transition: box-shadow 250ms ease-in-out;
+ -moz-transition: box-shadow 250ms ease-in-out;
+ transition: box-shadow 250ms ease-in-out;
+}
+.module .header h1:hover {
+ box-shadow: 0 5px 5px -6px rgb(45, 129, 197);
+}
+.module-content h1 {
+ font-size: 30px;
+ line-height: 44px;
+}
+
+
+/* #Module pages
+================================================== */
+
+.function, .class {
+ margin-bottom: 30px;
+}
+.method {
+ margin-bottom: 20px;
+}
+.class .header {
+ border-bottom: 1px solid #ccc;
+ margin-bottom: 10px;
+}
+.class .header h3 {
+ display: inline;
+ border: none;
+}
+.class .header .parent {
+ color: #aaa;
+}
+.class .header .parent:hover {
+ color: #2569a0;
+}
+
+
+/* #Syntax highlighting
+============================================================== */
+
+/* github.com style (c) Vasily Polovnyov <vast@whiteants.net> */
+
+pre .comment,
+pre .template_comment,
+pre .diff .header,
+pre .javadoc {
+ color: #998;
+ font-style: italic
+}
+
+pre .keyword,
+pre .css .rule .keyword,
+pre .winutils,
+pre .javascript .title,
+pre .lisp .title,
+pre .subst {
+ color: #000;
+ font-weight: bold
+}
+
+pre .number,
+pre .hexcolor {
+ color: #40a070
+}
+
+pre .string,
+pre .tag .value,
+pre .phpdoc,
+pre .tex .formula {
+ color: #d14
+}
+
+pre .title,
+pre .id {
+ color: #900;
+ font-weight: bold
+}
+
+pre .javascript .title,
+pre .lisp .title,
+pre .subst {
+ font-weight: normal
+}
+
+pre .class .title,
+pre .haskell .label,
+pre .tex .command {
+ color: #458;
+ font-weight: bold
+}
+
+pre .tag,
+pre .tag .title,
+pre .rules .property,
+pre .django .tag .keyword {
+ color: #000080;
+ font-weight: normal
+}
+
+pre .attribute,
+pre .variable,
+pre .instancevar,
+pre .lisp .body {
+ color: #008080
+}
+
+pre .regexp {
+ color: #009926
+}
+
+pre .class {
+ color: #458;
+ font-weight: bold
+}
+
+pre .symbol,
+pre .ruby .symbol .string,
+pre .ruby .symbol .keyword,
+pre .ruby .symbol .keymethods,
+pre .lisp .keyword,
+pre .tex .special,
+pre .input_number {
+ color: #990073
+}
+
+pre .builtin,
+pre .built_in,
+pre .lisp .title {
+ color: #0086b3
+}
+
+pre .preprocessor,
+pre .pi,
+pre .doctype,
+pre .shebang,
+pre .cdata {
+ color: #999;
+ font-weight: bold
+}
+
+pre .deletion {
+ background: #fdd
+}
+
+pre .addition {
+ background: #dfd
+}
+
+pre .diff .change {
+ background: #0086b3
+}
+
+pre .chunk {
+ color: #aaa
+}
+
+pre .tex .formula {
+ opacity: 0.5;
+}
View
700 docs/src/gitteh.coffee.html
@@ -0,0 +1,700 @@
+<!doctype html>
+
+<!-- Documentation generated by [CoffeeDoc](http://github.com/omarkhan/coffeedoc) -->
+
+<html>
+<head>
+ <title>CoffeeDoc | gitteh.coffee</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" media="all" href="../resources/base.css" />
+</head>
+<body>
+ <header>
+ <h1>gitteh.coffee</h1>
+ </header>
+ <div class="container">
+ <div class="sidebar column">
+
+ <h4>Classes</h4>
+ <ul class="classlist">
+
+ <li><a href="#Signature">Signature</a></li>
+
+ <li><a href="#Refspec">Refspec</a></li>
+
+ <li><a href="#Commit">Commit</a></li>
+
+ <li><a href="#Tree">Tree</a></li>
+
+ <li><a href="#Blob">Blob</a></li>
+
+ <li><a href="#Tag">Tag</a></li>
+
+ <li><a href="#Remote">Remote</a></li>
+
+ <li><a href="#Index">Index</a></li>
+
+ <li><a href="#Reference">Reference</a></li>
+
+ <li><a href="#Repository">Repository</a></li>
+
+ </ul>
+
+
+ <h4>Functions</h4>
+ <ul class="functionlist">
+
+ <li><a href="#Gitteh.openRepository">Gitteh.openRepository</a></li>
+
+ <li><a href="#Gitteh.initRepository">Gitteh.initRepository</a></li>
+
+ <li><a href="#Gitteh.clone">Gitteh.clone</a></li>
+
+ </ul>
+
+ </div>
+ <div class="content column">
+
+
+ <div id="classes">
+ <h2>Classes</h2>
+
+ <div class="class">
+ <div class="header">
+ <a id="Signature"><h3>Signature</h3></a>
+
+ </div>
+ <div class="class-content">
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(obj)</h4>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Refspec"><h3>Refspec</h3></a>
+
+ </div>
+ <div class="class-content">
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(src, dst)</h4>
+
+ </div>
+
+ <div class="method">
+ <h4>matchesSrc(refName)</h4>
+ <ul>
+<li>Determines if provided reference name matches source of this Refspec.</li>
+<li>@param {String} refName</li>
+<li>@return {Boolean} true if provided refName matches src of Refspec.</li>
+</ul>
+
+ </div>
+
+ <div class="method">
+ <h4>matchesDst(refName)</h4>
+ <ul>
+<li>Determines if provided reference name matches destination of this Refspec.</li>
+<li>@param {String} refName</li>
+<li>@return {Boolean} true if provided refName matches dst of Refspec.</li>
+</ul>
+
+ </div>
+
+ <div class="method">
+ <h4>transformTo(refName)</h4>
+ <ul>
+<li>Transforms provided refName to destination, provided it matches src pattern.</li>
+<li>@param {String} refName</li>
+<li>@throws {Error} if refName doesn&#39;t match src pattern.</li>
+<li>@return {String} transformed reference name.</li>
+</ul>
+
+ </div>
+
+ <div class="method">
+ <h4>transformFrom(refName)</h4>
+ <ul>
+<li>Transforms provided refName from destination back to source, provided it</li>
+<li>matches dst pattern. This is the reverse of {@link #transformTo}.</li>
+<li>@param {String} refName</li>
+<li>@throws {Error} if refName doesn&#39;t match dst pattern.</li>
+<li>@return {String} (un?)transformed reference name.</li>
+</ul>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Commit"><h3>Commit</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p>A commit made by a author (and optional different committer) with a message,
+a {Tree} and zero or more parent {@link Commit} objects.
+@property {String} id object id of this Commit.
+@property {String} treeId object id of {@link Tree} for this Commit.
+@property {Commit[]} parents parent Commits of this Commit (more than one
+means a merge-commit).
+@property {String} message
+@property {String} messageEncoding
+@property {Signature} author
+@property {Signature} committer</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(@repository, obj)</h4>
+
+ </div>
+
+ <div class="method">
+ <h4>tree(cb)</h4>
+ <p><em>
+ </em> Fetches the {@link Tree} object for this Commit. Just a convenience method to
+ <em> call out to {@link Repository#tree}(commit.treeId).
+ </em> @param {Function} cb called when Tree has been fetched from repository.
+ * @see Tree</p>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Tree"><h3>Tree</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p><em>
+ </em> @class
+ <em> A Tree contains a list of named entries, which can either be {@link Blob}s or
+ </em> nested {@link Tree}s, each entry is referenced by its oid. A {@link Commit}
+ <em> owns a single {@link Tree}.
+ </em> @property {String} id object id of this Tree.
+ <em> @property {Tree.Entry} entries a list of all entries contained in this Tree.
+ </em> @see Blob
+ * @see Commit</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(@repository, obj)</h4>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Blob"><h3>Blob</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p><em>
+ </em> @class
+ <em> Contains raw data for a file stored in Git.
+ </em> @property {String} id object id of this Blob.
+ <em> @property {Buffer} data Node Buffer containing Blob data.
+ </em> @see Tree</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(@repository, obj)</h4>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Tag"><h3>Tag</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p><em>
+ </em> @class
+ <em> Git tags are similar to references, and indeed &quot;lightweight&quot; Git tags are
+ </em> actually implemented as References with a name prefix of &quot;tags/&quot;. When
+ <em> additional metadata is needed (message/name/email/GPG signature), a proper
+ </em> heavyweight Tag object is used.
+ <em> @property {String} id object id of this Tag.
+ </em> @property {String} name
+ <em> @property {String} message
+ </em> @property {Signature} tagger
+ <em> @property {String} targetId object id this Tag points to
+ </em> @property {String} type the type of object this Tag points to.</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(@repository, obj)</h4>
+
+ </div>
+
+ <div class="method">
+ <h4>target(cb)</h4>
+ <p><em>
+ </em> Convenience method to get the object this Tag points to. Shorthand for
+ <em> {@link Repository#object}(tag.targetId)
+ </em> @param {Function} cb called when target object has been loaded.
+ * @see Repository#object</p>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Remote"><h3>Remote</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p><em>
+ </em> @class
+ <em> Remotes designate the location and rules of remote Git repositories. Remotes
+ </em> can be obtained by using {@link Repository.remote}.
+ <em> @property {Boolean} connected true if there is an active connection to the
+ </em> Remotes&#39; endpoint.
+ <em> @property {String} name
+ </em> @property {String} url address of Remotes&#39; endpoint
+ <em> @property {Refspec} fetchSpec Refspec used when fetching from Remote
+ </em> @property {Refspec} pushSpec Refspec used when pushing to Remote
+ <em> @property {String} HEAD the remote HEAD reference name (only set after
+ </em> connected to Remote)
+ <em> @property {String[]} refs names of references on remote (only set after
+ </em> connected to Remote)
+ * @see Repository.remote</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(@repository, nativeRemote)</h4>
+
+ </div>
+
+ <div class="method">
+ <h4>connect()</h4>
+ <p><em>
+ </em> Opens a connection to the Remote endpoint. This is needed before
+ <em> {@link #fetch} or {@link #push} can be called.
+ </em> @param {String} direction The direction of the connection, must be either
+ <em> &quot;push&quot; or &quot;fetch&quot;.
+ </em> @param {Function} cb called when connection has been made, or fails.</p>
+
+ </div>
+
+ <div class="method">
+ <h4>fetch()</h4>
+ <p><em>
+ </em> Fetches Git objects from remote that do not exist locally.
+ <em> @param {Function} progressCb called to notify of progress with fetch process.
+ </em> @param {Function} cb called when fetch has been completed.</p>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Index"><h3>Index</h3></a>
+
+ </div>
+ <div class="class-content">
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(nativeIndex)</h4>
+ <ul>
+<li>@class</li>
+<li>The Git index is used to stage changed files before they are written to the </li>
+<li>repository proper. Bindings for the Index are currently minimal.</li>
+</ul>
+
+ </div>
+
+ <div class="method">
+ <h4>readTree()</h4>
+ <ul>
+<li>Updates the Git index to reflect the state of provided {@link Tree}.</li>
+<li>@param {String} id object id of Tree to be read.</li>
+<li>@param {Function} cb called when index update has been completed.</li>
+</ul>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Reference"><h3>Reference</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p><em>
+ </em> @class
+ <em> A Reference is a named pointer to a {@link Commit} object. That is, refs are
+ </em> the DNS of Git-land. References can either be direct or symbolic. Direct
+ <em> references point to the object id of a commit. Symbolic refs point to other
+ </em> references.
+ <em> @property {String} name
+ </em> @property {Boolean} direct true if Reference points directly to an object id.
+ <em> @property {Boolean} packed true if Reference is in a packfile
+ </em> @property {String} target object id reference points to, or another reference
+ <em> name if not a direct reference.
+ </em> @property {Repository} repository the {@link Repository} that owns this ref.
+ <em> @see Repository#reference
+ </em> @see Repository#createReference</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(repo, nativeRef)</h4>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ <div class="class">
+ <div class="header">
+ <a id="Repository"><h3>Repository</h3></a>
+
+ </div>
+ <div class="class-content">
+ <p><em>
+ </em> @class
+ <em> Represents a local Git repository that has been opened by Gitteh. Used to get
+ </em> access to any objects contained within it.
+ <em>
+ </em> Repositories can be bare - they will not have a working directory, in this
+ <em> case the contents of what is usually in a .git subdirectory will be in the
+ </em> top level.
+ <em> @property {Boolean} bare true if this repository is bare.
+ </em> @property {String} path location of the Git metadata directory
+ <em> @property {String} workingDirectory location of the working directory, if
+ </em> applicable (non-bare repository)
+ <em> @property {String[]} remotes names of remotes configured for this repository
+ </em> @property {String[]} references names of references contained in this
+ <em> repository.
+ </em> @property {Index} index The Git index for this repository.</p>
+
+ <div class="methods">
+
+
+ <div class="instancemethods">
+ <h3>Instance Methods</h3>
+
+ <div class="method">
+ <h4>constructor(nativeRepo)</h4>
+
+ </div>
+
+ <div class="method">
+ <h4>exists()</h4>
+ <p><em>
+ </em> Checks if an object with given objectid exists.
+ <em> @param {String} oid ID of object in question.
+ </em> @param {Function} cb Called with status of object existence.</p>
+
+ </div>
+
+ <div class="method">
+ <h4>object()</h4>
+ <ul>
+<li>Fetches an object with given ID. The object returned will be a Gitteh wrapper</li>
+<li>corresponding to the type of Git object fetched. Alternatively, objects with</li>
+<li>an expected type can be fetched using the {@link #blob}, {@link #commit},</li>
+<li>{@link #tag}, {@link #tree}, {@link #reference} methods.</li>
+<li>@param {String} oid id of object to be fetched.</li>
+<li>@param {Function} cb called when object has been fetched.</li>
+<li>@see Commit</li>
+<li>@see Blob</li>
+<li>@see Tag</li>
+<li>@see Tree</li>
+<li>@see Reference</li>
+</ul>
+
+ </div>
+
+ <div class="method">
+ <h4>blob(oid, cb)</h4>
+ <ul>
+<li>Fetches a {@link Blob} object from the repository. This is a stricter</li>
+<li>variant of {@link #object} - an error will be thrown if object isnt a blob.</li>
+<li>@param {String} oid id of blob to be fetched.</li>
+<li>@param {Function} cb called when blob has been fetched.</li>
+<li>@see #object</li>
+</ul>
+
+ </div>
+
+ <div class="method">
+ <h4>commit(oid, cb)</h4>
+ <p><em>
+ </em> Fetches a {@link Commit} object from the repository. This is a stricter
+ <em> variant of {@link #object} - an error will be thrown if object isnt a commit.
+ </em> @param {String} oid id of commit to be fetched.
+ <em> @param {Function} cb called when commit has been fetched.
+ </em> @see #object</p>
+
+ </div>
+
+ <div class="method">
+ <h4>tag(oid, cb)</h4>
+ <p><em>
+ </em> Fetches a {@link Tag} object from the repository. This is a stricter
+ <em> variant of {@link #object} - an error will be thrown if object isnt a tag.
+ </em> @param {String} oid id of tag to be fetched.
+ <em> @param {Function} cb called when tag has been fetched.
+ </em> @see #object</p>
+
+ </div>
+
+ <div class="method">
+ <h4>tree(oid, cb)</h4>
+ <p><em>
+ </em> Fetches a {@link Tree} object from the repository. This is a stricter
+ <em> variant of {@link #object} - an error will be thrown if object isnt a tree.
+ </em> @param {String} oid id of tree to be fetched.
+ <em> @param {Function} cb called when tree has been fetched.
+ </em> @see #object</p>
+
+ </div>
+
+ <div class="method">
+ <h4>reference()</h4>
+ <p><em>
+ </em> Fetches a {@link Reference} object from the repository. This is a stricter
+ <em> variant of {@link #object} - an error will be thrown if object isnt a ref.
+ </em> @param {String} oid id of reference to be fetched.
+ <em> @param {Function} cb called when reference has been fetched.
+ </em> @see #object</p>
+
+ </div>
+
+ <div class="method">
+ <h4>createReference()</h4>
+ <p><em>
+ </em> Creates a new reference, which can either by direct or symbolic.
+ <em> @param {String} name
+ </em> @param {String} target reference/oid targetted by the new reference.
+ <em> @param {Boolean} [force=false] force creation of this reference, destroying
+ </em> the reference with same name, if it exists.
+ <em> @param {Function} cb called when reference has been created.
+ </em> @see Reference</p>
+
+ </div>
+
+ <div class="method">
+ <h4>remote()</h4>
+ <p><em>
+ </em> Loads a remote with given name.
+ <em> @param {String} name
+ </em> @param {Function} cb called when remote has been loaded.</p>
+
+ </div>
+
+ <div class="method">
+ <h4>createRemote()</h4>
+ <p><em>
+ </em> Create a new {@link Remote} for this repository.
+ <em> @param {String} name
+ </em> @param {String} url
+ <em> @param {Function} cb called when Remote has been created.
+ </em> @see Remote</p>
+
+ </div>
+
+ </div>
+
+
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+
+ <div id="functions">
+ <h2>Functions</h2>
+
+ <div class="function">
+ <div class="header">
+ <a id="Gitteh.openRepository"><h3>Gitteh.openRepository()</h3></a>
+ </div>
+
+ <div>
+ <p><em>
+ </em> Opens a local Git repository.
+ <em> @param {String} path The path to the local git repo.
+ </em> @param {Function} cb Called when {@link Repository} has opened.
+ * @see Repository</p>
+
+ </div>
+
+ </div>
+
+ <div class="function">
+ <div class="header">
+ <a id="Gitteh.initRepository"><h3>Gitteh.initRepository()</h3></a>
+ </div>
+
+ <div>
+ <p><em>
+ </em> @param {String} path Path where new Git repository should be created.
+ <em> @param {Boolean} [bare=false] When true creates a bare repo. Bare repositories
+ have no working directory.
+ </em> @param {Function} cb Called when {@link Repository} has been created.
+ * Creates a new local Git repository.</p>
+
+ </div>
+
+ </div>
+
+ <div class="function">
+ <div class="header">
+ <a id="Gitteh.clone"><h3>Gitteh.clone()</h3></a>
+ </div>
+
+ <div>
+ <p><em>
+ </em> Clones a remote Git repository to the local machine. Currently, only HTTP/Git
+ <em> protocols are supported (no git+ssh yet).
+ </em> @param {String} url Address of remote Git repository.
+ * @param {String} path Destination path for cloned repository.</p>
+
+ </div>
+
+ </div>
+
+
+
+ <div class="function">
+ <div class="header">
+ <a id="_getPrivate"><h3>_getPrivate(obj)</h3></a>
+ </div>
+
+ </div>
+
+ <div class="function">
+ <div class="header">
+ <a id="_createPrivate"><h3>_createPrivate(obj)</h3></a>
+ </div>
+
+ </div>
+
+ <div class="function">
+ <div class="header">
+ <a id="_wrapCallback"><h3>_wrapCallback(orig, cb)</h3></a>
+ </div>
+
+ </div>
+
+ <div class="function">
+ <div class="header">
+ <a id="_immutable"><h3>_immutable(obj, src)</h3></a>
+ </div>
+
+ </div>
+
+
+ </div>
+
+ </div>
+ </div>
+</body>
+</html>
View
27 src/args.coffee
@@ -46,20 +46,29 @@ module.exports = fn = (params) ->
throw new TypeError "#{param.name} (#{argn}) is not a valid #{param.type}"
ret.push arg
return ret
+
+
+fn.oidRegex = oidRegex = /^[a-zA-Z0-9]{0,40}$/
+objectTypes = ["any", "blob", "commit", "tag", "tree"]
+remoteDirs = ["push", "fetch"]
+
fn.validators =
string: (val) ->
return typeof val is "string"
+
function: (val) -> return typeof val is "function"
+
bool: (val) ->
return typeof val is "boolean"
-###
-myfn = ->
- [path, bare, cb] = fn
- path: type: "string"
- bare: type: "bool", default: false
- cb: type: "function"
- console.log path, bare, cb
+ oid: (val) ->
+ return false if typeof val isnt "string"
+ return false if not oidRegex.test val
+ return false if val.length < fn.minOidLength
+ return true
+
+ objectType: (val) ->
+ return objectTypes.indexOf val > -1
-myfn "awesome", "zzz"
-###
+ remoteDir: (val) ->
+ return remoteDirs.indexOf val > -1
View
1,117 src/gitteh.coffee
@@ -1,3 +1,7 @@
+###
+Omg gitteh is freakin' sweet!
+###
+
{EventEmitter} = require "events"
async = require "async"
fs = require "fs"
@@ -11,45 +15,31 @@ bindings = require "../build/#{env}/gitteh"
(require "segfault-handler").registerHandler() if env is "Debug"
{minOidLength, types, NativeRepository, NativeRemote} = bindings
+args.minOidLength = minOidLength
-###*
- * @namespace
-###
Gitteh = module.exports = {}
-###*
- * @ignore
-###
-getPrivate = (obj) ->
- getPrivate.lock++
+_getPrivate = (obj) ->
+ _getPrivate.lock++
return obj._private
-getPrivate.lock = 0
+_getPrivate.lock = 0
-###*
- * @ignore
-###
-createPrivate = (obj) ->
+_createPrivate = (obj) ->
_priv = {}
Object.defineProperty obj, "_private",
enumerable: false
configurable: false
get: ->
- throw new Error "Bad request" if not getPrivate.lock--
+ throw new Error "Bad request" if not _getPrivate.lock--
return _priv
return _priv
-###*
- * @ignore
-###
-wrapCallback = (orig, cb) ->
+_wrapCallback = (orig, cb) ->
return (err) ->
return orig err if err?
cb.apply null, Array.prototype.slice.call arguments, 1
-###*
- * @ignore
-###
-immutable = (obj, src) ->
+_immutable = (obj, src) ->
return o = {
set: (name, target = name) ->
if Array.isArray src[name]
@@ -66,26 +56,6 @@ immutable = (obj, src) ->
return o
}
-oidRegex = /^[a-zA-Z0-9]{0,40}$/
-args.validators.oid = (val) ->
- return false if typeof val isnt "string"
- return false if not oidRegex.test val
- return false if val.length < minOidLength
- return true
-
-objectTypes = ["any", "blob", "commit", "tag", "tree"]
-args.validators.objectType = (val) ->
- return objectTypes.indexOf val > -1
-
-remoteDirs = ["push", "fetch"]
-args.validators.remoteDir = (val) ->
- return remoteDirs.indexOf val > -1
-
-checkOid = (str, allowLookup = true) ->
- throw new TypeError "OID should be a string" if typeof str isnt "string"
- throw new TypeError "Invalid OID" if not oidRegex.test str
- throw new Error "OID is too short" if str.length < bindings.minOidLength
- throw new TypeError "Invalid OID" if not allowLookup and str.length isnt 40
###*
* @class
@@ -98,13 +68,13 @@ checkOid = (str, allowLookup = true) ->
* @see Commit
* @see Tag
###
-Signature = Gitteh.Signature = (obj) ->
- immutable(@, obj)
- .set("name")
- .set("email")
- .set("time")
- .set("offset")
- return @
+Gitteh.Signature = class Signature
+ constructor: (obj) ->
+ _immutable(@, obj)
+ .set("name")
+ .set("email")
+ .set("time")
+ .set("offset")
###*
* @class
@@ -115,451 +85,504 @@ Signature = Gitteh.Signature = (obj) ->
* @see Remote
* @see Reference
###
-Refspec = Gitteh.Refspec = (src, dst) ->
- _priv = createPrivate @
-
- _priv.srcRoot = if src? and src[-1..] is "*" then src[0...-1] else src
- _priv.dstRoot = if dst? and dst[-1..] is "*" then dst[0...-1] else dst
-
- immutable(@, {src, dst})
- .set("src")
- .set("dst")
- return @
-
-###*
- * Determines if provided reference name matches source of this Refspec.
- * @param {String} refName
- * @return {Boolean} true if provided refName matches src of Refspec.
-###
-Refspec.prototype.matchesSrc = (refName) ->
- _priv = getPrivate @
- return false if refName.length <= _priv.srcRoot.length
- return refName.indexOf(_priv.srcRoot) is 0
-
-###*
- * Determines if provided reference name matches destination of this Refspec.
- * @param {String} refName
- * @return {Boolean} true if provided refName matches dst of Refspec.
-###
-Refspec.prototype.matchesDst = (refName) ->
- _priv = getPrivate @
- return false if refName.length <= _priv.dstRoot.length
- return refName.indexOf(_priv.dstRoot) is 0
-
-###*
- * Transforms provided refName to destination, provided it matches src pattern.
- * @param {String} refName
- * @throws {Error} if refName doesn't match src pattern.
- * @return {String} transformed reference name.
-###
-Refspec.prototype.transformTo = (refName) ->
- throw new Error "Ref doesn't match src." if not @matchesSrc refName
- return "#{@dst[0...-2]}#{refName[(@src.length-2)..]}"
-
-###*
- * Transforms provided refName from destination back to source, provided it
- * matches dst pattern. This is the reverse of {@link #transformTo}.
- * @param {String} refName
- * @throws {Error} if refName doesn't match dst pattern.
- * @return {String} (un?)transformed reference name.
-###
-Refspec.prototype.transformFrom = (refName) ->
- throw new Error "Ref doesn't match dst." if not @matchesDst refName
- return "#{@src[0...-2]}#{refName[(@dst.length-2)..]}"
-
-###*
- @class
- * A commit made by a author (and optional different committer), with a message,
- * a {Tree} and zero or more parent {@link Commit} objects.
- * @property {String} id object id of this Commit.
- * @property {String} treeId object id of {@link Tree} for this Commit.
- * @property {Commit[]} parents parent Commits of this Commit (more than one
- * means a merge-commit).
- * @property {String} message
- * @property {String} messageEncoding
- * @property {Signature} author
- * @property {Signature} committer
-###
-Commit = Gitteh.Commit = (@repository, obj) ->
- obj.author = new Signature obj.author
- obj.committer = new Signature obj.committer
- immutable(@, obj)
- .set("id")
- .set("tree", "treeId")
- .set("parents")
- .set("message")
- .set("messageEncoding")
- .set("author")
- .set("committer")
- return @
-
-###*
- * Fetches the {@link Tree} object for this Commit. Just a convenience method to
- * call out to {@link Repository#tree}(commit.treeId).
- * @param {Function} cb called when Tree has been fetched from repository.
- * @see Tree
-###
-Commit.prototype.tree = (cb) ->
- @repository.tree @treeId, cb
-
-###*
- * @class
- * A Tree contains a list of named entries, which can either be {@link Blob}s or
- * nested {@link Tree}s, each entry is referenced by its oid. A {@link Commit}
- * owns a single {@link Tree}.
- * @property {String} id object id of this Tree.
- * @property {Tree.Entry} entries a list of all entries contained in this Tree.
- * @see Blob
- * @see Commit
-###
-Tree = Gitteh.Tree = (@repository, obj) ->
- obj._entries = obj.entries
- obj.entries = []
- for origEntry in obj._entries
- obj.entries.push entry = {}
- immutable(entry, origEntry)
+Gitteh.Refspec = class Refspec
+ constructor: (src, dst) ->
+ _priv = _createPrivate @
+
+ _priv.srcRoot = if src? and src[-1..] is "*" then src[0...-1] else src
+ _priv.dstRoot = if dst? and dst[-1..] is "*" then dst[0...-1] else dst
+
+ _immutable(@, {src, dst})
+ .set("src")
+ .set("dst")
+ matchesSrc: (refName) ->
+ ###
+ * Determines if provided reference name matches source of this Refspec.
+ * @param {String} refName
+ * @return {Boolean} true if provided refName matches src of Refspec.
+ ###
+ _priv = _getPrivate @
+ return false if refName.length <= _priv.srcRoot.length
+ return refName.indexOf(_priv.srcRoot) is 0
+
+ matchesDst: (refName) ->
+ ###
+ * Determines if provided reference name matches destination of this Refspec.
+ * @param {String} refName
+ * @return {Boolean} true if provided refName matches dst of Refspec.
+ ###
+ _priv = _getPrivate @
+ return false if refName.length <= _priv.dstRoot.length
+ return refName.indexOf(_priv.dstRoot) is 0
+
+ transformTo: (refName) ->
+ ###
+ * Transforms provided refName to destination, provided it matches src pattern.
+ * @param {String} refName
+ * @throws {Error} if refName doesn't match src pattern.
+ * @return {String} transformed reference name.
+ ###
+ throw new Error "Ref doesn't match src." if not @matchesSrc refName
+ return "#{@dst[0...-2]}#{refName[(@src.length-2)..]}"
+
+ transformFrom: (refName) ->
+ ###
+ * Transforms provided refName from destination back to source, provided it
+ * matches dst pattern. This is the reverse of {@link #transformTo}.
+ * @param {String} refName
+ * @throws {Error} if refName doesn't match dst pattern.
+ * @return {String} (un?)transformed reference name.
+ ###
+ throw new Error "Ref doesn't match dst." if not @matchesDst refName
+ return "#{@src[0...-2]}#{refName[(@dst.length-2)..]}"
+
+Gitteh.Commit = class Commit
+ ###
+ A commit made by a author (and optional different committer) with a message,
+ a {Tree} and zero or more parent {@link Commit} objects.
+ @property {String} id object id of this Commit.
+ @property {String} treeId object id of {@link Tree} for this Commit.
+ @property {Commit[]} parents parent Commits of this Commit (more than one
+ means a merge-commit).
+ @property {String} message
+ @property {String} messageEncoding
+ @property {Signature} author
+ @property {Signature} committer
+ ###
+ constructor: (@repository, obj) ->
+ obj.author = new Signature obj.author
+ obj.committer = new Signature obj.committer
+ _immutable(@, obj)
+ .set("id")
+ .set("tree", "treeId")
+ .set("parents")
+ .set("message")
+ .set("messageEncoding")
+ .set("author")
+ .set("committer")
+ tree: (cb) ->
+ ###*
+ * Fetches the {@link Tree} object for this Commit. Just a convenience method to
+ * call out to {@link Repository#tree}(commit.treeId).
+ * @param {Function} cb called when Tree has been fetched from repository.
+ * @see Tree
+ ###
+ @repository.tree @treeId, cb
+
+Gitteh.Tree = class Tree
+ ###*
+ * @class
+ * A Tree contains a list of named entries, which can either be {@link Blob}s or
+ * nested {@link Tree}s, each entry is referenced by its oid. A {@link Commit}
+ * owns a single {@link Tree}.
+ * @property {String} id object id of this Tree.
+ * @property {Tree.Entry} entries a list of all entries contained in this Tree.
+ * @see Blob
+ * @see Commit
+ ###
+ ###*
+ * @class
+ * @name Tree.Entry
+ * @property {String} id id of object this entry points to.
+ * @property {String} name
+ * @property {String} type kind of object pointed to by this entry (commit/blob)
+ * @property {Integer} attributes UNIX file attributes for this entry.
+ ###
+ constructor: (@repository, obj) ->
+ obj._entries = obj.entries
+ obj.entries = []
+ for origEntry in obj._entries
+ obj.entries.push entry = {}
+ _immutable(entry, origEntry)
+ .set("id")
+ .set("name")
+ .set("type")
+ .set("attributes")
+ _immutable(@, obj)
+ .set("id")
+ .set("entries")
+
+Gitteh.Blob = class Blob
+ ###*
+ * @class
+ * Contains raw data for a file stored in Git.
+ * @property {String} id object id of this Blob.
+ * @property {Buffer} data Node Buffer containing Blob data.
+ * @see Tree
+ ###
+ constructor: (@repository, obj) ->
+ _immutable(@, obj)
+ .set("id")
+ .set("data")
+
+Gitteh.Tag = class Tag
+ ###*
+ * @class
+ * Git tags are similar to references, and indeed "lightweight" Git tags are
+ * actually implemented as References with a name prefix of "tags/". When
+ * additional metadata is needed (message/name/email/GPG signature), a proper
+ * heavyweight Tag object is used.
+ * @property {String} id object id of this Tag.
+ * @property {String} name
+ * @property {String} message
+ * @property {Signature} tagger
+ * @property {String} targetId object id this Tag points to
+ * @property {String} type the type of object this Tag points to.
+ ###
+ constructor: (@repository, obj) ->
+ obj.tagger = new Signature obj.tagger
+ _immutable(@, obj)
.set("id")
.set("name")
+ .set("message")
+ .set("tagger")
+ .set("target", "targetId")
.set("type")
- .set("attributes")
- immutable(@, obj)
- .set("id")
- .set("entries")
- return @
-
-###*
- * @class
- * @name Tree.Entry
- * @property {String} id id of object this entry points to.
- * @property {String} name
- * @property {String} type kind of object pointed to by this entry (commit/blob)
- * @property {Integer} attributes UNIX file attributes for this entry.
-###
-
-###*
- * @class
- * Contains raw data for a file stored in Git.
- * @property {String} id object id of this Blob.
- * @property {Buffer} data Node Buffer containing Blob data.
- * @see Tree
-###
-Blob = Gitteh.Blob = (@repository, obj) ->
- immutable(@, obj)
- .set("id")
- .set("data")
- return @
-
-###*
- * @class
- * Git tags are similar to references, and indeed "lightweight" Git tags are
- * actually implemented as References with a name prefix of "tags/". When
- * additional metadata is needed (message/name/email/GPG signature), a proper
- * heavyweight Tag object is used.
- * @property {String} id object id of this Tag.
- * @property {String} name
- * @property {String} message
- * @property {Signature} tagger
- * @property {String} targetId object id this Tag points to
- * @property {String} type the type of object this Tag points to.
-###
-Tag = Gitteh.Tag = (@repository, obj) ->
- obj.tagger = new Signature obj.tagger
- immutable(@, obj)
- .set("id")
- .set("name")
- .set("message")
- .set("tagger")
- .set("target", "targetId")
- .set("type")
- return @
-
-###*
- * Convenience method to get the object this Tag points to. Shorthand for
- * {@link Repository#object}(tag.targetId)
- * @param {Function} cb called when target object has been loaded.
- * @see Repository#object
-###
-Tag.prototype.target = (cb) ->
- @repository.object @targetId, @type, cb
-
-###*
- * @class
- * Remotes designate the location and rules of remote Git repositories. Remotes
- * can be obtained by using {@link Repository.remote}.
- * @property {Boolean} connected true if there is an active connection to the
- * Remotes' endpoint.
- * @property {String} name
- * @property {String} url address of Remotes' endpoint
- * @property {Refspec} fetchSpec Refspec used when fetching from Remote
- * @property {Refspec} pushSpec Refspec used when pushing to Remote
- * @property {String} HEAD the remote HEAD reference name (only set after
- * connected to Remote)
- * @property {String[]} refs names of references on remote (only set after
- * connected to Remote)
- * @see Repository.remote
-###
-Remote = Gitteh.Remote = (@repository, nativeRemote) ->
- _priv = createPrivate @
- _priv.native = nativeRemote
- _priv.connected = false
-
- if nativeRemote not instanceof NativeRemote
- throw new Error "Don't construct me, see Repository.remote()"
-
- Object.defineProperty @, "connected",
- get: -> return _priv.connected
- enumerable: true
- configurable: false
-
- immutable(@, nativeRemote)
- .set("name")
- .set("url")
-
- fetchSpec = new Refspec nativeRemote.fetchSpec.src, nativeRemote.fetchSpec.dst
- pushSpec = new Refspec nativeRemote.pushSpec.src, nativeRemote.pushSpec.dst
- immutable(@, {fetchSpec, pushSpec})
- .set("fetchSpec")
- .set("pushSpec")
- return @
-
-###*
- * Opens a connection to the Remote endpoint. This is needed before
- * {@link #fetch} or {@link #push} can be called.
- * @param {String} direction The direction of the connection, must be either
- * "push" or "fetch".
- * @param {Function} cb called when connection has been made, or fails.
-###
-Remote.prototype.connect = ->
- _priv = getPrivate @
- [dir, cb] = args
- dir: type: "remoteDir"
- cb: type: "function"
- dir = if dir is "push" then bindings.GIT_DIRECTION_PUSH else bindings.GIT_DIRECTION_FETCH
- _priv.native.connect dir, wrapCallback cb, (refs) =>
- refNames = Object.keys refs
-
- # Determine symref for HEAD.
- headOid = refs["HEAD"]
- for ref, oid of refs
- continue if ref is "HEAD"
- if oid is headOid
- headRef = @fetchSpec.transformTo ref
- immutable(@, {headRef}).set "headRef", "HEAD"
- break
-
- immutable(@, {refNames}).set "refNames", "refs"
- _priv.connected = true
- cb()
-
-###*
- * Fetches Git objects from remote that do not exist locally.
- * @param {Function} progressCb called to notify of progress with fetch process.
- * @param {Function} cb called when fetch has been completed.
-###
-Remote.prototype.fetch = ->
- _priv = getPrivate @
- throw new Error "Remote isn't connected." if not @connected
- [progressCb, cb] = args
- progressCb: type: "function"
- cb: type: "function"
-
- updateTimer = null
- update = =>
- {bytes, total, done} = _priv.native.stats
- progressCb bytes, total, done
- updateTimer = setTimeout update, 500
- setTimeout update, 500
-
- _priv.native.download (err) =>
- clearTimeout updateTimer
- return cb err if err?
- _priv.native.updateTips wrapCallback cb, =>
+ target: (cb) ->
+ ###*
+ * Convenience method to get the object this Tag points to. Shorthand for
+ * {@link Repository#object}(tag.targetId)
+ * @param {Function} cb called when target object has been loaded.
+ * @see Repository#object
+ ###
+ @repository.object @targetId, @type, cb
+
+Gitteh.Remote = class Remote
+ ###*
+ * @class
+ * Remotes designate the location and rules of remote Git repositories. Remotes
+ * can be obtained by using {@link Repository.remote}.
+ * @property {Boolean} connected true if there is an active connection to the
+ * Remotes' endpoint.
+ * @property {String} name
+ * @property {String} url address of Remotes' endpoint
+ * @property {Refspec} fetchSpec Refspec used when fetching from Remote
+ * @property {Refspec} pushSpec Refspec used when pushing to Remote
+ * @property {String} HEAD the remote HEAD reference name (only set after
+ * connected to Remote)
+ * @property {String[]} refs names of references on remote (only set after
+ * connected to Remote)
+ * @see Repository.remote
+ ###
+ constructor: (@repository, nativeRemote) ->
+ _priv = _createPrivate @
+ _priv.native = nativeRemote
+ _priv.connected = false
+
+ if nativeRemote not instanceof NativeRemote
+ throw new Error "Don't construct me, see Repository.remote()"
+
+ Object.defineProperty @, "connected",
+ get: -> return _priv.connected
+ enumerable: true
+ configurable: false
+
+ _immutable(@, nativeRemote)
+ .set("name")
+ .set("url")
+
+ fetchSpec = new Refspec nativeRemote.fetchSpec.src, nativeRemote.fetchSpec.dst
+ pushSpec = new Refspec nativeRemote.pushSpec.src, nativeRemote.pushSpec.dst
+ _immutable(@, {fetchSpec, pushSpec})
+ .set("fetchSpec")
+ .set("pushSpec")
+
+ connect: ->
+ ###*
+ * Opens a connection to the Remote endpoint. This is needed before
+ * {@link #fetch} or {@link #push} can be called.
+ * @param {String} direction The direction of the connection, must be either
+ * "push" or "fetch".
+ * @param {Function} cb called when connection has been made, or fails.
+ ###
+ _priv = _getPrivate @
+ [dir, cb] = args
+ dir: type: "remoteDir"
+ cb: type: "function"
+ dir = if dir is "push" then bindings.GIT_DIRECTION_PUSH else bindings.GIT_DIRECTION_FETCH
+ _priv.native.connect dir, _wrapCallback cb, (refs) =>
+ refNames = Object.keys refs
+
+ # Determine symref for HEAD.
+ headOid = refs["HEAD"]
+ for ref, oid of refs
+ continue if ref is "HEAD"
+ if oid is headOid
+ headRef = @fetchSpec.transformTo ref
+ _immutable(@, {headRef}).set "headRef", "HEAD"
+ break
+
+ _immutable(@, {refNames}).set "refNames", "refs"
+ _priv.connected = true
cb()
-###*
- * @class
- * The Git index is used to stage changed files before they are written to the
- * repository proper. Bindings for the Index are currently minimal.
-###
-Index = Gitteh.Index = (nativeIndex) ->
- _priv = createPrivate @
- _priv.native = nativeIndex
- return @
-
-###*
- * Updates the Git index to reflect the state of provided {@link Tree}.
- * @param {String} id object id of Tree to be read.
- * @param {Function} cb called when index update has been completed.
-###
-Index.prototype.readTree = () ->
- _priv = getPrivate @
- [id, cb] = args
- id: type: "oid"
- cb: type: "function"
- _priv.native.readTree id, cb
-
-###*
- * Synchronizes the in-memory Git index with the indexfile located in repository
- * @param {Function} cb called when synchronization is complete.
-###
-Index.prototype.write = ->
- _priv = getPrivate @
- [cb] = args
- cb: type: "function"
- _priv.native.write cb
-
-###*
- * @class
- * A Reference is a named pointer to a {@link Commit} object. That is, refs are
- * the DNS of Git-land. References can either be direct or symbolic. Direct
- * references point to the object id of a commit. Symbolic refs point to other
- * references.
- * @property {String} name
- * @property {Boolean} direct true if Reference points directly to an object id.
- * @property {Boolean} packed true if Reference is in a packfile
- * @property {String} target object id reference points to, or another reference
- * name if not a direct reference.
- * @property {Repository} repository the {@link Repository} that owns this ref.
- * @see Repository#reference
- * @see Repository#createReference
-###