This file is indexed.

/usr/share/doc/libghc-hit-doc/html/hit.txt is in libghc-hit-doc 0.6.3-5build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Git operations in haskell
--   
--   An haskell implementation of git storage operations, allowing users to
--   manipulate git repositories (read and write).
--   
--   This implementation is fully interoperable with the main C
--   implementation.
--   
--   This is stricly only manipulating the git store (what's inside the
--   .git directory), and doesn't do anything with the index or your
--   working directory files.
@package hit
@version 0.6.3


module Data.Git.Delta

-- | a delta is a source size, a destination size and a list of delta cmd
data Delta
Delta :: Word64 -> Word64 -> [DeltaCmd] -> Delta

-- | possible commands in a delta
data DeltaCmd
DeltaCopy :: ByteString -> DeltaCmd
DeltaSrc :: Word64 -> Word64 -> DeltaCmd

-- | parse a delta. format is 2 variable sizes, followed by delta cmds. for
--   each cmd: * if first byte MSB is set, we copy from source. *
--   otherwise, we copy from delta. * extensions are not handled.
deltaParse :: Parser ByteString Delta

-- | read one delta from a lazy bytestring.
deltaRead :: ByteString -> Maybe Delta

-- | apply a delta on a lazy bytestring, returning a new bytestring.
deltaApply :: ByteString -> Delta -> ByteString
instance GHC.Classes.Eq Data.Git.Delta.Delta
instance GHC.Show.Show Data.Git.Delta.Delta
instance GHC.Classes.Eq Data.Git.Delta.DeltaCmd
instance GHC.Show.Show Data.Git.Delta.DeltaCmd


module Data.Git.Revision

-- | A git revision. this can be many things: * a shorten ref * a ref * a
--   named branch or tag followed by optional modifiers <a>RevModifier</a>
--   that can represent: * parenting * type * date
data Revision
Revision :: String -> [RevModifier] -> Revision

-- | A modifier to a revision, which is a function apply of a revision
data RevModifier

-- | parent accessor ^<a>n</a> and ^
RevModParent :: Int -> RevModifier

-- | parent accessor ~<a>n</a>
RevModParentFirstN :: Int -> RevModifier

-- | @{type} accessor
RevModAtType :: String -> RevModifier

-- | @{date} accessor
RevModAtDate :: String -> RevModifier

-- | @{n} accessor
RevModAtN :: Int -> RevModifier

-- | Exception when a revision cannot be resolved to a reference
data RevisionNotFound
RevisionNotFound :: Revision -> RevisionNotFound
fromString :: IsString a => String -> a
instance Data.Data.Data Data.Git.Revision.RevisionNotFound
instance GHC.Classes.Eq Data.Git.Revision.RevisionNotFound
instance GHC.Show.Show Data.Git.Revision.RevisionNotFound
instance Data.Data.Data Data.Git.Revision.Revision
instance GHC.Classes.Eq Data.Git.Revision.Revision
instance Data.Data.Data Data.Git.Revision.RevModifier
instance GHC.Classes.Eq Data.Git.Revision.RevModifier
instance GHC.Show.Show Data.Git.Revision.RevModifier
instance GHC.Show.Show Data.Git.Revision.Revision
instance Data.String.IsString Data.Git.Revision.Revision


module Data.Git.Ref

-- | represent a git reference (SHA1)
data Ref

-- | Invalid Reference exception raised when using something that is not a
--   ref as a ref.
data RefInvalid
RefInvalid :: ByteString -> RefInvalid

-- | Reference wasn't found
data RefNotFound
RefNotFound :: Ref -> RefNotFound
isHex :: ByteString -> Bool
isHexString :: [Char] -> Bool

-- | take a hexadecimal bytestring that represent a reference and turn into
--   a ref
fromHex :: ByteString -> Ref

-- | take a hexadecimal string that represent a reference and turn into a
--   ref
fromHexString :: String -> Ref

-- | transform a bytestring that represent a binary bytestring and returns
--   a ref.
fromBinary :: ByteString -> Ref

-- | turn a reference into a binary bytestring
toBinary :: Ref -> ByteString

-- | transform a ref into an hexadecimal bytestring
toHex :: Ref -> ByteString

-- | transform a ref into an hexadecimal string
toHexString :: Ref -> String

-- | returns the prefix (leading byte) of this reference
refPrefix :: Ref -> Int

-- | compare prefix
cmpPrefix :: String -> Ref -> Ordering

-- | returns the splitted format "prefix/suffix" for addressing the loose
--   object database
toFilePathParts :: Ref -> (String, String)

-- | hash a bytestring into a reference
hash :: ByteString -> Ref

-- | hash a lazy bytestring into a reference
hashLBS :: ByteString -> Ref
instance Data.Data.Data Data.Git.Ref.RefNotFound
instance GHC.Classes.Eq Data.Git.Ref.RefNotFound
instance GHC.Show.Show Data.Git.Ref.RefNotFound
instance Data.Data.Data Data.Git.Ref.RefInvalid
instance GHC.Classes.Eq Data.Git.Ref.RefInvalid
instance GHC.Show.Show Data.Git.Ref.RefInvalid
instance Data.Data.Data Data.Git.Ref.Ref
instance GHC.Classes.Ord Data.Git.Ref.Ref
instance GHC.Classes.Eq Data.Git.Ref.Ref
instance GHC.Show.Show Data.Git.Ref.Ref
instance GHC.Exception.Exception Data.Git.Ref.RefInvalid
instance GHC.Exception.Exception Data.Git.Ref.RefNotFound


