Commits

Stefan Saasen committed d22d263

Add various haddock comments

Comments (0)

Files changed (4)

 Synopsis:           Exploring git in Haskell
 Category:           Development
 Description:        Exploring git, the git transfer protocols and the object store in Haskell
-Homepage:           https://bitbucket.org/ssaasen/git-bottom-up
+                    See <http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/> for futher information.
+Homepage:           https://bitbucket.org/ssaasen/git-clone-in-haskell-from-the-bottom-up
 Cabal-Version:      >= 1.6
 Build-Type:         Simple
 
 Source-Repository   head
   Type:             git
-  Location:         git@bitbucket.org:ssaasen/git-bottom-up.git
+  Location:         git@bitbucket.org:ssaasen/git-clone-in-haskell-from-the-bottom-up.git
 
 Flag                small_base
   Description:      Choose the new, split-up base package.

src/Git/Common.hs

   , flushPkt
   , isMsbSet
   , eitherToMaybe
+  , fromOctets
   , GitRepository(..)
   , Ref(..)
   , ObjectId
   , WithRepository
-  , fromOctets
 ) where
 
 import qualified Data.ByteString.Char8 as C

src/Git/Remote/Operations.hs

 {-# LANGUAGE OverloadedStrings, BangPatterns, RecordWildCards #-}
 
+-- | Provide a number of high level commands/operations like clone or
+-- ls-remote.
 module Git.Remote.Operations (
-    clone
+    -- * Types
+    Remote(..)
+    -- * Commands
+  , clone
   , lsRemote
+    -- * Helper functions
   , parseRemote
-  , Remote(..)
 ) where
 
 import qualified Data.Attoparsec.Char8 as AC
 import Git.Store.ObjectStore
 import Git.Repository
 
+-- | The remote repository identified by the host, port and repository path.
 data Remote = Remote {
     getHost         :: String
   , getPort         :: Maybe Int
 } deriving (Eq, Show)
 
 -- | Parse a URL that is using the git protocol format.
--- E.g. git://git.apache.org:9418/foo.git
+-- E.g. @git://git.apache.org:9418/foo.git@
 --
 -- Schema:
---   * git://host.xz[:port]/path/to/repo.git/
---   * git://host.xz[:port]/~[user]/path/to/repo.git/
 --
--- See the "GIT URLS" section on
--- http://www.kernel.org/pub/software/scm/git/docs/git-clone.html
+--   * @git://host.xz[:port]/path/to/repo.git/@
+--
+--   * @git://host.xz[:port]/~[user]/path/to/repo.git/@
+--
+-- See the /GIT URLS/ section on
+-- <http://www.kernel.org/pub/software/scm/git/docs/git-clone.html>
 parseRemote :: B.ByteString -> Maybe Remote
 parseRemote = eitherToMaybe . AC.parseOnly parser
     where parser = do
-module Main where
+
+-- | Provides the main entry point and supports the following commands:
+--
+--  * @clone@ - Clone a remote repository using the native git protocol.
+--              Similar to the @git clone@ command.
+--  
+--  * @ls-remote@ - List references in a remote repository.
+--
+--  * @unpack@ - Unpack a pack file into a bare repository.
+--
+--  * @read-index@ - Read a @.git/index@ file and show the index entries.
+module Main (main, run) where
 
 import System.Environment       (getArgs)
 import Data.Maybe               (listToMaybe)