Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tses #2

Merged
merged 292 commits into from
Dec 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
292 commits
Select commit Hold shift + click to select a range
b4177b8
plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes
josephvusich Apr 2, 2018
247cf69
Merge pull request #797 from jvusich/fix/oversize-pkt-line
mcuadros Apr 3, 2018
5e8e011
add PlainOpen variant to find .git in parent dirs
mvdan Mar 14, 2018
c4ace4d
Merge pull request #784 from mvdan/open-detect
mcuadros Apr 4, 2018
8338105
use bsd superset for conditional compilation
wardn Apr 10, 2018
02335b1
config: adds branches to config for tracking branches against remotes…
TheHipbot Apr 7, 2018
4099191
Merge pull request #804 from wardn/master
mcuadros Apr 11, 2018
0db54e8
Merge pull request #803 from TheHipbot/branch-tracking-on-clone
mcuadros Apr 11, 2018
6ea6016
dotgit: ignore filenames that don't match a hash
strib Apr 13, 2018
c3a1610
storage: dotgit, init fixtures in benchmark. Fixes #770
jfontan Apr 16, 2018
a042efa
Merge pull request #808 from jfontan/fix/benchmark-fixtures
mcuadros Apr 16, 2018
75da837
git: remote, Add shallow commits instead of substituting. Fixes #412
jfontan Apr 16, 2018
79db8cf
dotgit: add test for bad file in pack directory
strib Apr 16, 2018
0c7d7c6
Resolve full commit sha to plumbing hash
Jan 2, 2018
eec77c3
Merge pull request #807 from keybase/strib/src-d-ignore-non-hash-files
mcuadros Apr 17, 2018
60fd949
Merge pull request #810 from jfontan/fix/update-shallow
mcuadros Apr 17, 2018
46a247f
storage: filesystem, close shallow file when read
mcuadros Apr 17, 2018
b30763c
Merge pull request #706 from antham/resolve-commit-sha1
mcuadros Apr 17, 2018
6b33126
git: worktree, Skip special git directory. Fixes #814
Apr 18, 2018
87cc819
Merge pull request #815 from kuba--/fix-worktree/814
mcuadros Apr 18, 2018
47417ae
travis: dropping 1.8.x support due to golang.org/x/crypto/ssh require…
mcuadros May 2, 2018
2eb97fb
Use remote name in fetch while clone
fooker May 9, 2018
e63b032
Worktree: Provide ability to add excludes (#825)
maguro May 11, 2018
5dd9376
Teach ResolveRevision how to look up annotated tags
novas0x2a May 11, 2018
939793b
git: remote, Do not iterate all references on update.
jfontan May 14, 2018
57570e8
Merge pull request #833 from jfontan/slow-reference-update
mcuadros May 16, 2018
689e334
idxfile: optimise allocations in readObjectNames
dsymonds May 30, 2018
cf532f9
packfile: improve Index memory representation to be more compact
dsymonds May 30, 2018
79b7f24
config: modules, Ignore submodules with dotdot '..' path components. …
josephvusich May 30, 2018
d87faec
worktree: Don't allow .gitmodules to be a symlink. Fixes CVE-2018-11235
josephvusich May 30, 2018
8955f06
Merge pull request #845 from dsymonds/master
mcuadros Jun 5, 2018
b0d807a
dotgit: Move package outside internal.
ajnavarro Jun 5, 2018
c39bd4d
Remove println
ajnavarro Jun 5, 2018
ae788cf
Merge pull request #854 from ajnavarro/dotgit-not-internal
mcuadros Jun 6, 2018
d33d3ef
Merge pull request #848 from josephvusich/fix/cve-2018-11235
mcuadros Jun 6, 2018
73c775e
Merge pull request #846 from dsymonds/compact
mcuadros Jun 6, 2018
f019589
plumbing: object, adds tree path cache to trees. Fixes #793
jfontan Jun 6, 2018
a8a12e0
Merge pull request #855 from jfontan/improvement/cache-tree-findentry
mcuadros Jun 7, 2018
88f0dc3
plumbing: packfile, Don't push empty objects. Fixes #840
Jun 7, 2018
b235700
Merge pull request #856 from kuba--/fix-840/corrupted-objects
mcuadros Jun 8, 2018
ecd2bd5
storage: filesystem, make ObjectStorage constructor public
erizocosmico Jun 8, 2018
bf61908
plumbing/transport: http, Adds token authentication support [Fixes #858]
Jun 8, 2018
e7cf6d2
Merge pull request #857 from erizocosmico/feature/object-storage-public
mcuadros Jun 11, 2018
0710c6c
Merge pull request #859 from ebilling/fix-858/token-authentication
mcuadros Jun 11, 2018
960fe7b
Fix documentation for Notes
thehowl Jun 13, 2018
2d9816a
packfile: optimise NewIndexFromIdxFile for a very common case
dsymonds Jun 21, 2018
b53ba8d
Remote.Fetch: error on missing remote reference
mcuadros Jun 21, 2018
b11eaab
Merge pull request #869 from dsymonds/compact
mcuadros Jun 21, 2018
da5d474
storage/filesystem: avoid norwfs build flag
smola Jun 15, 2018
662e2c2
Merge pull request #870 from mcuadros/fetch-error
mcuadros Jun 26, 2018
7d9b66f
utils: diff, skip useless rune->string conversion
Jun 26, 2018
fcfd239
Merge pull request #873 from smola/fix-diff
mcuadros Jun 27, 2018
9251ea7
plumbing: add context to allow cancel on diff/patch computing
Jun 26, 2018
e1c2694
worktree: add test for correct tree sorting (issue #881)
spottybenny Jul 2, 2018
7ff71b5
worktree: sort the tree object. Fixes #881
spottybenny Jul 3, 2018
8ad72db
Merge pull request #864 from smola/no-norwfs
mcuadros Jul 6, 2018
f0c4318
worktree: address PR comments: sort imports appropriately
spottybenny Jul 8, 2018
b304997
plumbing: object, expose ErrEntryNotFound in FindEntry. Fixes #883
jsravn Jul 5, 2018
3bd5e82
Merge pull request #874 from smola/patchcontext
mcuadros Jul 10, 2018
54d8c38
plumbing/transport/internal: common, add support of Gogs for ErrRepos…
jeromedoucet Jul 14, 2018
400b083
Merge pull request #888 from jeromedoucet/tech/add_gog_repository_not…
mcuadros Jul 16, 2018
5b1d537
Merge pull request #885 from jsravn/findentry-return-file-not-found
mcuadros Jul 16, 2018
9f00789
Merge pull request #862 from thehowl/patch-1
mcuadros Jul 16, 2018
8df413f
plumbing/object: fix pgp signature encoder/decoder
jfontan Jul 18, 2018
009f106
plumbing/format/idxfile: add new Index and MemoryIndex
erizocosmico Jul 19, 2018
a8ff3e5
Merge pull request #896 from erizocosmico/feature/new-index-decoder
erizocosmico Jul 26, 2018
da5677f
plumbing/packfile: add new packfile parser
jfontan Jul 19, 2018
ce91d71
plumbing/packfile: disable lookup by offset
jfontan Jul 19, 2018
355cfc3
plumbing: idxfile, add idxfile.Writer with Observer interface
jfontan Jul 19, 2018
4e3765a
plumbing/idxfile: use Entry to hold object data
jfontan Jul 20, 2018
65e8359
plumbing/idxfile: support offset64 generating indexes
jfontan Jul 20, 2018
a716126
plumbing/packfile: preallocate memory in PatchDelta
jfontan Jul 24, 2018
7418b41
plumbing/idxfile: fix bug searching in MemoryIndex
jfontan Jul 26, 2018
4ddd678
plumbing/idxfile: add offset/hash mapping to index
jfontan Jul 26, 2018
74f56f3
plumbing/idxfile: index is created only once and retrieved with Index
jfontan Jul 26, 2018
79f2494
plumbing, storage: integrate new index
jfontan Jul 26, 2018
a08061a
Merge pull request #898 from jfontan/feature/new-packfile-parser
jfontan Jul 26, 2018
ffdfb7d
plumbing: packfile, new Packfile representation
erizocosmico Jul 20, 2018
bc565c1
plumbing, packfile: delete index_test as is no longer used
jfontan Jul 26, 2018
4b366ac
plumbing: fix two errors in idxfile and packfile decoder
jfontan Jul 26, 2018
3657a32
storage/filesystem: add back IndexStorage
jfontan Jul 27, 2018
b713101
Merge pull request #902 from jfontan/feature/new-packfile-parser
jfontan Jul 27, 2018
ccd0fa0
plumbing: packfile, lazy object reads with DiskObjects
erizocosmico Jul 27, 2018
0ade8fb
Merge pull request #899 from erizocosmico/feature/new-packfile
erizocosmico Jul 27, 2018
823abfe
plumbing/idxfile: test FindHash and writer with 64 bit offsets
jfontan Jul 27, 2018
6f8f2ed
storage/filesystem: remove duplicated IndexStorage
jfontan Jul 27, 2018
b4cd089
plumbing/packfile: add index generation to decoder
jfontan Jul 27, 2018
d314e86
Merge pull request #904 from jfontan/feature/new-packfile-parser
jfontan Jul 27, 2018
3d2bcda
Fix wrong godoc on Tags() method.
ajnavarro Jul 30, 2018
6f7fc05
plumbing: packfile, fix package tests
erizocosmico Jul 30, 2018
b173cc0
Merge pull request #907 from erizocosmico/feature/fix-tests
erizocosmico Aug 1, 2018
c58d68a
Merge pull request #905 from ajnavarro/fix/tag-godoc
mcuadros Aug 2, 2018
43d17e1
Merge pull request #892 from jfontan/fix/get-pgp-signature
mcuadros Aug 7, 2018
6a24b4c
*: use parser to populate non writable storages and bug fixes
erizocosmico Aug 7, 2018
7b12481
Fixed cloning of a single tag
fkorotkov Aug 8, 2018
5889a3b
plumbing: packfile, allow non-seekable sources on Parser
erizocosmico Aug 8, 2018
b3d995f
plumbing: packfile, add Parse benchmark
erizocosmico Aug 9, 2018
c374092
Merge pull request #910 from fkorotkov/fedor/fix-tag-cloning
mcuadros Aug 9, 2018
71a3c91
plumbing: packfile, read object content only once
erizocosmico Aug 9, 2018
34cc506
storage: filesystem, benchmark PackfileIter
erizocosmico Aug 9, 2018
65dc4f9
plumbing: packfile, rename DiskObject to FSObject
erizocosmico Aug 9, 2018
038cf23
storage: filesystem, close Packfile after iterating objects
erizocosmico Aug 9, 2018
d93b386
storage: filesystem, add PackfileIter benchmark reading object content
erizocosmico Aug 9, 2018
56c5e91
plumbing: packfile, open and close packfile on FSObject reads
erizocosmico Aug 9, 2018
b944bc4
git: add benchmark for iterating repository objects
erizocosmico Aug 10, 2018
8d75d23
plumbing: idxfile, Crc32 to CRC32 and return ok from findHashIndex
erizocosmico Aug 10, 2018
a28c2ce
Merge pull request #906 from src-d/perf/packfile-reads
mcuadros Aug 14, 2018
a8c4426
plumbing: add buffer cache and use it in packfile parser
jfontan Aug 14, 2018
555a6ca
plumbing/pacfile: tidy up objectInfo struct
jfontan Aug 14, 2018
eb2aa9b
plumbing/packfile: do not compute sha1 for already undeltified objects
jfontan Aug 14, 2018
ae55016
added hook support
Aug 14, 2018
ec3d2a8
plumbing: object, Don't add new line at end of commit signature
vancluever Aug 17, 2018
0ef699d
git: Add ability to PGP sign commits
vancluever Aug 17, 2018
c9b2eac
git: Remove use of strings.Builder
vancluever Aug 17, 2018
b2edb6d
git: Remove old hash validation code
vancluever Aug 17, 2018
39954f2
git: Add extra test for testing bad key error case
vancluever Aug 17, 2018
ba0f659
Merge pull request #916 from jfontan/improvement/memory-consumption-n…
mcuadros Aug 17, 2018
7b6c126
Merge pull request #920 from vancluever/f-add-commit-signkey
mcuadros Aug 17, 2018
8cf7edb
dotgit: fix object delete test
smola Aug 17, 2018
1666236
object: fix panic when reading object header
jfontan Aug 17, 2018
7b4a837
Fixed an edge case for .gitignore
fkorotkov Aug 19, 2018
1cef577
Merge pull request #924 from fkorotkov/fedor/fix-issue-923
mcuadros Aug 20, 2018
8120de8
Merge pull request #921 from jfontan/fix/empty-headers
mcuadros Aug 21, 2018
cc27d4a
Merge pull request #887 from noxora/hook-support
mcuadros Aug 21, 2018
f84c6b1
plumbing/idxfile: object iterators returns entries in offset order
jfontan Aug 21, 2018
cdfa0bb
Merge pull request #927 from jfontan/fix/iterate-objects-by-offset
mcuadros Aug 21, 2018
b9f5efe
git: Add tagging support
vancluever Aug 18, 2018
9b73a3e
plumbing: object, correct tag PGP encoding
vancluever Aug 22, 2018
8c3c8b3
plumbing: object, don't add extra newline on PGP signature
vancluever Aug 22, 2018
2c2b532
git: Canonicalize incoming annotated tag messages
vancluever Aug 22, 2018
8d8d4c5
git: Replace test signing key with one with longer expiry
vancluever Aug 22, 2018
790191e
plumbing, storage: add bases to the common cache
jfontan Aug 22, 2018
005d5dc
Merge pull request #929 from jfontan/fix/reuse-base-cache
mcuadros Aug 22, 2018
119459a
git: Discern tag target type from supplied hash
vancluever Aug 23, 2018
01631f0
git: Don't return tag object with Tag, adjust docs for Tag and Tags
vancluever Aug 23, 2018
c7a4011
storage/dotgit: search for incoming dir only once
jfontan Aug 25, 2018
b1da90b
storage/dotgit: use HasPrefix instead of Split
jfontan Aug 27, 2018
5cc316b
Merge pull request #935 from jfontan/improvement/cache-incoming-direc…
mcuadros Aug 29, 2018
0167dab
Remove empty dirs when cleaning with Dir opt.
Aug 24, 2018
75fa41d
Add Status.IsUntracked function
Aug 29, 2018
ba3ee05
plumbing: object: Clamp object timestamps before unix epoch to unix e…
taruti Aug 29, 2018
34b101e
Merge pull request #933 from kuba--/fix-895/clean-dir
mcuadros Aug 29, 2018
14d9faa
config: add commentChar to core config struct
zaquestion Aug 29, 2018
7f42492
Merge pull request #937 from zaquestion/comment_char
mcuadros Aug 30, 2018
1e1a7d0
git: add Static option to PlainOpen
jfontan Aug 30, 2018
82945e3
git, storer: use a common storer.Options for storer and PlainOpen
jfontan Aug 30, 2018
d7e6cf5
dotgit: fix typo in comment
jfontan Aug 30, 2018
2a7c664
git: do not expose storage options in PlainOpen
jfontan Aug 31, 2018
cf62667
plumbing/storer: rename Static option to ExclusiveAccess
jfontan Aug 31, 2018
95acbf6
storage/filesystem: make Storage options private
jfontan Sep 3, 2018
874f669
storage/filesystem: move Options to filesytem and dotgit
jfontan Sep 3, 2018
659ec44
storage/dotgit: add ExclusiveAccess tests in dotgit
jfontan Sep 3, 2018
8e76874
Merge pull request #939 from keybase/taruti/cherrypick-for-upstream-c…
mcuadros Sep 4, 2018
2f15838
Merge pull request #941 from jfontan/improvement/static-mode
mcuadros Sep 4, 2018
6384ab9
storage/dotgit: add KeepDescriptors option
jfontan Aug 30, 2018
5260b87
plumbing/storer: do not expose Close in EncodedObjectStorer interface
jfontan Sep 4, 2018
9013dde
storage/filesystem: add KeepDescriptors test
jfontan Sep 5, 2018
8176f08
storage/filesystem: compare files using offset in test
jfontan Sep 6, 2018
174f373
Merge pull request #942 from jfontan/improvement/maintain-packfiles-open
mcuadros Sep 6, 2018
d3cec13
worktree: solve merge conflicts
mcuadros Sep 6, 2018
a4b12e4
plumbing/transport: ssh check if list of known_hosts files is empty
kuba-- Sep 7, 2018
80170bd
Fix fatal corrupt patch in unified diff format
ajnavarro Sep 7, 2018
8f6b312
Expose Storage cache.
Sep 7, 2018
6b3f46b
git: s/fetch/returns/ on Tag function doc
vancluever Sep 7, 2018
1000bc0
git: Add Tag objects to the list of supported objects for walking
vancluever Sep 7, 2018
b19b3b8
git: Don't touch tag objects orphaned by tag deletion
vancluever Sep 7, 2018
9cc654c
git: Add some tests for annotated tag deletion
vancluever Sep 7, 2018
f8adfff
git: s/TagObjectOptions/CreateTagOptions/
vancluever Sep 7, 2018
208b3c3
Merge pull request #949 from kuba--/custom-cache
mcuadros Sep 8, 2018
a2d62f5
Merge pull request #932 from flant/fix-negative-range-info
mcuadros Sep 10, 2018
bf0593d
Merge branch 'master' of github.com:src-d/go-git into f-add-tagging-s…
mcuadros Sep 10, 2018
9ce4eea
repository: fix test for new Storage constructor
mcuadros Sep 10, 2018
38060c9
Merge pull request #928 from vancluever/f-add-tagging-support
mcuadros Sep 10, 2018
83649a1
*: go modules support
mcuadros Sep 10, 2018
2fb32d2
travis: drop go1.9 add go1.11
mcuadros Sep 10, 2018
4896974
Fix potential LRU cache size issue.
Sep 17, 2018
edfc16e
Remove empty space to trigger windows build.
Sep 17, 2018
f69f530
Merge pull request #958 from kuba--/fix-cachesize
mcuadros Sep 18, 2018
82c7a30
storage/filesystem: keep packs open in PackfileIter
jfontan Sep 20, 2018
a7b0102
storage/filesystem: add more doc to NewPackfileIter
jfontan Sep 21, 2018
c2ab4ac
Merge pull request #962 from jfontan/fix/do-not-close-files-in-iterator
mcuadros Sep 21, 2018
156d632
all: remove extra 's' in "mismatch"
jmkim Sep 26, 2018
1fdd36c
Merge pull request #966 from jmkim/fix-typo
mcuadros Sep 26, 2018
37f80c6
test: improve test for urlencoded user:pass
smola Sep 27, 2018
41af429
use time.IsZero in Prune
u5surf Oct 2, 2018
c2ba07b
Add test for Windows local paths.
filipnavara Oct 5, 2018
da56abd
git: Fix Status.IsClean() documentation
urld Oct 6, 2018
80afdec
Merge pull request #968 from smola/improve-test-weird-userpass
mcuadros Oct 9, 2018
ba9c38b
Merge pull request #974 from u5surf/issue-813
mcuadros Oct 9, 2018
37caf1f
Merge pull request #978 from urld/isclean
mcuadros Oct 9, 2018
299f583
Merge pull request #977 from filipnavara/config-test
mcuadros Oct 9, 2018
0bfe038
Plumbing: object, Add support for Log with filenames. Fixes #826 (#979)
gnithin Oct 11, 2018
1e1315d
object: get object size without reading whole object
strib Oct 11, 2018
5c471c3
tree: add a Size() method for getting plaintext size
strib Oct 11, 2018
b3a3f0a
filesystem: add a new test for EncodedObjectSize
strib Oct 12, 2018
987c03a
repository: allow open non-bare repositories as bare
mcuadros Oct 15, 2018
529f843
use remote name in fetch while clone, test
mcuadros Oct 15, 2018
0381008
Merge pull request #828 from fooker/patch-1
mcuadros Oct 15, 2018
d4848fd
Merge branch 'bugfix/references-sort-timestamps' of github.com:krylov…
mcuadros Oct 15, 2018
e250584
references: sort: compare author timestamps when commit timestamps ar…
mcuadros Oct 15, 2018
345ffd9
Merge pull request #727 from krylovsk/bugfix/references-sort-timestamps
mcuadros Oct 15, 2018
0b7d3fe
teach ResolveRevision how to look up annotated tags, test
mcuadros Oct 15, 2018
7a77bde
Merge branch 'master' of github.com:src-d/go-git into annotated
mcuadros Oct 15, 2018
323d084
teach ResolveRevision how to look up annotated tags, test
mcuadros Oct 15, 2018
8153e04
Merge pull request #830 from novas0x2a/annotated
mcuadros Oct 15, 2018
6faf286
packfile: add comment on GetSizeByOffset
strib Oct 15, 2018
c4be044
blame: fix edge case with missing \n in content length causing mismat…
mcuadros Oct 15, 2018
41d6f2c
Merge pull request #982 from keybase/strib/gh-KBFS-3474-object-sizes
mcuadros Oct 16, 2018
236ae86
Merge pull request #986 from mcuadros/fix-blame
mcuadros Oct 16, 2018
891fcfb
repository: improve CheckoutOption.Hash doc
mcuadros Oct 16, 2018
07c03d9
Merge pull request #984 from mcuadros/open-bare
mcuadros Oct 16, 2018
cd64b4d
Merge pull request #985 from mcuadros/checkout-doc
mcuadros Oct 16, 2018
1618e1c
remote: use reference deltas on push when the remote server does not
Oct 16, 2018
1a2248b
Fixed a typo. (#989)
hnarasaki Oct 17, 2018
f2a7dad
Merge pull request #987 from bashims/945-push-ref-deltas
mcuadros Oct 17, 2018
1241d74
Enables building on openbsd, dragonfly bsd and solaris
yuce Oct 22, 2018
66d82a5
plumbing/format/packfile: Fix broken "thin" packfile support. Fixes #991
jpeletier Oct 23, 2018
50bbba3
Merge pull request #992 from yuce/enable-openbsd-dragonfly-solaris
mcuadros Oct 23, 2018
dee8f51
plumbing: ReferenceName constructors
mcuadros Oct 24, 2018
f22a5cb
Merge pull request #998 from mcuadros/ref-helpers
mcuadros Oct 25, 2018
cde0367
examples & documentation: PlainClone with Basic Authentication (Pass…
Oct 25, 2018
a85f9b1
add StackOverflow to support channels
smola Oct 26, 2018
4203e78
Merge pull request #1000 from smola/stackoverflow-support
mcuadros Oct 26, 2018
02a92b7
plumbing: transport/http, Add missing host/port on redirect. Fixes #820
hairyhenderson Oct 27, 2018
414b027
Merge pull request #1001 from hairyhenderson/fix-redirect-on-clone
mcuadros Oct 27, 2018
190bfd6
Fix spelling and grammar in docs and example
LukaszKokot Oct 29, 2018
af3487d
Merge pull request #1004 from LukaszKokot/fix/spelling-grammar-doc-ex…
mcuadros Oct 29, 2018
4c06868
update gcfg dependency to v1.4.0
hairyhenderson Oct 29, 2018
dfd6c82
Merge pull request #1005 from hairyhenderson/update-gcfg-1.4.0
mcuadros Oct 29, 2018
507681b
repository: added cleanup for the PlainCloneContext()
bjaroszewski Jul 18, 2018
3332e8d
improve cleanup implementation, add more tests
smola Oct 30, 2018
8b6ded6
Merge pull request #1008 from smola/clone-cleanup
mcuadros Oct 30, 2018
3033d45
Update LICENSE
mcuadros Oct 30, 2018
8aab983
http: improve TokenAuth documentation
smola Oct 31, 2018
959dc01
Merge pull request #1009 from smola/tokenauth-doc
mcuadros Oct 31, 2018
43d4551
plumbing: ssh, Fix flaky test TestAdvertisedReferencesNotExists. Fixe…
mccurdyc Nov 1, 2018
3fe6f65
Merge branch 'master' of github.com:src-d/go-git into mccurdyc/Issue#…
mccurdyc Nov 1, 2018
91e601d
Merge pull request #1013 from mccurdyc/mccurdyc/Issue#969/fix-flaky-s…
mcuadros Nov 5, 2018
3ab4ee5
repository: Fix RefSpec for a single tag. Fixes #960
fkorotkov Nov 7, 2018
a779a26
Merge pull request #1015 from fkorotkov/fedor/fix-tag-clonning
mcuadros Nov 7, 2018
ff47322
storage/filesystem: Added reindex method to reindex packfiles
jpeletier Nov 12, 2018
38ebf56
plumbing/format/packfile: Added thin pack test
jpeletier Nov 12, 2018
1e77971
Remove unused method (#1022)
ajnavarro Nov 16, 2018
7853ab6
Merge pull request #994 from epiclabs-io/fix-thin-pack
mcuadros Nov 16, 2018
2431109
Merge pull request #1019 from epiclabs-io/reindex
mcuadros Nov 19, 2018
b99653a
plumbing: format/index: support for EOIE extension, by default on git…
mcuadros Nov 19, 2018
f62cd8e
Merge pull request #1025 from mcuadros/eoie
mcuadros Nov 19, 2018
7441885
repository: fix plain clone error handling regression
smola Nov 27, 2018
3dbfb89
Merge pull request #1028 from smola/clone-regression
mcuadros Nov 27, 2018
8f52c50
plumbing: format/packfile, performance optimizations for reading larg…
filipnavara Nov 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
coverage.out
*~
coverage.txt
profile.out
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: go

go:
- 1.8.x
- 1.9.x
- "1.10"
- "1.11"

go_import_path: gopkg.in/src-d/go-git.v4

Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ This can be done easily using the [`-s`](https://github.com/git/git/blob/b2c150d

The official support channels, for both users and contributors, are:

- GitHub [issues](https://github.com/src-d/go-git/issues)*
- [StackOverflow go-git tag](https://stackoverflow.com/questions/tagged/go-git) for user questions.
- GitHub [Issues](https://github.com/src-d/go-git/issues)* for bug reports and feature requests.
- Slack: #go-git room in the [source{d} Slack](https://join.slack.com/t/sourced-community/shared_invite/enQtMjc4Njk5MzEyNzM2LTFjNzY4NjEwZGEwMzRiNTM4MzRlMzQ4MmIzZjkwZmZlM2NjODUxZmJjNDI1OTcxNDAyMmZlNmFjODZlNTg0YWM)

*Before opening a new issue or submitting a new pull request, it's helpful to
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2017 Sourced Technologies, S.L.
Copyright 2018 Sourced Technologies, S.L.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

*go-git* is a highly extensible git implementation library written in **pure Go**.

It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several type of storage, such as in-memory filesystems, or custom implementations thanks to the [`Storer`](https://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/storer) interface.
It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations thanks to the [`Storer`](https://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/storer) interface.

It's being actively develop since 2015 and is being use extensively by [source{d}](https://sourced.tech/) and [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), and by many other libraries and tools.
It's being actively developed since 2015 and is being used extensively by [source{d}](https://sourced.tech/) and [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), and by many other libraries and tools.

Comparison with git
-------------------

*go-git* aims to be fully compatible with [git](https://github.com/git/git), all the *porcelain* operations are implemented to work exactly as *git* does.

*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md).
*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* to implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md).


Installation
Expand All @@ -24,12 +24,12 @@ The recommended way to install *go-git* is:
go get -u gopkg.in/src-d/go-git.v4/...
```

> We use [gopkg.in](http://labix.org/gopkg.in) for having a versioned API, this means that when `go get` clones the package, is the latest tag matching `v4.*` cloned and not the master branch.
> We use [gopkg.in](http://labix.org/gopkg.in) to version the API, this means that when `go get` clones the package, it's the latest tag matching `v4.*` that is cloned and not the master branch.

Examples
--------

> Please note that the functions `CheckIfError` and `Info` used in the examples are from the [examples package](https://github.com/src-d/go-git/blob/master/_examples/common.go#L17) just to be used in the examples.
> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/src-d/go-git/blob/master/_examples/common.go#L17) just to be used in the examples.


### Basic example
Expand Down Expand Up @@ -71,7 +71,7 @@ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{

CheckIfError(err)

// Gets the HEAD history from HEAD, just like does:
// Gets the HEAD history from HEAD, just like this command:
Info("git log")

// ... retrieves the branch pointed by HEAD
Expand Down Expand Up @@ -110,7 +110,7 @@ Date: Fri Nov 11 13:23:22 2016 +0100
...
```

You can find this [example](_examples/log/main.go) and many others at the [examples](_examples) folder
You can find this [example](_examples/log/main.go) and many others in the [examples](_examples) folder.

Contribute
----------
Expand Down
4 changes: 4 additions & 0 deletions _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Here you can find a list of annotated _go-git_ examples:
- [showcase](showcase/main.go) - A small showcase of the capabilities of _go-git_
- [open](open/main.go) - Opening a existing repository cloned by _git_
- [clone](clone/main.go) - Cloning a repository
- [username and password](clone/auth/basic/username_password/main.go) - Cloning a repository
using a username and password
- [personal access token](clone/auth/basic/access_token/main.go) - Cloning
a repository using a GitHub personal access token
- [commit](commit/main.go) - Commit changes to the current branch to an existent repository
- [push](push/main.go) - Push repository to default remote (origin)
- [pull](pull/main.go) - Pull changes from a remote repository
Expand Down
2 changes: 1 addition & 1 deletion _examples/branch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {

// Create a new plumbing.HashReference object with the name of the branch
// and the hash from the HEAD. The reference name should be a full reference
// name and now a abbreviated one, as is used on the git cli.
// name and not an abbreviated one, as is used on the git cli.
//
// For tags we should use `refs/tags/%s` instead of `refs/heads/%s` used
// for branches.
Expand Down
4 changes: 2 additions & 2 deletions _examples/checkout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func main() {
})
CheckIfError(err)

// ... retrieving the commit being pointed by HEAD, it's shows that the
// repository is poiting to the giving commit in detached mode
// ... retrieving the commit being pointed by HEAD, it shows that the
// repository is pointing to the giving commit in detached mode
Info("git show-ref --head HEAD")
ref, err = r.Head()
CheckIfError(err)
Expand Down
40 changes: 40 additions & 0 deletions _examples/clone/auth/basic/access_token/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"fmt"
"os"

git "gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/_examples"
"gopkg.in/src-d/go-git.v4/plumbing/transport/http"
)

func main() {
CheckArgs("<url>", "<directory>", "<github_access_token>")
url, directory, token := os.Args[1], os.Args[2], os.Args[3]

// Clone the given repository to the given directory
Info("git clone %s %s", url, directory)

r, err := git.PlainClone(directory, false, &git.CloneOptions{
// The intended use of a GitHub personal access token is in replace of your password
// because access tokens can easily be revoked.
// https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
Auth: &http.BasicAuth{
Username: "abc123", // yes, this can be anything except an empty string
Password: token,
},
URL: url,
Progress: os.Stdout,
})
CheckIfError(err)

// ... retrieving the branch being pointed by HEAD
ref, err := r.Head()
CheckIfError(err)
// ... retrieving the commit object
commit, err := r.CommitObject(ref.Hash())
CheckIfError(err)

fmt.Println(commit)
}
37 changes: 37 additions & 0 deletions _examples/clone/auth/basic/username_password/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package main

import (
"fmt"
"os"

git "gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/_examples"
"gopkg.in/src-d/go-git.v4/plumbing/transport/http"
)

func main() {
CheckArgs("<url>", "<directory>", "<github_username>", "<github_password>")
url, directory, username, password := os.Args[1], os.Args[2], os.Args[3], os.Args[4]

// Clone the given repository to the given directory
Info("git clone %s %s", url, directory)

r, err := git.PlainClone(directory, false, &git.CloneOptions{
Auth: &http.BasicAuth{
Username: username,
Password: password,
},
URL: url,
Progress: os.Stdout,
})
CheckIfError(err)

// ... retrieving the branch being pointed by HEAD
ref, err := r.Head()
CheckIfError(err)
// ... retrieving the commit object
commit, err := r.CommitObject(ref.Hash())
CheckIfError(err)

fmt.Println(commit)
}
6 changes: 3 additions & 3 deletions _examples/commit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing/object"
)

// Basic example of how to commit changes to the current branch to an existent
// Basic example of how to commit changes to the current branch to an existing
// repository.
func main() {
CheckArgs("<directory>")
directory := os.Args[1]

// Opens an already existent repository.
// Opens an already existing repository.
r, err := git.PlainOpen(directory)
CheckIfError(err)

Expand All @@ -44,7 +44,7 @@ func main() {

fmt.Println(status)

// Commits the current staging are to the repository, with the new file
// Commits the current staging area to the repository, with the new file
// just created. We should provide the object.Signature of Author of the
// commit.
Info("git commit -m \"example go-git commit\"")
Expand Down
2 changes: 1 addition & 1 deletion _examples/log/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
})
CheckIfError(err)

// Gets the HEAD history from HEAD, just like does:
// Gets the HEAD history from HEAD, just like this command:
Info("git log")

// ... retrieves the branch pointed by HEAD
Expand Down
2 changes: 1 addition & 1 deletion _examples/open/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
CheckArgs("<path>")
path := os.Args[1]

// We instance a new repository targeting the given path (the .git folder)
// We instanciate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
CheckIfError(err)

Expand Down
2 changes: 1 addition & 1 deletion _examples/pull/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func main() {
CheckArgs("<path>")
path := os.Args[1]

// We instance a new repository targeting the given path (the .git folder)
// We instance\iate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
CheckIfError(err)

Expand Down
2 changes: 1 addition & 1 deletion _examples/showcase/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// - Get the HEAD reference
// - Using the HEAD reference, obtain the commit this reference is pointing to
// - Print the commit content
// - Using the commit, iterate all its files and print them
// - Using the commit, iterate over all its files and print them
// - Print all the commit history with commit messages, short hash and the
// first line of the commit message
func main() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


### and what this means ...
*git* has as very well defined storage system, the `.git` directory, present on any repository. This is the place where `git` stores al the [`objects`](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects), [`references`](https://git-scm.com/book/es/v2/Git-Internals-Git-References) and [`configuration`](https://git-scm.com/docs/git-config#_configuration_file). This information is stored in plain files.
*git* has a very well defined storage system, the `.git` directory, present on any repository. This is the place where `git` stores all the [`objects`](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects), [`references`](https://git-scm.com/book/es/v2/Git-Internals-Git-References) and [`configuration`](https://git-scm.com/docs/git-config#_configuration_file). This information is stored in plain files.

Our original **go-git** version was designed to work in memory, some time after we added support to read the `.git`, and now we have added support for fully customized [storages](https://godoc.org/gopkg.in/src-d/go-git.v4/storage#Storer).

Expand Down
2 changes: 1 addition & 1 deletion _examples/tag/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
CheckArgs("<path>")
path := os.Args[1]

// We instance a new repository targeting the given path (the .git folder)
// We instanciate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
CheckIfError(err)

Expand Down
30 changes: 24 additions & 6 deletions blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"strconv"
"strings"
"time"
"unicode/utf8"

"gopkg.in/src-d/go-git.v4/plumbing"
Expand Down Expand Up @@ -106,24 +107,41 @@ type Line struct {
Author string
// Text is the original text of the line.
Text string
// Date is when the original text of the line was introduced
Date time.Time
// Hash is the commit hash that introduced the original line
Hash plumbing.Hash
}

func newLine(author, text string) *Line {
func newLine(author, text string, date time.Time, hash plumbing.Hash) *Line {
return &Line{
Author: author,
Text: text,
Hash: hash,
Date: date,
}
}

func newLines(contents []string, commits []*object.Commit) ([]*Line, error) {
if len(contents) != len(commits) {
return nil, errors.New("contents and commits have different length")
lcontents := len(contents)
lcommits := len(commits)

if lcontents != lcommits {
if lcontents == lcommits-1 && contents[lcontents-1] != "\n" {
contents = append(contents, "\n")
} else {
return nil, errors.New("contents and commits have different length")
}
}
result := make([]*Line, 0, len(contents))

result := make([]*Line, 0, lcontents)
for i := range contents {
l := newLine(commits[i].Author.Email, contents[i])
result = append(result, l)
result = append(result, newLine(
commits[i].Author.Email, contents[i],
commits[i].Author.When, commits[i].Hash,
))
}

return result, nil
}

Expand Down
32 changes: 32 additions & 0 deletions blame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package git

import (
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"

. "gopkg.in/check.v1"
"gopkg.in/src-d/go-git-fixtures.v3"
Expand All @@ -13,6 +14,31 @@ type BlameSuite struct {

var _ = Suite(&BlameSuite{})

func (s *BlameSuite) TestNewLines(c *C) {
h := plumbing.NewHash("ce9f123d790717599aaeb76bc62510de437761be")
lines, err := newLines([]string{"foo"}, []*object.Commit{{
Hash: h,
Message: "foo",
}})

c.Assert(err, IsNil)
c.Assert(lines, HasLen, 1)
c.Assert(lines[0].Text, Equals, "foo")
c.Assert(lines[0].Hash, Equals, h)
}

func (s *BlameSuite) TestNewLinesWithNewLine(c *C) {
lines, err := newLines([]string{"foo"}, []*object.Commit{
{Message: "foo"},
{Message: "bar"},
})

c.Assert(err, IsNil)
c.Assert(lines, HasLen, 2)
c.Assert(lines[0].Text, Equals, "foo")
c.Assert(lines[1].Text, Equals, "\n")
}

type blameTest struct {
repo string
rev string
Expand All @@ -32,6 +58,10 @@ func (s *BlameSuite) TestBlame(c *C) {
obt, err := Blame(commit, t.path)
c.Assert(err, IsNil)
c.Assert(obt, DeepEquals, exp)

for i, l := range obt.Lines {
c.Assert(l.Hash.String(), Equals, t.blames[i])
}
}
}

Expand All @@ -53,6 +83,8 @@ func (s *BlameSuite) mockBlame(c *C, t blameTest, r *Repository) (blame *BlameRe
l := &Line{
Author: commit.Author.Email,
Text: lines[i],
Date: commit.Author.When,
Hash: commit.Hash,
}
blamedLines = append(blamedLines, l)
}
Expand Down
Loading