module Data.Git.Types

-- | type of a git object.
data ObjectType
TypeTree :: ObjectType
TypeBlob :: ObjectType
TypeCommit :: ObjectType
TypeTag :: ObjectType
TypeDeltaOff :: ObjectType
TypeDeltaRef :: ObjectType

-- | Represent a root tree with zero to many tree entries.
data Tree
Tree :: [TreeEnt] -> Tree
[treeGetEnts] :: Tree -> [TreeEnt]

-- | Represent a commit object.
data Commit
Commit :: Ref -> [Ref] -> Person -> Person -> Maybe ByteString -> [CommitExtra] -> ByteString -> Commit
[commitTreeish] :: Commit -> Ref
[commitParents] :: Commit -> [Ref]
[commitAuthor] :: Commit -> Person
[commitCommitter] :: Commit -> Person
[commitEncoding] :: Commit -> Maybe ByteString
[commitExtras] :: Commit -> [CommitExtra]
[commitMessage] :: Commit -> ByteString
data CommitExtra
CommitExtra :: ByteString -> ByteString -> CommitExtra
[commitExtraKey] :: CommitExtra -> ByteString
[commitExtraValue] :: CommitExtra -> ByteString

-- | Represent a binary blob.
data Blob
Blob :: ByteString -> Blob
[blobGetContent] :: Blob -> ByteString

-- | Represent a signed tag.
data Tag
Tag :: Ref -> ObjectType -> ByteString -> Person -> ByteString -> Tag
[tagRef] :: Tag -> Ref
[tagObjectType] :: Tag -> ObjectType
[tagBlob] :: Tag -> ByteString
[tagName] :: Tag -> Person
[tagS] :: Tag -> ByteString

-- | an author or committer line has the format: name <a>email</a> time
--   timezone FIXME: should be a string, but I don't know if the data is
--   stored consistantly in one encoding (UTF8)
data Person
Person :: ByteString -> ByteString -> GitTime -> Person
[personName] :: Person -> ByteString
[personEmail] :: Person -> ByteString
[personTime] :: Person -> GitTime

-- | Entity name
data EntName
entName :: ByteString -> EntName
type EntPath = [EntName]
entPathAppend :: EntPath -> EntName -> EntPath
newtype ModePerm
ModePerm :: Word32 -> ModePerm

