anchor.diff:    open Git
     
     type Arguments =
  +    | WorkingArea of bool
       | BaseUri of string
       | Path of string
       | Since of string
     with interface IArgParserTemplate with
       member s.Usage =
         match s with
  +        | WorkingArea b -> "Show prov activity for uncommitted and staged "
           | BaseUri s -> "Base uri for generated provenence"
           | Path p -> "Path to a git repository"
           | Since r -> "Commit ref to generate PROV from"
           
     [<EntryPoint>]
     let main argv = 
  -    let parser = UnionArgParser.Create<Arguments>()
  +    let parser = UnionArgParser.Create<Arguments> ()
       let args = parser.Parse argv
       let repo = repo (args.GetResult (<@ Path @>,defaultValue="."))
  -    use fout = new System.IO.StreamWriter (System.Console.OpenStandardOutput())
  +    use fout = new System.IO.StreamWriter (System.Console.OpenStandardOutput ())
       use g = new VDS.RDF.Graph ()
  +
       TTL.ns.add (g,repo) 
  -    repo
  -    |> commits (args.GetResult (<@ Since @>,defaultValue="HEAD"))
  -    |> Seq.pairwise
  -    |> Seq.map (Prov.Activity.fromCommit repo)
  -    |> Seq.map (TTL.fromActivity g)
  -    |> Seq.last
  -    |> TTL.ttl fout
  +
  +    let showWorkingArea ax = seq {
  +      match args.GetResult (<@ WorkingArea @>,defaultValue=false) with
  +      | true -> yield Prov.Activity.fromWorkingArea repo (Git.workingArea repo)
  +      | false -> ()
  +
  +      yield! ax
  +    }
  +    repo |> commits (args.GetResult (<@ Since @>,defaultValue="HEAD"))
  +         |> Seq.pairwise
  +         |> Seq.map (Prov.Activity.fromCommit repo)
  +         |> showWorkingArea
  +         |> Seq.map (TTL.fromActivity g)
  +         |> Seq.last
  +         |> TTL.ttl fout
       
       0// return an integer exit code
   
  
positive.code:   let short sha = function
      | Repository r ->
        r.ObjectDatabase.ShortenObjectId sha
  
   
    type Uri =
      | Uri of string 
      with static member commit r c = Uri (sprintf "commit/%s" (short c r))
           static member identity (c:LibGit2Sharp.Commit) = Uri (sprintf "user/%s" c.Author.Email)
           static member versionedcontent (c,p) = Uri (sprintf "commit/%s/%s" c p)
           static member individual (r,f:LibGit2Sharp.TreeEntryChanges) = Uri (f.Path)
           override x.ToString () = match x with | Uri s -> sprintf "base:%s" s 
           
    type FileVersion = {
      Id : Uri
      Content : string
      PreviousVersion : string option
      SpecialisationOf : Uri
      Commit : Uri
      AttributedTo : Uri
      }
    with static member from (c:LibGit2Sharp.Commit) (c':LibGit2Sharp.Commit) r = seq {
      let d = diff (c.Tree,c'.Tree) r
      for f in d.Modified do yield {
        Id = Uri.versionedcontent (f.Oid.Sha,f.Path)  
        Content = ""
        PreviousVersion = Some f.OldOid.Sha 
        SpecialisationOf = Uri.individual (r,f) 
        Commit = Uri.commit r c
        AttributedTo = Uri.identity c 
        }
      }
    
    type Activity = {
      Id : Uri
  
negative.code:     | Commit of LibGit2Sharp.Commit
      
    type Repository =
      | Repository of LibGit2Sharp.Repository
  
    type WorkingArea =
      | WorkingArea of StatusEntry list * Commit
  
    let repo p = Repository  ( new LibGit2Sharp.Repository (p) )
  
  