-- | traditional unix permission for owner, group and permissions
data FilePermissions
FilePermissions :: {-# UNPACK #-} !Perm -> {-# UNPACK #-} !Perm -> {-# UNPACK #-} !Perm -> FilePermissions
[getOwnerPerm] :: FilePermissions -> {-# UNPACK #-} !Perm
[getGroupPerm] :: FilePermissions -> {-# UNPACK #-} !Perm
[getOtherPerm] :: FilePermissions -> {-# UNPACK #-} !Perm

-- | Git object file type
data ObjectFileType
FileTypeDirectory :: ObjectFileType
FileTypeRegularFile :: ObjectFileType
FileTypeSymbolicLink :: ObjectFileType
FileTypeGitLink :: ObjectFileType
getPermission :: ModePerm -> FilePermissions
getFiletype :: ModePerm -> ObjectFileType

-- | Git time is number of seconds since unix epoch in the UTC zone with
--   the current timezone associated
data GitTime
GitTime :: Elapsed -> TimezoneOffset -> GitTime
[gitTimeUTC] :: GitTime -> Elapsed
[gitTimeTimezone] :: GitTime -> TimezoneOffset
gitTime :: Integer -> Int -> GitTime
gitTimeToLocal :: GitTime -> LocalTime Elapsed

-- | Delta pointing to an offset.
data DeltaOfs
DeltaOfs :: Word64 -> Delta -> DeltaOfs

-- | Delta pointing to a ref.
data DeltaRef
DeltaRef :: Ref -> Delta -> DeltaRef

-- | represent one entry in the tree (permission,file or directory
--   name,blob or tree ref) name should maybe a filepath, but not sure
--   about the encoding.
type TreeEnt = (ModePerm, EntName, Ref)
instance GHC.Classes.Eq Data.Git.Types.DeltaRef
instance GHC.Show.Show Data.Git.Types.DeltaRef
instance GHC.Classes.Eq Data.Git.Types.DeltaOfs
instance GHC.Show.Show Data.Git.Types.DeltaOfs
instance GHC.Classes.Eq Data.Git.Types.Tag
instance GHC.Show.Show Data.Git.Types.Tag
instance GHC.Classes.Eq Data.Git.Types.Commit
instance GHC.Show.Show Data.Git.Types.Commit
instance GHC.Classes.Eq Data.Git.Types.CommitExtra
instance GHC.Show.Show Data.Git.Types.CommitExtra
instance GHC.Classes.Eq Data.Git.Types.Blob
instance GHC.Show.Show Data.Git.Types.Blob
instance GHC.Classes.Eq Data.Git.Types.Tree
instance GHC.Show.Show Data.Git.Types.Tree
instance GHC.Classes.Eq Data.Git.Types.Person
instance GHC.Show.Show Data.Git.Types.Person
instance GHC.Classes.Ord Data.Git.Types.EntName
instance GHC.Classes.Eq Data.Git.Types.EntName
instance GHC.Classes.Eq Data.Git.Types.FilePermissions
instance GHC.Show.Show Data.Git.Types.FilePermissions
instance GHC.Classes.Eq Data.Git.Types.ObjectFileType
instance GHC.Show.Show Data.Git.Types.ObjectFileType
instance GHC.Classes.Eq Data.Git.Types.ModePerm
instance GHC.Show.Show Data.Git.Types.ModePerm
instance GHC.Classes.Eq Data.Git.Types.GitTime
instance Data.Data.Data Data.Git.Types.ObjectType
instance GHC.Classes.Eq Data.Git.Types.ObjectType
instance GHC.Show.Show Data.Git.Types.ObjectType
instance Data.Hourglass.Time.Timeable Data.Git.Types.GitTime
instance Data.Hourglass.Time.Time Data.Git.Types.GitTime
instance GHC.Show.Show Data.Git.Types.GitTime
instance GHC.Enum.Enum Data.Git.Types.ObjectType
instance GHC.Show.Show Data.Git.Types.EntName
instance Data.String.IsString Data.Git.Types.EntName
instance Data.Byteable.Byteable Data.Git.Types.EntName
instance GHC.Base.Monoid Data.Git.Types.Tree


module Data.Git.Storage.Object

-- | location of an object in the database
data ObjectLocation
NotFound :: ObjectLocation
Loose :: Ref -> ObjectLocation
Packed :: Ref -> Word64 -> ObjectLocation

-- | type of a git object.
data ObjectType
TypeTree :: ObjectType
TypeBlob :: ObjectType
TypeCommit :: ObjectType
TypeTag :: ObjectType
TypeDeltaOff :: ObjectType
TypeDeltaRef :: ObjectType
type ObjectHeader = (ObjectType, Word64, Maybe ObjectPtr)
type ObjectData = ByteString

-- | Delta objects points to some others objects in the database either as
--   offset in the pack or as a direct reference.
data ObjectPtr
PtrRef :: Ref -> ObjectPtr
PtrOfs :: Word64 -> ObjectPtr

-- | describe a git object, that could of 6 differents types: tree, blob,
--   commit, tag and deltas (offset or ref). the deltas one are only
--   available in packs.
data Object
ObjCommit :: Commit -> Object
ObjTag :: Tag -> Object
ObjBlob :: Blob -> Object
ObjTree :: Tree -> Object
ObjDeltaOfs :: DeltaOfs -> Object
ObjDeltaRef :: DeltaRef -> Object

-- | Raw objects infos have an header (type, size, ptr), the data and a
--   pointers chains to parents for resolved objects.
data ObjectInfo
ObjectInfo :: ObjectHeader -> ObjectData -> [ObjectPtr] -> ObjectInfo
[oiHeader] :: ObjectInfo -> ObjectHeader
[oiData] :: ObjectInfo -> ObjectData
[oiChains] :: ObjectInfo -> [ObjectPtr]
class Objectable a
getType :: Objectable a => a -> ObjectType
getRaw :: Objectable a => a -> ByteString
isDelta :: Objectable a => a -> Bool
toObject :: Objectable a => a -> Object
objectToType :: Object -> ObjectType
objectTypeMarshall :: ObjectType -> String
objectTypeUnmarshall :: String -> ObjectType
objectTypeIsDelta :: ObjectType -> Bool
objectIsDelta :: Object -> Bool
objectToTree :: Object -> Maybe Tree
objectToCommit :: Object -> Maybe Commit
objectToTag :: Object -> Maybe Tag
objectToBlob :: Object -> Maybe Blob

-- | parse a tree content
treeParse :: Parser ByteString Tree

-- | parse a commit content
commitParse :: Parser ByteString Commit

-- | parse a tag content
tagParse :: Parser ByteString Tag

-- | parse a blob content
blobParse :: Parser ByteString Blob
objectParseTree :: Parser ByteString Object
objectParseCommit :: Parser ByteString Object
objectParseTag :: Parser ByteString Object
objectParseBlob :: Parser ByteString Object
objectWriteHeader :: ObjectType -> Word64 -> ByteString
objectWrite :: Object -> ByteString
objectHash :: ObjectType -> Word64 -> ByteString -> Ref
instance GHC.Classes.Eq Data.Git.Storage.Object.Object
instance GHC.Show.Show Data.Git.Storage.Object.Object
instance GHC.Classes.Eq Data.Git.Storage.Object.ObjectInfo
instance GHC.Show.Show Data.Git.Storage.Object.ObjectInfo
instance GHC.Classes.Eq Data.Git.Storage.Object.ObjectPtr
instance GHC.Show.Show Data.Git.Storage.Object.ObjectPtr
instance GHC.Classes.Eq Data.Git.Storage.Object.ObjectLocation
instance GHC.Show.Show Data.Git.Storage.Object.ObjectLocation
instance Data.Git.Storage.Object.Objectable Data.Git.Types.Blob
instance Data.Git.Storage.Object.Objectable Data.Git.Types.Commit
instance Data.Git.Storage.Object.Objectable Data.Git.Types.Tag
instance Data.Git.Storage.Object.Objectable Data.Git.Types.Tree
instance Data.Git.Storage.Object.Objectable Data.Git.Types.DeltaOfs
instance Data.Git.Storage.Object.Objectable Data.Git.Types.DeltaRef


-- | Manipulation of named references * reading packed-refs file * reading
--   single heads<i>tags</i>remote file
module Data.Git.Named

-- | Represent a named specifier.
data RefSpecTy
RefHead :: RefSpecTy
RefOrigHead :: RefSpecTy
RefFetchHead :: RefSpecTy
RefBranch :: RefName -> RefSpecTy
RefTag :: RefName -> RefSpecTy
RefRemote :: RefName -> RefSpecTy
RefPatches :: String -> RefSpecTy
RefStash :: RefSpecTy
RefOther :: String -> RefSpecTy

-- | content of a ref file.
data RefContentTy
RefDirect :: Ref -> RefContentTy
RefLink :: RefSpecTy -> RefContentTy
RefContentUnknown :: ByteString -> RefContentTy
newtype RefName
RefName :: String -> RefName
[refNameRaw] :: RefName -> String
readPackedRefs :: FilePath -> ([(RefName, Ref)] -> a) -> IO (PackedRefs a)
data PackedRefs a
PackedRefs :: a -> a -> a -> PackedRefs a
[packedRemotes] :: PackedRefs a -> a
[packedBranchs] :: PackedRefs a -> a
[packedTags] :: PackedRefs a -> a
existsRefFile :: FilePath -> RefSpecTy -> IO Bool
writeRefFile :: FilePath -> RefSpecTy -> RefContentTy -> IO ()
readRefFile :: FilePath -> RefSpecTy -> IO RefContentTy
looseHeadsList :: FilePath -> IO [RefName]
looseTagsList :: FilePath -> IO [RefName]
looseRemotesList :: FilePath -> IO [RefName]
instance GHC.Classes.Eq Data.Git.Named.RefContentTy
instance GHC.Show.Show Data.Git.Named.RefContentTy
instance GHC.Classes.Ord Data.Git.Named.RefSpecTy
instance GHC.Classes.Eq Data.Git.Named.RefSpecTy
instance GHC.Show.Show Data.Git.Named.RefSpecTy
instance GHC.Classes.Ord Data.Git.Named.RefName
instance GHC.Classes.Eq Data.Git.Named.RefName
instance GHC.Show.Show Data.Git.Named.RefName
instance Data.String.IsString Data.Git.Named.RefName


module Data.Git.Storage.PackIndex

-- | represent an packIndex header with the version and the fanout table
data PackIndexHeader
PackIndexHeader :: !Word32 -> !(Vector Word32) -> PackIndexHeader
data PackIndex
PackIndex :: Vector Ref -> Vector Word32 -> Vector Word32 -> Ref -> Ref -> PackIndex
[packIndexSha1s] :: PackIndex -> Vector Ref
[packIndexCRCs] :: PackIndex -> Vector Word32
[packIndexPackoffs] :: PackIndex -> Vector Word32
[packIndexPackChecksum] :: PackIndex -> Ref
[packIndexChecksum] :: PackIndex -> Ref

-- | open an index
packIndexOpen :: FilePath -> Ref -> IO FileReader

-- | close an index
packIndexClose :: FileReader -> IO ()

-- | variant of withFile on the index file and with a FileReader
withPackIndex :: FilePath -> Ref -> (FileReader -> IO a) -> IO a

-- | enumerate every indexes file in the pack directory
packIndexEnumerate :: FilePath -> IO [Ref]

-- | get the number of reference in this index with a specific prefix
packIndexHeaderGetNbWithPrefix :: PackIndexHeader -> Int -> Word32

-- | return the reference offset in the packfile if found
packIndexGetReferenceLocation :: PackIndexHeader -> FileReader -> Ref -> IO (Maybe Word64)

-- | get all references that start by prefix.
packIndexGetReferencesWithPrefix :: PackIndexHeader -> FileReader -> String -> IO [Ref]

-- | read index header from an index filereader
packIndexReadHeader :: FileReader -> IO PackIndexHeader

-- | read all index
packIndexRead :: FilePath -> Ref -> IO (PackIndexHeader, (Vector Ref, Vector Word32, Vector Word32, [ByteString], Ref, Ref))

-- | get index header from an index reference
packIndexGetHeader :: FilePath -> Ref -> IO PackIndexHeader
instance GHC.Classes.Eq Data.Git.Storage.PackIndex.PackIndexHeader
instance GHC.Show.Show Data.Git.Storage.PackIndex.PackIndexHeader


module Data.Git.Storage.Pack
data PackedObjectInfo
PackedObjectInfo :: ObjectType -> Word64 -> Word64 -> Word64 -> Maybe ObjectPtr -> PackedObjectInfo
[poiType] :: PackedObjectInfo -> ObjectType
[poiOffset] :: PackedObjectInfo -> Word64
[poiSize] :: PackedObjectInfo -> Word64
[poiActualSize] :: PackedObjectInfo -> Word64
[poiExtra] :: PackedObjectInfo -> Maybe ObjectPtr
type PackedObjectRaw = (PackedObjectInfo, ByteString)

-- | Enumerate the pack refs available in this repository.
packEnumerate :: FilePath -> IO [Ref]

-- | open a pack
packOpen :: FilePath -> Ref -> IO FileReader

-- | close a pack
packClose :: FileReader -> IO ()

-- | return the number of entries in this pack
packReadHeader :: FilePath -> Ref -> IO Word32

-- | read an object at a specific position using a map function on the
--   objectData
packReadMapAtOffset :: FileReader -> Word64 -> (ByteString -> ByteString) -> IO (Maybe Object)

-- | read an object at a specific position
packReadAtOffset :: FileReader -> Word64 -> IO (Maybe Object)

-- | read a raw representation at a specific position
packReadRawAtOffset :: FileReader -> Word64 -> IO (PackedObjectRaw)

-- | enumerate all objects in this pack and callback to f for reach raw
--   objects
packEnumerateObjects :: FilePath -> Ref -> Int -> (PackedObjectRaw -> IO a) -> IO ()
packedObjectToObject :: (PackedObjectInfo, ByteString) -> Maybe Object
packObjectFromRaw :: (ObjectType, Maybe ObjectPtr, ByteString) -> Maybe Object
instance GHC.Classes.Eq Data.Git.Storage.Pack.PackedObjectInfo
instance GHC.Show.Show Data.Git.Storage.Pack.PackedObjectInfo


module Data.Git.Storage.Loose
newtype Zipped
Zipped :: ByteString -> Zipped
[getZippedData] :: Zipped -> ByteString

-- | unmarshall an object (with header) from a bytestring.
looseUnmarshall :: ByteString -> Object

-- | unmarshall an object as (header, data) tuple from a bytestring
looseUnmarshallRaw :: ByteString -> (ObjectHeader, ObjectData)

-- | unmarshall an object (with header) from a zipped stream.
looseUnmarshallZipped :: Zipped -> Object

-- | unmarshall an object as (header, data) tuple from a zipped stream
looseUnmarshallZippedRaw :: Zipped -> (ObjectHeader, ObjectData)

-- | marshall as lazy bytestring an object except deltas.
looseMarshall :: Object -> ByteString

-- | read a specific ref from a loose object and returns an object
looseRead :: FilePath -> Ref -> IO Object

-- | read only the header of a loose object.
looseReadHeader :: FilePath -> Ref -> IO (ObjectType, Word64, Maybe a)

-- | read a specific ref from a loose object and returns an header and
--   data.
looseReadRaw :: FilePath -> Ref -> IO (ObjectHeader, ObjectData)

-- | check if a specific ref exists as loose object
looseExists :: FilePath -> Ref -> IO Bool

-- | create a new blob on a temporary location and on success move it to
--   the object store with its digest name.
looseWriteBlobFromFile :: FilePath -> FilePath -> IO Ref

-- | write an object to disk as a loose reference. use
--   looseWriteBlobFromFile for efficiently writing blobs when being
--   commited from a file.
looseWrite :: FilePath -> Object -> IO Ref

-- | enumarate all prefixes available in the object store.
looseEnumeratePrefixes :: FilePath -> IO [[Char]]

-- | enumerate all references available with a specific prefix.
looseEnumerateWithPrefixFilter :: FilePath -> String -> (Ref -> Bool) -> IO [Ref]
looseEnumerateWithPrefix :: FilePath -> String -> IO [Ref]


module Data.Git.Storage

-- | represent a git repo, with possibly already opened filereaders for
--   indexes and packs
data Git
packedNamed :: Git -> CachedPackedRef
gitRepoPath :: Git -> FilePath
configs :: Git -> IORef [Config]

-- | open a new git repository context
openRepo :: FilePath -> IO Git

-- | close a git repository context, closing all remaining fileReaders.
closeRepo :: Git -> IO ()

-- | execute a function f with a git context.
withRepo :: FilePath -> (Git -> IO c) -> IO c

-- | execute a function on the current repository.
--   
--   check findRepo to see how the git repository is found.
withCurrentRepo :: (Git -> IO a) -> IO a

-- | Find the git repository from the current directory.
--   
--   If the environment variable GIT_DIR is set then it's used, otherwise
--   iterate from current directory, up to 128 parents for a .git directory
findRepoMaybe :: IO (Maybe FilePath)

-- | Find the git repository from the current directory.
--   
--   If the environment variable GIT_DIR is set then it's used, otherwise
--   iterate from current directory, up to 128 parents for a .git directory
findRepo :: IO FilePath

-- | basic checks to see if a specific path looks like a git repo.
isRepo :: FilePath -> IO Bool

-- | initialize a new repository at a specific location.
initRepo :: FilePath -> IO ()

-- | read the repository's description
getDescription :: Git -> IO (Maybe String)

-- | set the repository's description
setDescription :: Git -> String -> IO ()
iterateIndexes :: Git -> (b -> (Ref, PackIndexReader) -> IO (b, Bool)) -> b -> IO b

-- | Get the object location of a specific reference
findReference :: Git -> Ref -> IO ObjectLocation

-- | get all the references that start by a specific prefix
findReferencesWithPrefix :: Git -> String -> IO [Ref]

-- | get an object from repository
getObjectRaw :: Git -> Ref -> Bool -> IO (Maybe ObjectInfo)

-- | get an object from repository
getObjectRawAt :: Git -> ObjectLocation -> Bool -> IO (Maybe ObjectInfo)

-- | get an object from repository using a ref.
getObject :: Git -> Ref -> Bool -> IO (Maybe Object)

-- | Just like <a>getObject</a> but will raise a RefNotFound exception if
--   the reference cannot be found.
getObject_ :: Git -> Ref -> Bool -> IO Object

-- | get an object from repository using a location to reference it.
getObjectAt :: Git -> ObjectLocation -> Bool -> IO (Maybe Object)

-- | get an object type from repository
getObjectType :: Git -> Ref -> IO (Maybe ObjectType)

-- | set an object in the store and returns the new ref this is always
--   going to create a loose object.
setObject :: Git -> Object -> IO Ref


module Data.Git.Repository

-- | represent a git repo, with possibly already opened filereaders for
--   indexes and packs
data Git

-- | Read the Config
configGetAll :: Git -> IO [Config]

-- | Get a configuration element from the config file, starting from the
--   local repository config file, then the global config file.
--   
--   for example the equivalent to git config user.name is:
--   
--   <pre>
--   configGet git "user" "name"
--   </pre>
configGet :: Git -> String -> String -> IO (Maybe String)
newtype Config
Config :: [Section] -> Config
data Section
Section :: String -> [(String, String)] -> Section
[sectionName] :: Section -> String
[sectionKVs] :: Section -> [(String, String)]
type HTree = [(ModePerm, EntName, HTreeEnt)]

-- | hierarchy tree, either a reference to a blob (file) or a tree
--   (directory).
data HTreeEnt
TreeDir :: Ref -> HTree -> HTreeEnt
TreeFile :: Ref -> HTreeEnt
newtype RefName
RefName :: String -> RefName
[refNameRaw] :: RefName -> String

-- | get a specified commit
getCommitMaybe :: Git -> Ref -> IO (Maybe Commit)

-- | get a specified commit but raises an exception if doesn't exists or
--   type is not appropriate
getCommit :: Git -> Ref -> IO Commit

-- | get a specified tree
getTreeMaybe :: Git -> Ref -> IO (Maybe Tree)

-- | get a specified tree but raise
getTree :: Git -> Ref -> IO Tree

-- | Rewrite a set of commits from a revision and returns the new ref.
--   
--   If during revision traversal (diving) there's a commit with zero or
--   multiple parents then the traversal will stop regardless of the amount
--   of parent requested.
--   
--   calling "rewrite f 2 (revisionOf d)" on the following tree:
--   
--   a &lt;-- b &lt;-- c &lt;-- d
--   
--   result in the following tree after mapping with f:
--   
--   a &lt;-- f(b) &lt;-- f(c) &lt;-- f(d)
rewrite :: Git -> (Commit -> IO Commit) -> Revision -> Int -> IO Ref

-- | build a hierarchy tree from a tree object
buildHTree :: Git -> Tree -> IO HTree

-- | resolve the ref (tree or blob) related to a path at a specific commit
--   ref
resolvePath :: Git -> Ref -> EntPath -> IO (Maybe Ref)

-- | returns a tree from a ref that might be either a commit, a tree or a
--   tag.
resolveTreeish :: Git -> Ref -> IO (Maybe Tree)

-- | try to resolve a string to a specific commit ref for example: HEAD,
--   HEAD^, master~3, shortRef
resolveRevision :: Git -> Revision -> IO (Maybe Ref)

-- | initialize a new repository at a specific location.
initRepo :: FilePath -> IO ()

-- | basic checks to see if a specific path looks like a git repo.
isRepo :: FilePath -> IO Bool

-- | Write a branch to point to a specific reference
branchWrite :: Git -> RefName -> Ref -> IO ()

-- | Return the list of branches
branchList :: Git -> IO (Set RefName)

-- | Write a tag to point to a specific reference
tagWrite :: Git -> RefName -> Ref -> IO ()

-- | Return the list of branches
tagList :: Git -> IO (Set RefName)

-- | Set head to point to either a reference or a branch name.
headSet :: Git -> Either Ref RefName -> IO ()

-- | Get what the head is pointing to, or the reference otherwise
headGet :: Git -> IO (Either Ref RefName)
instance Data.Data.Data Data.Git.Repository.InvalidType
instance GHC.Classes.Eq Data.Git.Repository.InvalidType
instance GHC.Show.Show Data.Git.Repository.InvalidType
instance GHC.Exception.Exception Data.Git.Repository.InvalidType


module Data.Git

-- | represent a git reference (SHA1)
data Ref
newtype RefName
RefName :: String -> RefName
[refNameRaw] :: RefName -> String

-- | Represent a commit object.
data Commit
Commit :: Ref -> [Ref] -> Person -> Person -> Maybe ByteString -> [CommitExtra] -> ByteString -> Commit
[commitTreeish] :: Commit -> Ref
[commitParents] :: Commit -> [Ref]
[commitAuthor] :: Commit -> Person
[commitCommitter] :: Commit -> Person
[commitEncoding] :: Commit -> Maybe ByteString
[commitExtras] :: Commit -> [CommitExtra]
[commitMessage] :: Commit -> ByteString

-- | an author or committer line has the format: name <a>email</a> time
--   timezone FIXME: should be a string, but I don't know if the data is
--   stored consistantly in one encoding (UTF8)
data Person
Person :: ByteString -> ByteString -> GitTime -> Person
[personName] :: Person -> ByteString
[personEmail] :: Person -> ByteString
[personTime] :: Person -> GitTime
data CommitExtra
CommitExtra :: ByteString -> ByteString -> CommitExtra
[commitExtraKey] :: CommitExtra -> ByteString
[commitExtraValue] :: CommitExtra -> ByteString

-- | Represent a root tree with zero to many tree entries.
data Tree
Tree :: [TreeEnt] -> Tree
[treeGetEnts] :: Tree -> [TreeEnt]

-- | Represent a binary blob.
data Blob
Blob :: ByteString -> Blob
[blobGetContent] :: Blob -> ByteString

-- | Represent a signed tag.
data Tag
Tag :: Ref -> ObjectType -> ByteString -> Person -> ByteString -> Tag
[tagRef] :: Tag -> Ref
[tagObjectType] :: Tag -> ObjectType
[tagBlob] :: Tag -> ByteString
[tagName] :: Tag -> Person
[tagS] :: Tag -> ByteString

-- | Git time is number of seconds since unix epoch in the UTC zone with
--   the current timezone associated
data GitTime
newtype ModePerm
ModePerm :: Word32 -> ModePerm

-- | Entity name
data EntName
type EntPath = [EntName]
entName :: ByteString -> EntName
entPathAppend :: EntPath -> EntName -> EntPath

-- | Git object file type
data ObjectFileType
FileTypeDirectory :: ObjectFileType
FileTypeRegularFile :: ObjectFileType
FileTypeSymbolicLink :: ObjectFileType
FileTypeGitLink :: ObjectFileType

-- | traditional unix permission for owner, group and permissions
data FilePermissions
FilePermissions :: {-# UNPACK #-} !Perm -> {-# UNPACK #-} !Perm -> {-# UNPACK #-} !Perm -> FilePermissions
[getOwnerPerm] :: FilePermissions -> {-# UNPACK #-} !Perm
[getGroupPerm] :: FilePermissions -> {-# UNPACK #-} !Perm
[getOtherPerm] :: FilePermissions -> {-# UNPACK #-} !Perm
getPermission :: ModePerm -> FilePermissions
getFiletype :: ModePerm -> ObjectFileType

-- | A git revision. this can be many things: * a shorten ref * a ref * a
--   named branch or tag followed by optional modifiers <a>RevModifier</a>
--   that can represent: * parenting * type * date
data Revision

-- | try to resolve a string to a specific commit ref for example: HEAD,
--   HEAD^, master~3, shortRef
resolveRevision :: Git -> Revision -> IO (Maybe Ref)

-- | returns a tree from a ref that might be either a commit, a tree or a
--   tag.
resolveTreeish :: Git -> Ref -> IO (Maybe Tree)

-- | resolve the ref (tree or blob) related to a path at a specific commit
--   ref
resolvePath :: Git -> Ref -> EntPath -> IO (Maybe Ref)

-- | represent a git repo, with possibly already opened filereaders for
--   indexes and packs
data Git

-- | execute a function on the current repository.
--   
--   check findRepo to see how the git repository is found.
withCurrentRepo :: (Git -> IO a) -> IO a

-- | execute a function f with a git context.
withRepo :: FilePath -> (Git -> IO c) -> IO c

-- | Find the git repository from the current directory.
--   
--   If the environment variable GIT_DIR is set then it's used, otherwise
--   iterate from current directory, up to 128 parents for a .git directory
findRepo :: IO FilePath

-- | initialize a new repository at a specific location.
initRepo :: FilePath -> IO ()

-- | basic checks to see if a specific path looks like a git repo.
isRepo :: FilePath -> IO Bool

-- | Rewrite a set of commits from a revision and returns the new ref.
--   
--   If during revision traversal (diving) there's a commit with zero or
--   multiple parents then the traversal will stop regardless of the amount
--   of parent requested.
--   
--   calling "rewrite f 2 (revisionOf d)" on the following tree:
--   
--   a &lt;-- b &lt;-- c &lt;-- d
--   
--   result in the following tree after mapping with f:
--   
--   a &lt;-- f(b) &lt;-- f(c) &lt;-- f(d)
rewrite :: Git -> (Commit -> IO Commit) -> Revision -> Int -> IO Ref

-- | get an object from repository using a ref.
getObject :: Git -> Ref -> Bool -> IO (Maybe Object)

-- | get a specified commit but raises an exception if doesn't exists or
--   type is not appropriate
getCommit :: Git -> Ref -> IO Commit

-- | get a specified tree but raise
getTree :: Git -> Ref -> IO Tree

-- | set an object in the store and returns the new ref this is always
--   going to create a loose object.
setObject :: Git -> Object -> IO Ref
toObject :: Objectable a => a -> Object
type WorkTree = MVar TreeSt
data EntType
EntDirectory :: EntType
EntFile :: EntType
EntExecutable :: EntType

-- | Create a new worktree
workTreeNew :: IO WorkTree

-- | Create a worktree from a tree reference.
workTreeFrom :: Ref -> IO WorkTree

-- | delete a path from a working tree
--   
--   if the path doesn't exist, no error is raised
workTreeDelete :: Git -> WorkTree -> EntPath -> IO ()

-- | Set a file in this working tree to a specific ref.
--   
--   The ref should point to a valid blob or tree object, and it's safer to
--   write the referenced tree or blob object first.
workTreeSet :: Git -> WorkTree -> EntPath -> (EntType, Ref) -> IO ()

-- | Flush the worktree by creating all the necessary trees in the git
--   store and return the root ref of the work tree.
workTreeFlush :: Git -> WorkTree -> IO Ref

-- | Write a branch to point to a specific reference
branchWrite :: Git -> RefName -> Ref -> IO ()

-- | Return the list of branches
branchList :: Git -> IO (Set RefName)

-- | Write a tag to point to a specific reference
tagWrite :: Git -> RefName -> Ref -> IO ()

-- | Return the list of branches
tagList :: Git -> IO (Set RefName)

-- | Set head to point to either a reference or a branch name.
headSet :: Git -> Either Ref RefName -> IO ()

-- | Get what the head is pointing to, or the reference otherwise
headGet :: Git -> IO (Either Ref RefName)


-- | Basic Git diff methods.
module Data.Git.Diff

-- | represents a blob's content (i.e., the content of a file at a given
--   reference).
data BlobContent

-- | Text file's lines
FileContent :: [ByteString] -> BlobContent

-- | Binary content
BinaryContent :: ByteString -> BlobContent

-- | This is a blob description at a given state (revision)
data BlobState
BlobState :: EntPath -> ModePerm -> Ref -> BlobContent -> BlobState
[bsFilename] :: BlobState -> EntPath
[bsMode] :: BlobState -> ModePerm
[bsRef] :: BlobState -> Ref
[bsContent] :: BlobState -> BlobContent

-- | Represents a file state between two revisions A file (a blob) can be
--   present in the first Tree's revision but not in the second one, then
--   it has been deleted. If only in the second Tree's revision, then it
--   has been created. If it is in the both, maybe it has been changed.
data BlobStateDiff
OnlyOld :: BlobState -> BlobStateDiff
OnlyNew :: BlobState -> BlobStateDiff
OldAndNew :: BlobState -> BlobState -> BlobStateDiff

-- | generate a diff list between two revisions with a given diff helper.
--   
--   Useful to extract any kind of information from two different
--   revisions. For example you can get the number of deleted files:
--   
--   <pre>
--   getdiffwith f 0 head^ head git
--       where f (OnlyOld _) acc = acc+1
--             f _           acc = acc
--   </pre>
--   
--   Or save the list of new files:
--   
--   <pre>
--   getdiffwith f [] head^ head git
--       where f (OnlyNew bs) acc = (bsFilename bs):acc
--             f _            acc = acc
--   </pre>
getDiffWith :: (BlobStateDiff -> a -> a) -> a -> Ref -> Ref -> Git -> IO a

-- | This is a proposed diff records for a given file. It contains useful
--   information: * the filename (with its path in the root project) * a
--   file diff (with the Data.Algorithm.Patience method) * the file's mode
--   (i.e. the file priviledge) * the file's ref
data HitDiff
HitDiff :: EntPath -> HitFileContent -> HitFileMode -> HitFileRef -> HitDiff
[hFileName] :: HitDiff -> EntPath
[hFileContent] :: HitDiff -> HitFileContent
[hFileMode] :: HitDiff -> HitFileMode
[hFileRef] :: HitDiff -> HitFileRef
data HitFileContent
NewBinaryFile :: HitFileContent
OldBinaryFile :: HitFileContent
NewTextFile :: [TextLine] -> HitFileContent
OldTextFile :: [TextLine] -> HitFileContent
ModifiedBinaryFile :: HitFileContent
ModifiedFile :: [FilteredDiff] -> HitFileContent
UnModifiedFile :: HitFileContent
data FilteredDiff
NormalLine :: (Item TextLine) -> FilteredDiff
Separator :: FilteredDiff
data HitFileRef
NewRef :: Ref -> HitFileRef
OldRef :: Ref -> HitFileRef
ModifiedRef :: Ref -> Ref -> HitFileRef
UnModifiedRef :: Ref -> HitFileRef
data HitFileMode
NewMode :: ModePerm -> HitFileMode
OldMode :: ModePerm -> HitFileMode
ModifiedMode :: ModePerm -> ModePerm -> HitFileMode
UnModifiedMode :: ModePerm -> HitFileMode
data TextLine
TextLine :: Integer -> ByteString -> TextLine
[lineNumber] :: TextLine -> Integer
[lineContent] :: TextLine -> ByteString

-- | A default diff helper. It is an example about how you can write your
--   own diff helper or you can use it if you want to get all of
--   differences.
defaultDiff :: Int -> BlobStateDiff -> [HitDiff] -> [HitDiff]

-- | A default Diff getter which returns all diff information (Mode,
--   Content and Binary) with a context of 5 lines.
--   
--   <pre>
--   getDiff = getDiffWith (defaultDiff 5) []
--   </pre>
getDiff :: Ref -> Ref -> Git -> IO [HitDiff]
instance GHC.Show.Show Data.Git.Diff.BlobState
instance GHC.Show.Show Data.Git.Diff.BlobContent
instance GHC.Classes.Eq Data.Git.Diff.BlobState
instance GHC.Classes.Eq Data.Git.Diff.TextLine
instance GHC.Classes.Ord Data.Git.Diff.TextLine