Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

plumbing: format/packfile, performance optimizations for reading large commit histories #963

Merged
merged 12 commits into from
Nov 28, 2018

Conversation

filipnavara
Copy link
Contributor

@filipnavara filipnavara commented Sep 24, 2018

We have recently evaluated using Gitea as our Git hosting solution. It turned out to have quite a few performance bottlenecks stemming from the fact that it invokes the git command line tool for all operations. In one of the tracking issues go-git was suggested as one way of speeding it up. Over the weekend I prototyped computing the directory listing with last commit for each file on top of go-git (https://gist.github.com/filipnavara/8e6fdf980130d6ca120bfda4c25481e9). The speed improvement seemed promising enough that yesterday I proceeded further and reimplemented part of Gitea to use go-git (https://github.com/filipnavara/gitea/tree/perf-read). Overall I am seeing about 10x improvement on page load times for directory listings on our repository.

As part of the experiment I hit couple of bottlenecks in the go-git itself and I think it would make sense to resolve them. The proposed solutions may not necessarily be the best for general use, but I would like to spark a discussion about it at least.

  1. Profiling the I/O showed a lot of Seek(0, io.SeekCurrent) calls that were unnecessary since the offset was either not used and thrown away or already known in the code path. This accounted for up to 5% of the history traversal.
    Proposed solution: I added SeekObjectHeader to packfile/scanner that combines seeking in the file and then reading the object header at that position into one call. This should not adversly affect any workloads. Related to that I found that Seek(<non-zero integer>, io.SeekCurrent) was implemented incorrectly. It is never used in the code base, but should probably be fixed nevertheless.

  2. Iterating over commits using the repository.log, object.NewCommitIterCTime or other iterators always loads the commit objects from disk for loose objects. Since we examined the commit parents inside the iterator we were essentially loading all the commits from disk twice. It is possible to rewrite our algorithms/loops to avoid that, but it seemed that the use case could be better serviced within the library.
    Proposed solution: Add small cache for the loaded loose objects. It is more efficient to keep couple of them in the memory instead of reading them from disk. This could probably be tweaked to cache only small objects where the I/O and syscalls are going to be most expensive compared to memory cost.

  3. Iterating deep in the history eventually started hitting the packfiles. The profiler and Process Monitor showed that there was significant time spent in OpenFile calls. Most of these OpenFile calls failed because the objects were stored in the packfiles and not as loose objects.
    Proposed solution: If the packfile indexes are already loaded then prefer them to loose object lookup. For our use case it improves the hit rate to almost 100% and avoids the unnecessary I/O calls. The indexes are already loaded in memory and should be cheap to check compared to hitting syscalls and disk. It may not be too efficient if many packfiles are present, but then the probability of objects being in the packfile is higher anyway. This simple optimization improved our algorithm performance by nearly 30%.

  4. The I/O patterns for reading small objects from packfiles was quite erratic. It resulted in almost 3x as much disk reads performed than necessary (checked by timeit tool) and it often loaded 4k buffered blocks only to seek back in the file and read an overlapping block again (seen in Process Monitor on Windows). It turned out to be caused by the way FSObject is implemented. There's potential for significant improvement.
    Proposed solution: For small objects use MemoryObject instead and read the content right away since it's already buffered in memory. I chose an arbitrary threshold of 16 Kb, which may not be ideal. Something like (4Kb - header size) would be a conservative value that would work for our use case too.

  5. Pack file index reading is done in 4Kb chunks, but it is mostly sequential reads that could easily use bigger buffer. This is not addressed within the PR.

@filipnavara
Copy link
Contributor Author

filipnavara commented Sep 24, 2018

Apparently the "Improve performace for reading many small objects from packfile by letting the I/O buffers be used better." change (nr. 4 in the list) is triggering some unwanted behavior with cache. I am looking into it.

@@ -224,7 +208,7 @@ func (p *Packfile) nextObject() (plumbing.EncodedObject, error) {

// If we have no filesystem, we will return a MemoryObject instead
// of an FSObject.
if p.fs == nil {
if p.fs == nil || h.Length <= 16*1024 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we move this magic number to a configurable param?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good idea.

(I only started learning Golang last Thursday, so if you have any pointers about proper/preferred code style I'd appreciate it.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add a const with a explanation of the variable

@@ -23,21 +23,24 @@ type ObjectStorage struct {
// deltaBaseCache is an object cache uses to cache delta's bases when
deltaBaseCache cache.Object

simpleObjectCache cache.Object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we reuse deltaBaseCache? Maybe we have to change its name to objectCache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could definitely be reused. I wasn't sure whether that would be a preferred option. On one hand the loose object cache doesn't have to be big and serves slightly different purpose. On the other hand I assume it would be uncommon to hit both loose objects and packfile objects at the same time, so reusing the cache shouldn't hurt much.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then use deltaBaseCache. I don't expect to have a penalty using the same cache for both and makes it simpler.

Copy link
Contributor

@mcuadros mcuadros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An awesome job is done here. Have you done any benchmarks? Can you show us? Thanks

plumbing/format/packfile/scanner.go Show resolved Hide resolved
@filipnavara
Copy link
Contributor Author

@mcuadros I don't have any scientific benchmarks (being a .NET guy I miss a tool like BenchmarkDotNet). For my specific use case (roughly the GIST link in the original description) on our repository with ~12 year of history, 3Gb of data and ~30000 commits it sped up my directory listing algorithm from 4s to 1.6s. It roughly corresponds to the reduced I/O calls shown by timeit and go tool ppref. Further improvements are possible, but this moved go-git for this specific use case into a usable territory in comparison to git command line. Now the profiler shows that the I/O is roughly 29% of the run time compared to 78% before the changes.

I am toying with some ideas how to make the commit graph traversal even faster and avoid a lot of parsing of information that is thrown away. Notably I have written a parser for the Git 2.18+ commit-graph files. It is very much work in progress and nothing quite ready to share yet.

@filipnavara filipnavara changed the title RFC: Performance optimizations for reading large commit histories Performance optimizations for reading large commit histories Oct 1, 2018
@jfontan
Copy link
Contributor

jfontan commented Oct 1, 2018

I've tested borges that is a tool that downloads and packs repositories in siva files. To do this it has to go through all the commits to repack the repos. Most of the times are lower and system time (Stime) is consistently smaller. Only the last repo takes more time than before. Not sure why.

#### Comparing /root/borges/borges-4.7.0 - /root/borges/borges-4.7.0-pr-963 ####
## Repo cangallo ##
Memory: 25528 -> 26780 (4.904418677530555), true
Wtime: 849.703176ms -> 889.788468ms (4.717564101466887), true
Stime: 140ms -> 170ms (21.428571428571427), false
Utime: 1.05s -> 920ms (-12.380952380952381), true
FileSize: 116541 -> 120423 (3.3310165521147064), true
## Repo octoprint-tft ##
Memory: 60824 -> 65160 (7.1287649611995265), true
Wtime: 8.727670689s -> 8.487030095s (-2.757214411209323), true
Stime: 710ms -> 550ms (-22.535211267605636), true
Utime: 9.61s -> 9.55s (-0.6243496357960457), true
FileSize: 2950179 -> 2956207 (0.20432658492925346), true
## Repo upsilon ##
Memory: 630096 -> 628164 (-0.30661994362763767), true
Wtime: 2m18.403927785s -> 2m11.427576858s (-5.040572936511767), true
Stime: 12.39s -> 10.1s (-18.48264729620662), true
Utime: 2m32.23s -> 2m25.9s (-4.158181698745319), true
FileSize: 100912676 -> 101071233 (0.1571229763047806), true
## Repo numpy ##
Memory: 1168112 -> 1232408 (5.504266714150698), true
Wtime: 7m5.497781807s -> 7m37.625167174s (7.550541210946323), true
Stime: 54.85s -> 46.12s (-15.916134913400182), true
Utime: 9m13.03s -> 10m35.02s (14.825597164710775), false
FileSize: 96717584 -> 110103219 (13.83991870599249), false

@filipnavara
Copy link
Contributor Author

The slow down could be caused by something I didn't think of. There are two things that could result in worse performance in some scenarios:

  1. When there is a lot of pack files and someone tries to look up loose object by hash. In that case the in-memory query with object hash across all loaded pack file indexes could be more expensive than making a syscall and hitting an OS disk cache.
  2. If the loose objects are inadvertently spilling too much of the object cache and slow-down later delta lookups.

I assumed that either of those scenarios are unlikely to be hit. For 1) my thinking is that the more packfiles there are the larger is the chance that the object is stored in them. And in the unlikely case that it's not then the hash table lookup should still be cheap. For 2) I assumed that at certain point in time one will either be hitting mostly loose objects or mostly objects in pack files. Not many algorithms or traversals are randomly accessing the objects in such a fashion that accesses to loose objects and pack file objects would interleave too much.

If the Borges scenario could be reproduced on my machine I can try to pinpoint the specific optimization (commit in this PR) that causes the slow down and work on it.

@filipnavara
Copy link
Contributor Author

I am not quite sure that I followed the right steps to reproduce your scenario. I created repos.txt file with one line: https://github.com/numpy/numpy.git. Then I built borges cli straight from GIT and executed ./borges pack --log-level=debug repos.txt. I did that three times without the patch and three times with the patch (against master, not 4.7). I took the time between "remote repository cloned" and "repository processed". The times I see are 2m56s with my patch, 2m59s with master. The difference is kinda in the margin of an error. However, the number are so much smaller than yours that I feel that I am actually testing a wrong thing. This is on a MacBook Pro 2017 model under macOS 10.14 with pretty speedy SSD.

@jfontan
Copy link
Contributor

jfontan commented Oct 2, 2018

I'm testing in a slow machine (Intel(R) Atom(TM) CPU C2550 @ 2.40GHz) with a network attached disk. That's why the numbers are that different. The difference in my machine with that repo is not that big. Around 7%. I was just curious why it could be as looking at the code it seems it should be faster.

The repos are testing are local to the machine where I'm doing the test and only have one packfile.

@ajnavarro
Copy link
Contributor

I did some really simple tests using this PR to compare against the master branch. I used this script on kubernetes repository:

package main

import (
    "fmt"
    "io"

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

func main() {
    r, err := git.PlainOpen(".git")
    CheckIfError(err)

    iter, err := r.CommitObjects()
    CheckIfError(err)
    for {
        c, err := iter.Next()
        if err == io.EOF {
            break
        }

        CheckIfError(err)
        fmt.Println(c.Hash.String())
    }

    iter.Close()
}

Instead of taking ~20secs it is taking ~1m30s.

Maybe this can be related with no usage of the delta cache on someplace.

@filipnavara
Copy link
Contributor Author

Just got back home after couple of weeks on vacation. As soon as I dig through my piled up work I will try to reproduce your benchmark and investigate it.

@smola
Copy link
Collaborator

smola commented Nov 19, 2018

When not interested in dangling commits, this will speed things up: #1024

…ready known or about to be thrown away anyway.

Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Filip Navara <[email protected]>
…tting the I/O buffers be used better.

Signed-off-by: Filip Navara <[email protected]>
…out-of-memory errors. This code path was never previously triggered for filesystem-based storage.

Signed-off-by: Filip Navara <[email protected]>
@filipnavara
Copy link
Contributor Author

@ajnavarro I run a profiler on it and tracked it to one of my changes. The logic for pre-loading of small objects was incorrectly applied also on deltas, which resulted in more file seeking and reading than intended, ie. exact opposite of what the optimisation tried to achieve.

I can't quite reproduce the numbers you have, but the fix reduced it from ~1m40s to ~30s on my machine (with profiling enabled).

@ajnavarro
Copy link
Contributor

Hi @filipnavara ,

Now, executing the script I provided above, I'm having the following results:

09:36 $ time /tmp/count-commits-2 | wc -l
80313

real	0m20.012s
user	0m19.432s
sys	0m1.480s

Thanks a lot to take care of this!

@smola
Copy link
Collaborator

smola commented Nov 27, 2018

@jfontan @ajnavarro What about borges? Does it run faster now with latest changes?

@jfontan
Copy link
Contributor

jfontan commented Nov 27, 2018

@smola Now borges is a little bit faster:

#### Comparing /root/borges/borges-4.8.0 - /root/borges/borges-4.8.0-pr-963 ####
## Repo cangallo ##
Memory: 24044 -> 24848 (3.343869572450507), true
Wtime: 783.30907ms -> 715.507071ms (-8.655842450541266), true
Stime: 130ms -> 150ms (15.384615384615385), false
Utime: 1.06s -> 990ms (-6.60377358490566), true
FileSize: 116333 -> 120157 (3.2871154358608474), true
## Repo octoprint-tft ##
Memory: 58632 -> 52472 (-10.506208213944603), true
Wtime: 8.633554855s -> 8.539363412s (-1.0909925816415051), true
Stime: 820ms -> 570ms (-30.48780487804878), true
Utime: 9.55s -> 9.28s (-2.8272251308900525), true
FileSize: 2950139 -> 2955791 (0.19158419315157693), true
## Repo upsilon ##
Memory: 628556 -> 613224 (-2.439241690477857), true
Wtime: 2m17.845137743s -> 2m11.257079352s (-4.779318660686348), true
Stime: 11.86s -> 11.02s (-7.082630691399664), true
Utime: 2m32.1s -> 2m25.09s (-4.608809993425378), true
FileSize: 100906120 -> 101068735 (0.16115474462797696), true
## Repo numpy ##
Memory: 1131220 -> 1180632 (4.3680274394017085), true
Wtime: 7m5.332720436s -> 6m56.547470917s (-2.0655005121624352), true
Stime: 55.89s -> 51.97s (-7.01377706208624), true
Utime: 9m11.83s -> 9m39.34s (4.985230958809779), true
FileSize: 96709754 -> 110124947 (13.871602858177056), false

@mcuadros mcuadros changed the title Performance optimizations for reading large commit histories plumbing: format/packfile, performance optimizations for reading large commit histories Nov 28, 2018
@mcuadros mcuadros merged commit 8f52c50 into src-d:master Nov 28, 2018
Snehal1112 added a commit to Snehal1112/go-git that referenced this pull request Dec 1, 2018
* plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes

The canonical Git client successfully decodes sideband packets up to
65524 bytes in length (4-byte header + 65520-byte payload). The Git
protocol documentation was updated in August 2016 to reduce the maximum
payload size to 65516 bytes, however old implementations still exist in
the wild emitting 65520-byte payloads.

As there is no technical difficulty with accepting (not emitting) larger
payload sizes, this change adjusts the limit check to allow successful
decoding of packets up to 65524 bytes. This change increases
compatibility with the current canonical Git implementation.

Doc changes from August 2016:
  git/git@7841c48#diff-52695c8fe91b78b70cea44562ae28297L67

Current packet buffer size is still LARGE_PACKET_MAX (+1 null):
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/sideband.c#L24
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/sideband.c#L36

LARGE_PACKET_MAX definition:
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/pkt-line.h#L100

Signed-off-by: Joseph Vusich <[email protected]>

* add PlainOpen variant to find .git in parent dirs

This is the git tool's behavior that people are used to; if one runs a
git command in a repository's subdirectory, git still works.

Fixes src-d#765.

Signed-off-by: Daniel Martí <[email protected]>

* use bsd superset for conditional compilation

Signed-off-by: wardn <[email protected]>

* config: adds branches to config for tracking branches against remotes, updates clone to track when cloning a branch. Fixes src-d#313

Signed-off-by: Jeremy Chambers <[email protected]>

* dotgit: ignore filenames that don't match a hash

For both packfiles and object files.

Issue: keybase/client#11366
Signed-off-by: Jeremy Stribling <[email protected]>

* storage: dotgit, init fixtures in benchmark. Fixes src-d#770

fixtures is not initialized in BenchmarkRefMultipleTimes and caused
panic.

Signed-off-by: Javi Fontan <[email protected]>

* git: remote, Add shallow commits instead of substituting. Fixes src-d#412

updateShallow substituted the previous shallow list with the one
returned by the UploadPackResponse. If the repository had previous
shallow commits these are deleted from the list.

This change adds the new shallow hashes to the old ones.

Signed-off-by: Javi Fontan <[email protected]>

* dotgit: add test for bad file in pack directory

Suggested by mcuadros.

Issue: src-d#807
Signed-off-by: Jeremy Stribling <[email protected]>

* Resolve full commit sha to plumbing hash

Signed-off-by: antham <[email protected]>

* storage: filesystem, close shallow file when read

Signed-off-by: Máximo Cuadros <[email protected]>

* git: worktree, Skip special git directory. Fixes src-d#814

Signed-off-by: kuba-- <[email protected]>

* travis: dropping 1.8.x support due to golang.org/x/crypto/ssh requirement

* Use remote name in fetch while clone

Fixes src-d#827

Signed-off-by: Dustin Frisch <[email protected]>

* Worktree: Provide ability to add excludes  (src-d#825)

Worktree: Provide ability to add excludes

* Teach ResolveRevision how to look up annotated tags

Signed-off-by: Mike Lundy <[email protected]>

* git: remote, Do not iterate all references on update.

The current code iterates all the references in the remote to check if
they match the refspec. This is OK when the refspec is a wildcard but
is a waste of time when they are not.

A hash with references is generated for fast access before starting the
update and used only when the refspec is not a wildcard.

In a repository with 7800 references this meant 7800 * 7800 checks. With
the current code it took 8m30s to update the references. With the new
code it takes less than 0.5s.

References are already extensively tested in remote_test.go.

Signed-off-by: Javi Fontan <[email protected]>

* idxfile: optimise allocations in readObjectNames

This makes all the required Entry allocations in one go,
instead of huge amounts of small individual allocations.

Signed-off-by: David Symonds <[email protected]>

* packfile: improve Index memory representation to be more compact

Instead of using a map for offset indexing, use a sorted slice.
Binary searching is fast, and a slice is much more compact.
This has a negligible hit on speed, but has a significant impact on
memory usage, especially for larger repos.

benchmark                         old ns/op     new ns/op     delta
BenchmarkIndexConstruction-12     15506506      14056098      -9.35%

benchmark                         old allocs     new allocs     delta
BenchmarkIndexConstruction-12     60764          60385          -0.62%

benchmark                         old bytes     new bytes     delta
BenchmarkIndexConstruction-12     4318145       3913169       -9.38%

Signed-off-by: David Symonds <[email protected]>

* config: modules, Ignore submodules with dotdot '..' path components. Fixes CVE-2018-11235

References:
 * https://blogs.msdn.microsoft.com/devops/2018/05/29/announcing-the-may-2018-git-security-vulnerability/
 * https://security-tracker.debian.org/tracker/CVE-2018-11235
 * git/git@0383bbb

Signed-off-by: Joseph Vusich <[email protected]>

* worktree: Don't allow .gitmodules to be a symlink. Fixes CVE-2018-11235

References:
 * https://blogs.msdn.microsoft.com/devops/2018/05/29/announcing-the-may-2018-git-security-vulnerability/
 * https://security-tracker.debian.org/tracker/CVE-2018-11235
 * git/git@10ecfa7

Signed-off-by: Joseph Vusich <[email protected]>

* dotgit: Move package outside internal.

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* Remove println

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* plumbing: object, adds tree path cache to trees. Fixes src-d#793

The cache is used in Tree.FindEntry for faster path search.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: packfile, Don't push empty objects. Fixes src-d#840

Signed-off-by: kuba-- <[email protected]>

* storage: filesystem, make ObjectStorage constructor public

Signed-off-by: Miguel Molina <[email protected]>

* plumbing/transport: http, Adds token authentication support [Fixes src-d#858]

Signed-off-by: Eric Billingsley <[email protected]>

* Fix documentation for Notes

It previously said that it returned all references that are branches, but that's not true.

Signed-off-by: Morgan Bazalgette <[email protected]>

* packfile: optimise NewIndexFromIdxFile for a very common case

Loading from an on-disk idxfile will usually already have the idxfile
entries in order, so check that before wasting time on sorting.

Signed-off-by: David Symonds <[email protected]>

* Remote.Fetch: error on missing remote reference

Signed-off-by: Máximo Cuadros <[email protected]>

* storage/filesystem: avoid norwfs build flag

norwfs build flag was used to work on filesystems that do not support neither opening a file in read/write mode or renaming a file (e.f. sivafs).

This had two problems:

- go-git could not be compiled to work properly both with regular filesystems and limited filesystems at the same time.
- the norwfs trick was not available on Windows.

This PR removes the norwfs build flag, as well as the windows conditional flag on the dotgit package.

For the file open mode, we use the new billy capabilities, to check at runtime if the filesystem supports opening a file in read/write mode or not.

For the renaming, we just try and fallback to alternative methods if billy.ErrNotSupported is returned.

Signed-off-by: Santiago M. Mola <[email protected]>

* utils: diff, skip useless rune->string conversion

According to library documentation :
https://github.com/sergi/go-diff/blob/master/diffmatchpatch/diff.go#L391

Signed-off-by: Marc Barussaud <[email protected]>

* plumbing: add context to allow cancel on diff/patch computing

Signed-off-by: Marc Barussaud <[email protected]>

* worktree: add test for correct tree sorting (issue src-d#881)

Signed-off-by: Mark Bartel <[email protected]>

* worktree: sort the tree object.  Fixes src-d#881

Signed-off-by: Mark Bartel <[email protected]>

* worktree: address PR comments: sort imports appropriately

Signed-off-by: Mark Bartel <[email protected]>

* plumbing: object, expose ErrEntryNotFound in FindEntry. Fixes src-d#883

FindEntry will return ErrDirNotFound if the directory doesn't exist. But
it doesn't return a public error if the entry itself is missing.  This
exposes the internal error ErrEntryNotFound, so users can
programmatically check for this condition.

Signed-off-by: James Ravn <[email protected]>

* plumbing/transport/internal: common, add support of Gogs for ErrRepositoryNotFound, avoiding to get an 'unknown error: '. Add some tests for existing supported services (github, gitlab, etc...) too.

Signed-off-by: Jerome Doucet <[email protected]>

* plumbing/object: fix pgp signature encoder/decoder

The way of reading pgp signatures was searching for pgp begin line in
the header. This caused problems when this string appeared and was not
part of the signature. For example if it appears in the message as an
example or is part of the author name the decoder starts treating it as
a signature. In this state the code was not able to notice then the
header ended so it entered in an infinite loop searching for pgp end
string.

Now it uses the same method as original git. Searches for gpgsig section
in header and starts getting all lines until the next part.

In encoder the string used to add signatures was incorrect. It is now
changed to the proper "gpgsig" string instead of "pgpsig".

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/format/idxfile: add new Index and MemoryIndex

Signed-off-by: Miguel Molina <[email protected]>

* plumbing/packfile: add new packfile parser

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: disable lookup by offset

In one case it disables the cache and the other disables lookup when
the scanner is not seekable. Could be added back later.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: idxfile, add idxfile.Writer with Observer interface

It's still not complete:

* 64 bit offsets
* IdxChecksum

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: use Entry to hold object data

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: support offset64 generating indexes

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: preallocate memory in PatchDelta

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: fix bug searching in MemoryIndex

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: add offset/hash mapping to index

This functionality may be moved elsewhere in the future but is needed
now to fit filesystem.ObjectStorage and the new index.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: index is created only once and retrieved with Index

Index is also automatically generated when OnFooter is called.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing, storage: integrate new index

Now dotgit.PackWriter uses the new packfile.Parser and index.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: packfile, new Packfile representation

Signed-off-by: Miguel Molina <[email protected]>

* plumbing, packfile: delete index_test as is no longer used

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: fix two errors in idxfile and packfile decoder

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: add back IndexStorage

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: packfile, lazy object reads with DiskObjects

Signed-off-by: Miguel Molina <[email protected]>

* plumbing/idxfile: test FindHash and writer with 64 bit offsets

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: remove duplicated IndexStorage

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: add index generation to decoder

Signed-off-by: Javi Fontan <[email protected]>

* Fix wrong godoc on Tags() method.

Reword Tags() method documentation. Point to TagObjects() method to get all the tags on a repository.

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* plumbing: packfile, fix package tests

Signed-off-by: Miguel Molina <[email protected]>

* *: use parser to populate non writable storages and bug fixes

Signed-off-by: Miguel Molina <[email protected]>

* Fixed cloning of a single tag

Relates to src-d#870

Signed-off-by: Fedor Korotkov <[email protected]>

* plumbing: packfile, allow non-seekable sources on Parser

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, add Parse benchmark

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, read object content only once

Signed-off-by: Miguel Molina <[email protected]>

* storage: filesystem, benchmark PackfileIter

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, rename DiskObject to FSObject

Signed-off-by: Miguel Molina <[email protected]>

* storage: filesystem, close Packfile after iterating objects

Signed-off-by: Miguel Molina <[email protected]>

* storage: filesystem, add PackfileIter benchmark reading object content

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, open and close packfile on FSObject reads

Signed-off-by: Miguel Molina <[email protected]>

* git: add benchmark for iterating repository objects

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: idxfile, Crc32 to CRC32 and return ok from findHashIndex

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: add buffer cache and use it in packfile parser

It uses less memory and is faster as slices don't have to be converted
from/to MemoryObject and they are indexed by offset.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/pacfile: tidy up objectInfo struct

* a new hasher is created when needed
* delete unused fields
* base content is no longer kept in memory

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: do not compute sha1 for already undeltified objects

Signed-off-by: Javi Fontan <[email protected]>

* added hook support

Signed-off-by: noxora <[email protected]>

trying a possible fix to the delete test

Signed-off-by: noxora <[email protected]>

still trying to fix this test

Signed-off-by: noxora <[email protected]>

fixes did not work, seems to be a windows env problem

Signed-off-by: noxora <[email protected]>

* plumbing: object, Don't add new line at end of commit signature

The way that commit signatures were being written out was causing an
extra newline to be written at the end of the commit when the message
encoding was already taking care of this. Ultimately, this results in a
corrupt object, rendering the object unverifiable with the signature in
the commit.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add ability to PGP sign commits

This adds the ability to sign commits by adding the SignKey field to
CommitOptions. If present, the commit will be signed during the
WorkTree.Commit call.

The supplied SignKey must already be decrypted by the caller.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Remove use of strings.Builder

This was added in Go 1.10 and is not supported on Go 1.9. Switched to
bytes.Buffer to ensure compatibility.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Remove old hash validation code

This will not work for a signed commit as with the GPG signature being a
part of the commit, the hash is now non-deterministic.

Verification of the commit is done through the validation of the
signature.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add extra test for testing bad key error case

I'm hoping this helps get codecov to a tolerable delta. :)

Signed-off-by: Chris Marchesi <[email protected]>

* dotgit: fix object delete test

Signed-off-by: Santiago M. Mola <[email protected]>

* object: fix panic when reading object header

When the first line of the pgp signature is an empty line or some header
is malformed it crashes as there's no data for the header element. For
example, if author name is "\n".

Signed-off-by: Javi Fontan <[email protected]>

* Fixed an edge case for .gitignore

Fixes src-d#923

Signed-off-by: Fedor Korotkov <[email protected]>

* plumbing/idxfile: object iterators returns entries in offset order

In the latest change the order was changed from offset order in
packfiles to hash order. This makes reading all the objects not as
efficient as before. It also created problems when the previous order
was expected.

Also added EntriesByOffset to indexes.

Signed-off-by: Javi Fontan <[email protected]>

* git: Add tagging support

This adds a few methods:

* CreateTag, which can be used to create both lightweight and annotated
tags with a supplied TagObjectOptions struct. PGP signing is possible as
well.
* Tag, to fetch a single tag ref. As opposed to Tags or TagObjects, this
will also fetch the tag object if it exists and return it along with the
output. Lightweight tags just return the object as nil.
* DeleteTag, to delete a tag. This simply deletes the ref. The object is
left orphaned to be GCed later.

I'm not 100% sure if DeleteTag is the correct behavior - looking for
details on exactly *what* happens to a tag object if you delete the ref
and not the tag were sparse, and groking the Git source did not really
produce much insight to the untrained eye. This may be something that
comes up in review. If deletion of the object is necessary, the
in-memory storer may require some updates to allow DeleteLooseObject to
be supported.

Signed-off-by: Chris Marchesi <[email protected]>

* plumbing: object, correct tag PGP encoding

As with the update in ec3d2a8, tag encoding needed to be corrected to
ensure extra newlines were not being added in during tag object
encoding, so that it did not corrupt the object for verification.

Signed-off-by: Chris Marchesi <[email protected]>

* plumbing: object, don't add extra newline on PGP signature

Tag encoding/decoding seems to be a lot more sensitive to requiring the
exact expected format in the object, which generally includes messages
canonicalized so that they have a newline on the end (even if they
didn't before).

As such, the message should be written with the newline (no need for an
extra), and the PGP signature right after that, which will be newline
split already, so there's no need to split it again.

All of this means it's very important for the caller to send the message
in the correct format - which I'm correcting in the next commit.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Canonicalize incoming annotated tag messages

Tag messages are highly sensitive to being in the expected format,
especially when encoding/decoding for PGP verification.

As such, we do a simple trimming of whitespace on the incoming message
and add a newline on the end, to ensure there are no surprises here.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Replace test signing key with one with longer expiry

The old one was created with defaults, which would have caused CI
failures in 2 years.

The new one is valid for 10 years:

> gpg --list-secret-keys
/root/.gnupg/pubring.kbx
------------------------
sec   rsa4096 2018-08-22 [SC] [expires: 2028-08-19]
      93A17FF01E54328546087C8E029395402EFCCD53
uid           [ unknown] foo bar <[email protected]>

Signed-off-by: Chris Marchesi <[email protected]>

* plumbing, storage: add bases to the common cache

After clone only resolved deltas were added to the cache. This caused
slowdowns in small repositories where most objects can be held in cache.

It also makes packfiles reuse delta cache from the store. Previously it
created a new delta cache each time a packfile object was created. This
also slowed down a bit accessing objects and had an impact on memory
consumption when bases are added to the cache.

Signed-off-by: Javi Fontan <[email protected]>

* git: Discern tag target type from supplied hash

I figured there was a way to do this without having to have
TagObjectOptions supply this in - there is.

Added support for this in and removed the object type from
TagObjectOptions.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Don't return tag object with Tag, adjust docs for Tag and Tags

I've mainly noticed that in using the current Tag function, that there
were lots of times that I was ignoring the ref or the object, depending
on what I needed. This was evident in the tests as well. As such, I
think it just makes more sense for a singular tag fetcher to return just
a ref, through which the caller may grab the annotation if they need it,
and if it exists.

Also, contrary to the docs on Tags, all tags have a ref, even if they
are annotated. The difference between a lightweight tag and an annotated
tag is the presence of the tag object, which the ref will point to if
the tag is annotated. As such I've adjusted the docs with an example as
to how one can get the annotation for a tag ref through the iterator.

Source: https://git-scm.com/book/en/v2/Git-Internals-Git-References,
tags section.

Signed-off-by: Chris Marchesi <[email protected]>

* storage/dotgit: search for incoming dir only once

Search for incoming object directory was done once each time objects
were accessed. This means a ReadDir of the objects path that is
expensive. Now incoming directory is searched the first time an object
is accessed and its name kept in DotGit to be reused.

Signed-off-by: Javi Fontan <[email protected]>

* storage/dotgit: use HasPrefix instead of Split

Also reformatted function comment and fixed some typos.

Signed-off-by: Javi Fontan <[email protected]>

* Remove empty dirs when cleaning with Dir opt.

Signed-off-by: kuba-- <[email protected]>

* Add Status.IsUntracked function

Signed-off-by: kuba-- <[email protected]>

* plumbing: object: Clamp object timestamps before unix epoch to unix epoch

Signed-off-by: Taru Karttunen <[email protected]>

* config: add commentChar to core config struct

Signed-off-by: Zaq? Wiedmann <[email protected]>

* git: add Static option to PlainOpen

Also adds Static configuration to Storage and DotGit. This option means
that the git repository is not expected to be modified while open and
enables some optimizations.

Each time a file is accessed the storer tries to open an object file for
the requested hash. When this is done for a lot of objects it is
expensive. With Static option a list of object files is generated the
first time an object is accessed and used to check if exists instead of
using system calls.

A similar optimization is done for packfiles.

Signed-off-by: Javi Fontan <[email protected]>

* git, storer: use a common storer.Options for storer and PlainOpen

Signed-off-by: Javi Fontan <[email protected]>

* dotgit: fix typo in comment

Signed-off-by: Javi Fontan <[email protected]>

* git: do not expose storage options in PlainOpen

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/storer: rename Static option to ExclusiveAccess

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: make Storage options private

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: move Options to filesytem and dotgit

Signed-off-by: Javi Fontan <[email protected]>

* storage/dotgit: add ExclusiveAccess tests in dotgit

This functionality was already tested in storage/filesystem.
The coverage tool only takes into account files from the same
package of the test.

Signed-off-by: Javi Fontan <[email protected]>

* storage/dotgit: add KeepDescriptors option

This option maintains packfile file descriptors opened after reading
objects from them. It improves performance as it does not have to be
opening packfiles each time an object is needed.

Also adds Close to EncodedObjectStorer to close all the files manualy.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/storer: do not expose Close in EncodedObjectStorer interface

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: add KeepDescriptors test

Also delete Close from MockObjectStorage and memory storer.

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: compare files using offset in test

Using equals to compare files it uses diff to do so. This can
potentially consume lots of ram. Changed the comparison to use file
offsets. If the descriptor is reused the offset is maintained.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/transport: ssh check if list of known_hosts files is empty

Signed-off-by: kuba-- <[email protected]>

* Fix fatal corrupt patch in unified diff format

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* Expose Storage cache.

Signed-off-by: kuba-- <[email protected]>

* git: s/fetch/returns/ on Tag function doc

This is to avoid any ambiguity with the act of "fetching" in git in
general.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add Tag objects to the list of supported objects for walking

This is necessary to support pruning on Tag objects.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Don't touch tag objects orphaned by tag deletion

Deleting a tag ref for an annotated tag in normal git behavior does not
delete the tag object right away. This is handled by the normal GC
process.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add some tests for annotated tag deletion

Added a couple of tests for annotated tag deletion:

* The first one is a general test and should work regardless of the
fixture used - the tag object could possibly be packed, so we do a prune
*and* a repack operation before testing to see if the object was GCed
correctly.

* The second one actually creates the tag to be deleted, so that the tag
object gets created as a loose, unpacked object. This is so we can
effectively test that purning unpacked objects is now working 100%
correctly (this was failing before because tag objects were not
supported for walking).

Signed-off-by: Chris Marchesi <[email protected]>

* git: s/TagObjectOptions/CreateTagOptions/

Just renaming the TagObjectOptions type to CreateTagOptions so that it's
consistent with the other option types.

Signed-off-by: Chris Marchesi <[email protected]>

* repository: fix test for new Storage constructor

Signed-off-by: Máximo Cuadros <[email protected]>

* *: go modules support

Signed-off-by: Máximo Cuadros <[email protected]>

* travis: drop go1.9 add go1.11

* Fix potential LRU cache size issue.

Signed-off-by: kuba-- <[email protected]>

* Remove empty space to trigger windows build.

Signed-off-by: kuba-- <[email protected]>

* storage/filesystem: keep packs open in PackfileIter

PackfileIter was not taking into account the option KeepDescriptors
and was always closing the file. This caused "file already closed"
errors when iterating packfiles in with KeepDescriptors active.

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: add more doc to NewPackfileIter

Signed-off-by: Javi Fontan <[email protected]>

* all: remove extra 's' in "mismatch"

Signed-off-by: Jongmin Kim <[email protected]>

* test: improve test for urlencoded user:pass

Signed-off-by: Santiago M. Mola <[email protected]>

* use time.IsZero in Prune

Signed-off-by: u5surf <[email protected]>

* Add test for Windows local paths.

Signed-off-by: Filip Navara <[email protected]>

* git: Fix Status.IsClean() documentation

The documentation of the IsClean Method contained a negation, so it was
describing the opposite of its actual behavior.

Fixes src-d#838

Signed-off-by: David Url <[email protected]>

* Plumbing: object, Add support for Log with filenames. Fixes src-d#826 (src-d#979)

plumbing: object, Add support for Log with filenames. Fixes src-d#826

* object: get object size without reading whole object

Signed-off-by: Jeremy Stribling <[email protected]>

* tree: add a Size() method for getting plaintext size

Without reading the entire object into memory.

Signed-off-by: Jeremy Stribling <[email protected]>

* filesystem: add a new test for EncodedObjectSize

Suggested by taruti.

Signed-off-by: Jeremy Stribling <[email protected]>

* repository: allow open non-bare repositories as bare

Signed-off-by: Máximo Cuadros <[email protected]>

* use remote name in fetch while clone, test

Signed-off-by: Máximo Cuadros <[email protected]>

* references: sort: compare author timestamps when commit timestamps are equal, test

Signed-off-by: Máximo Cuadros <[email protected]>

* teach ResolveRevision how to look up annotated tags, test

Signed-off-by: Máximo Cuadros <[email protected]>

* teach ResolveRevision how to look up annotated tags, test

Signed-off-by: Máximo Cuadros <[email protected]>

* packfile: add comment on GetSizeByOffset

Suggested by mcuadros.

Issue: src-d#982
Signed-off-by: Jeremy Stribling <[email protected]>

* blame: fix edge case with missing \n in content length causing mismatched length error

Signed-off-by: Máximo Cuadros <[email protected]>

* repository: improve CheckoutOption.Hash doc

Signed-off-by: Máximo Cuadros <[email protected]>

* remote: use reference deltas on push when the remote server does not
support offset deltas

Signed-off-by: Benjamin Ash <[email protected]>

* Fixed a typo. (src-d#989)

README: Fixed a typo.

* Enables building on openbsd, dragonfly bsd and solaris

Signed-off-by: Yuce Tekol <[email protected]>

* plumbing/format/packfile: Fix broken "thin" packfile support. Fixes src-d#991

Signed-off-by: Javier Peletier <[email protected]>

* plumbing: ReferenceName constructors

Signed-off-by: Máximo Cuadros <[email protected]>

* examples  & documentation: PlainClone with Basic Authentication (Password & Access Token) (src-d#990)

examples: PlainClone with Basic Authentication (Password & Access Token)

* add StackOverflow to support channels

Since we are not redirecting users to StackOverflow for support
questions, it makes sense to add it to the official support channels.

Signed-off-by: Santiago M. Mola <[email protected]>

* plumbing: transport/http, Add missing host/port on redirect. Fixes src-d#820

Signed-off-by: Dave Henderson <[email protected]>

* Fix spelling and grammar in docs and example

Signed-off-by: Lukasz Kokot <[email protected]>

* update gcfg dependency to v1.4.0

Signed-off-by: Dave Henderson <[email protected]>

* repository: added cleanup for the PlainCloneContext()

Signed-off-by: Bartek Jaroszewski <[email protected]>

* improve cleanup implementation, add more tests

Signed-off-by: Santiago M. Mola <[email protected]>

* Update LICENSE

Signed-off-by: Máximo Cuadros <[email protected]>

* http: improve TokenAuth documentation

Users are often confused with TokenAuth, since it might look that it
should be used with GitHub's OAuth tokens. But that is not the case.

TokenAuth implements HTTP bearer authentication. Most git servers will
use HTTP basic authentication (user+passwords) even for OAuth tokens.

Signed-off-by: Santiago M. Mola <[email protected]>

* plumbing: ssh, Fix flaky test TestAdvertisedReferencesNotExists. Fixes src-d#969

Signed-off-by: Colton McCurdy <[email protected]>

* repository: Fix RefSpec for a single tag. Fixes src-d#960

Signed-off-by: Fedor Korotkov <[email protected]>

* storage/filesystem: Added reindex method to  reindex packfiles

Signed-off-by: Javier Peletier <[email protected]>

* plumbing/format/packfile: Added thin pack test

Signed-off-by: Javier Peletier <[email protected]>

* Remove unused method (src-d#1022)

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* plumbing: format/index: support for EOIE extension, by default on git v2.2.0

Signed-off-by: Máximo Cuadros <[email protected]>

* repository: fix plain clone error handling regression

PR src-d#1008 introduced a regression by changing the errors returned by
PlainClone when a repository did not exist.

This change goes back to returned errors as they were in v4.7.0.

Fixes src-d#1027

Signed-off-by: Santiago M. Mola <[email protected]>

* plumbing: format/packfile, performance optimizations for reading large commit histories (src-d#963)

Signed-off-by: Filip Navara <[email protected]>
Snehal1112 added a commit to Snehal1112/go-git that referenced this pull request Dec 2, 2018
* plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes

The canonical Git client successfully decodes sideband packets up to
65524 bytes in length (4-byte header + 65520-byte payload). The Git
protocol documentation was updated in August 2016 to reduce the maximum
payload size to 65516 bytes, however old implementations still exist in
the wild emitting 65520-byte payloads.

As there is no technical difficulty with accepting (not emitting) larger
payload sizes, this change adjusts the limit check to allow successful
decoding of packets up to 65524 bytes. This change increases
compatibility with the current canonical Git implementation.

Doc changes from August 2016:
  git/git@7841c48#diff-52695c8fe91b78b70cea44562ae28297L67

Current packet buffer size is still LARGE_PACKET_MAX (+1 null):
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/sideband.c#L24
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/sideband.c#L36

LARGE_PACKET_MAX definition:
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/pkt-line.h#L100

Signed-off-by: Joseph Vusich <[email protected]>

* add PlainOpen variant to find .git in parent dirs

This is the git tool's behavior that people are used to; if one runs a
git command in a repository's subdirectory, git still works.

Fixes src-d#765.

Signed-off-by: Daniel Martí <[email protected]>

* use bsd superset for conditional compilation

Signed-off-by: wardn <[email protected]>

* config: adds branches to config for tracking branches against remotes, updates clone to track when cloning a branch. Fixes src-d#313

Signed-off-by: Jeremy Chambers <[email protected]>

* dotgit: ignore filenames that don't match a hash

For both packfiles and object files.

Issue: keybase/client#11366
Signed-off-by: Jeremy Stribling <[email protected]>

* storage: dotgit, init fixtures in benchmark. Fixes src-d#770

fixtures is not initialized in BenchmarkRefMultipleTimes and caused
panic.

Signed-off-by: Javi Fontan <[email protected]>

* git: remote, Add shallow commits instead of substituting. Fixes src-d#412

updateShallow substituted the previous shallow list with the one
returned by the UploadPackResponse. If the repository had previous
shallow commits these are deleted from the list.

This change adds the new shallow hashes to the old ones.

Signed-off-by: Javi Fontan <[email protected]>

* dotgit: add test for bad file in pack directory

Suggested by mcuadros.

Issue: src-d#807
Signed-off-by: Jeremy Stribling <[email protected]>

* Resolve full commit sha to plumbing hash

Signed-off-by: antham <[email protected]>

* storage: filesystem, close shallow file when read

Signed-off-by: Máximo Cuadros <[email protected]>

* git: worktree, Skip special git directory. Fixes src-d#814

Signed-off-by: kuba-- <[email protected]>

* travis: dropping 1.8.x support due to golang.org/x/crypto/ssh requirement

* Use remote name in fetch while clone

Fixes src-d#827

Signed-off-by: Dustin Frisch <[email protected]>

* Worktree: Provide ability to add excludes  (src-d#825)

Worktree: Provide ability to add excludes

* Teach ResolveRevision how to look up annotated tags

Signed-off-by: Mike Lundy <[email protected]>

* git: remote, Do not iterate all references on update.

The current code iterates all the references in the remote to check if
they match the refspec. This is OK when the refspec is a wildcard but
is a waste of time when they are not.

A hash with references is generated for fast access before starting the
update and used only when the refspec is not a wildcard.

In a repository with 7800 references this meant 7800 * 7800 checks. With
the current code it took 8m30s to update the references. With the new
code it takes less than 0.5s.

References are already extensively tested in remote_test.go.

Signed-off-by: Javi Fontan <[email protected]>

* idxfile: optimise allocations in readObjectNames

This makes all the required Entry allocations in one go,
instead of huge amounts of small individual allocations.

Signed-off-by: David Symonds <[email protected]>

* packfile: improve Index memory representation to be more compact

Instead of using a map for offset indexing, use a sorted slice.
Binary searching is fast, and a slice is much more compact.
This has a negligible hit on speed, but has a significant impact on
memory usage, especially for larger repos.

benchmark                         old ns/op     new ns/op     delta
BenchmarkIndexConstruction-12     15506506      14056098      -9.35%

benchmark                         old allocs     new allocs     delta
BenchmarkIndexConstruction-12     60764          60385          -0.62%

benchmark                         old bytes     new bytes     delta
BenchmarkIndexConstruction-12     4318145       3913169       -9.38%

Signed-off-by: David Symonds <[email protected]>

* config: modules, Ignore submodules with dotdot '..' path components. Fixes CVE-2018-11235

References:
 * https://blogs.msdn.microsoft.com/devops/2018/05/29/announcing-the-may-2018-git-security-vulnerability/
 * https://security-tracker.debian.org/tracker/CVE-2018-11235
 * git/git@0383bbb

Signed-off-by: Joseph Vusich <[email protected]>

* worktree: Don't allow .gitmodules to be a symlink. Fixes CVE-2018-11235

References:
 * https://blogs.msdn.microsoft.com/devops/2018/05/29/announcing-the-may-2018-git-security-vulnerability/
 * https://security-tracker.debian.org/tracker/CVE-2018-11235
 * git/git@10ecfa7

Signed-off-by: Joseph Vusich <[email protected]>

* dotgit: Move package outside internal.

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* Remove println

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* plumbing: object, adds tree path cache to trees. Fixes src-d#793

The cache is used in Tree.FindEntry for faster path search.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: packfile, Don't push empty objects. Fixes src-d#840

Signed-off-by: kuba-- <[email protected]>

* storage: filesystem, make ObjectStorage constructor public

Signed-off-by: Miguel Molina <[email protected]>

* plumbing/transport: http, Adds token authentication support [Fixes src-d#858]

Signed-off-by: Eric Billingsley <[email protected]>

* Fix documentation for Notes

It previously said that it returned all references that are branches, but that's not true.

Signed-off-by: Morgan Bazalgette <[email protected]>

* packfile: optimise NewIndexFromIdxFile for a very common case

Loading from an on-disk idxfile will usually already have the idxfile
entries in order, so check that before wasting time on sorting.

Signed-off-by: David Symonds <[email protected]>

* Remote.Fetch: error on missing remote reference

Signed-off-by: Máximo Cuadros <[email protected]>

* storage/filesystem: avoid norwfs build flag

norwfs build flag was used to work on filesystems that do not support neither opening a file in read/write mode or renaming a file (e.f. sivafs).

This had two problems:

- go-git could not be compiled to work properly both with regular filesystems and limited filesystems at the same time.
- the norwfs trick was not available on Windows.

This PR removes the norwfs build flag, as well as the windows conditional flag on the dotgit package.

For the file open mode, we use the new billy capabilities, to check at runtime if the filesystem supports opening a file in read/write mode or not.

For the renaming, we just try and fallback to alternative methods if billy.ErrNotSupported is returned.

Signed-off-by: Santiago M. Mola <[email protected]>

* utils: diff, skip useless rune->string conversion

According to library documentation :
https://github.com/sergi/go-diff/blob/master/diffmatchpatch/diff.go#L391

Signed-off-by: Marc Barussaud <[email protected]>

* plumbing: add context to allow cancel on diff/patch computing

Signed-off-by: Marc Barussaud <[email protected]>

* worktree: add test for correct tree sorting (issue src-d#881)

Signed-off-by: Mark Bartel <[email protected]>

* worktree: sort the tree object.  Fixes src-d#881

Signed-off-by: Mark Bartel <[email protected]>

* worktree: address PR comments: sort imports appropriately

Signed-off-by: Mark Bartel <[email protected]>

* plumbing: object, expose ErrEntryNotFound in FindEntry. Fixes src-d#883

FindEntry will return ErrDirNotFound if the directory doesn't exist. But
it doesn't return a public error if the entry itself is missing.  This
exposes the internal error ErrEntryNotFound, so users can
programmatically check for this condition.

Signed-off-by: James Ravn <[email protected]>

* plumbing/transport/internal: common, add support of Gogs for ErrRepositoryNotFound, avoiding to get an 'unknown error: '. Add some tests for existing supported services (github, gitlab, etc...) too.

Signed-off-by: Jerome Doucet <[email protected]>

* plumbing/object: fix pgp signature encoder/decoder

The way of reading pgp signatures was searching for pgp begin line in
the header. This caused problems when this string appeared and was not
part of the signature. For example if it appears in the message as an
example or is part of the author name the decoder starts treating it as
a signature. In this state the code was not able to notice then the
header ended so it entered in an infinite loop searching for pgp end
string.

Now it uses the same method as original git. Searches for gpgsig section
in header and starts getting all lines until the next part.

In encoder the string used to add signatures was incorrect. It is now
changed to the proper "gpgsig" string instead of "pgpsig".

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/format/idxfile: add new Index and MemoryIndex

Signed-off-by: Miguel Molina <[email protected]>

* plumbing/packfile: add new packfile parser

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: disable lookup by offset

In one case it disables the cache and the other disables lookup when
the scanner is not seekable. Could be added back later.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: idxfile, add idxfile.Writer with Observer interface

It's still not complete:

* 64 bit offsets
* IdxChecksum

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: use Entry to hold object data

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: support offset64 generating indexes

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: preallocate memory in PatchDelta

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: fix bug searching in MemoryIndex

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: add offset/hash mapping to index

This functionality may be moved elsewhere in the future but is needed
now to fit filesystem.ObjectStorage and the new index.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/idxfile: index is created only once and retrieved with Index

Index is also automatically generated when OnFooter is called.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing, storage: integrate new index

Now dotgit.PackWriter uses the new packfile.Parser and index.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: packfile, new Packfile representation

Signed-off-by: Miguel Molina <[email protected]>

* plumbing, packfile: delete index_test as is no longer used

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: fix two errors in idxfile and packfile decoder

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: add back IndexStorage

Signed-off-by: Javi Fontan <[email protected]>

* plumbing: packfile, lazy object reads with DiskObjects

Signed-off-by: Miguel Molina <[email protected]>

* plumbing/idxfile: test FindHash and writer with 64 bit offsets

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: remove duplicated IndexStorage

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: add index generation to decoder

Signed-off-by: Javi Fontan <[email protected]>

* Fix wrong godoc on Tags() method.

Reword Tags() method documentation. Point to TagObjects() method to get all the tags on a repository.

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* plumbing: packfile, fix package tests

Signed-off-by: Miguel Molina <[email protected]>

* *: use parser to populate non writable storages and bug fixes

Signed-off-by: Miguel Molina <[email protected]>

* Fixed cloning of a single tag

Relates to src-d#870

Signed-off-by: Fedor Korotkov <[email protected]>

* plumbing: packfile, allow non-seekable sources on Parser

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, add Parse benchmark

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, read object content only once

Signed-off-by: Miguel Molina <[email protected]>

* storage: filesystem, benchmark PackfileIter

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, rename DiskObject to FSObject

Signed-off-by: Miguel Molina <[email protected]>

* storage: filesystem, close Packfile after iterating objects

Signed-off-by: Miguel Molina <[email protected]>

* storage: filesystem, add PackfileIter benchmark reading object content

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: packfile, open and close packfile on FSObject reads

Signed-off-by: Miguel Molina <[email protected]>

* git: add benchmark for iterating repository objects

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: idxfile, Crc32 to CRC32 and return ok from findHashIndex

Signed-off-by: Miguel Molina <[email protected]>

* plumbing: add buffer cache and use it in packfile parser

It uses less memory and is faster as slices don't have to be converted
from/to MemoryObject and they are indexed by offset.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/pacfile: tidy up objectInfo struct

* a new hasher is created when needed
* delete unused fields
* base content is no longer kept in memory

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/packfile: do not compute sha1 for already undeltified objects

Signed-off-by: Javi Fontan <[email protected]>

* added hook support

Signed-off-by: noxora <[email protected]>

trying a possible fix to the delete test

Signed-off-by: noxora <[email protected]>

still trying to fix this test

Signed-off-by: noxora <[email protected]>

fixes did not work, seems to be a windows env problem

Signed-off-by: noxora <[email protected]>

* plumbing: object, Don't add new line at end of commit signature

The way that commit signatures were being written out was causing an
extra newline to be written at the end of the commit when the message
encoding was already taking care of this. Ultimately, this results in a
corrupt object, rendering the object unverifiable with the signature in
the commit.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add ability to PGP sign commits

This adds the ability to sign commits by adding the SignKey field to
CommitOptions. If present, the commit will be signed during the
WorkTree.Commit call.

The supplied SignKey must already be decrypted by the caller.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Remove use of strings.Builder

This was added in Go 1.10 and is not supported on Go 1.9. Switched to
bytes.Buffer to ensure compatibility.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Remove old hash validation code

This will not work for a signed commit as with the GPG signature being a
part of the commit, the hash is now non-deterministic.

Verification of the commit is done through the validation of the
signature.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add extra test for testing bad key error case

I'm hoping this helps get codecov to a tolerable delta. :)

Signed-off-by: Chris Marchesi <[email protected]>

* dotgit: fix object delete test

Signed-off-by: Santiago M. Mola <[email protected]>

* object: fix panic when reading object header

When the first line of the pgp signature is an empty line or some header
is malformed it crashes as there's no data for the header element. For
example, if author name is "\n".

Signed-off-by: Javi Fontan <[email protected]>

* Fixed an edge case for .gitignore

Fixes src-d#923

Signed-off-by: Fedor Korotkov <[email protected]>

* plumbing/idxfile: object iterators returns entries in offset order

In the latest change the order was changed from offset order in
packfiles to hash order. This makes reading all the objects not as
efficient as before. It also created problems when the previous order
was expected.

Also added EntriesByOffset to indexes.

Signed-off-by: Javi Fontan <[email protected]>

* git: Add tagging support

This adds a few methods:

* CreateTag, which can be used to create both lightweight and annotated
tags with a supplied TagObjectOptions struct. PGP signing is possible as
well.
* Tag, to fetch a single tag ref. As opposed to Tags or TagObjects, this
will also fetch the tag object if it exists and return it along with the
output. Lightweight tags just return the object as nil.
* DeleteTag, to delete a tag. This simply deletes the ref. The object is
left orphaned to be GCed later.

I'm not 100% sure if DeleteTag is the correct behavior - looking for
details on exactly *what* happens to a tag object if you delete the ref
and not the tag were sparse, and groking the Git source did not really
produce much insight to the untrained eye. This may be something that
comes up in review. If deletion of the object is necessary, the
in-memory storer may require some updates to allow DeleteLooseObject to
be supported.

Signed-off-by: Chris Marchesi <[email protected]>

* plumbing: object, correct tag PGP encoding

As with the update in ec3d2a8, tag encoding needed to be corrected to
ensure extra newlines were not being added in during tag object
encoding, so that it did not corrupt the object for verification.

Signed-off-by: Chris Marchesi <[email protected]>

* plumbing: object, don't add extra newline on PGP signature

Tag encoding/decoding seems to be a lot more sensitive to requiring the
exact expected format in the object, which generally includes messages
canonicalized so that they have a newline on the end (even if they
didn't before).

As such, the message should be written with the newline (no need for an
extra), and the PGP signature right after that, which will be newline
split already, so there's no need to split it again.

All of this means it's very important for the caller to send the message
in the correct format - which I'm correcting in the next commit.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Canonicalize incoming annotated tag messages

Tag messages are highly sensitive to being in the expected format,
especially when encoding/decoding for PGP verification.

As such, we do a simple trimming of whitespace on the incoming message
and add a newline on the end, to ensure there are no surprises here.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Replace test signing key with one with longer expiry

The old one was created with defaults, which would have caused CI
failures in 2 years.

The new one is valid for 10 years:

> gpg --list-secret-keys
/root/.gnupg/pubring.kbx
------------------------
sec   rsa4096 2018-08-22 [SC] [expires: 2028-08-19]
      93A17FF01E54328546087C8E029395402EFCCD53
uid           [ unknown] foo bar <[email protected]>

Signed-off-by: Chris Marchesi <[email protected]>

* plumbing, storage: add bases to the common cache

After clone only resolved deltas were added to the cache. This caused
slowdowns in small repositories where most objects can be held in cache.

It also makes packfiles reuse delta cache from the store. Previously it
created a new delta cache each time a packfile object was created. This
also slowed down a bit accessing objects and had an impact on memory
consumption when bases are added to the cache.

Signed-off-by: Javi Fontan <[email protected]>

* git: Discern tag target type from supplied hash

I figured there was a way to do this without having to have
TagObjectOptions supply this in - there is.

Added support for this in and removed the object type from
TagObjectOptions.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Don't return tag object with Tag, adjust docs for Tag and Tags

I've mainly noticed that in using the current Tag function, that there
were lots of times that I was ignoring the ref or the object, depending
on what I needed. This was evident in the tests as well. As such, I
think it just makes more sense for a singular tag fetcher to return just
a ref, through which the caller may grab the annotation if they need it,
and if it exists.

Also, contrary to the docs on Tags, all tags have a ref, even if they
are annotated. The difference between a lightweight tag and an annotated
tag is the presence of the tag object, which the ref will point to if
the tag is annotated. As such I've adjusted the docs with an example as
to how one can get the annotation for a tag ref through the iterator.

Source: https://git-scm.com/book/en/v2/Git-Internals-Git-References,
tags section.

Signed-off-by: Chris Marchesi <[email protected]>

* storage/dotgit: search for incoming dir only once

Search for incoming object directory was done once each time objects
were accessed. This means a ReadDir of the objects path that is
expensive. Now incoming directory is searched the first time an object
is accessed and its name kept in DotGit to be reused.

Signed-off-by: Javi Fontan <[email protected]>

* storage/dotgit: use HasPrefix instead of Split

Also reformatted function comment and fixed some typos.

Signed-off-by: Javi Fontan <[email protected]>

* Remove empty dirs when cleaning with Dir opt.

Signed-off-by: kuba-- <[email protected]>

* Add Status.IsUntracked function

Signed-off-by: kuba-- <[email protected]>

* plumbing: object: Clamp object timestamps before unix epoch to unix epoch

Signed-off-by: Taru Karttunen <[email protected]>

* config: add commentChar to core config struct

Signed-off-by: Zaq? Wiedmann <[email protected]>

* git: add Static option to PlainOpen

Also adds Static configuration to Storage and DotGit. This option means
that the git repository is not expected to be modified while open and
enables some optimizations.

Each time a file is accessed the storer tries to open an object file for
the requested hash. When this is done for a lot of objects it is
expensive. With Static option a list of object files is generated the
first time an object is accessed and used to check if exists instead of
using system calls.

A similar optimization is done for packfiles.

Signed-off-by: Javi Fontan <[email protected]>

* git, storer: use a common storer.Options for storer and PlainOpen

Signed-off-by: Javi Fontan <[email protected]>

* dotgit: fix typo in comment

Signed-off-by: Javi Fontan <[email protected]>

* git: do not expose storage options in PlainOpen

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/storer: rename Static option to ExclusiveAccess

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: make Storage options private

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: move Options to filesytem and dotgit

Signed-off-by: Javi Fontan <[email protected]>

* storage/dotgit: add ExclusiveAccess tests in dotgit

This functionality was already tested in storage/filesystem.
The coverage tool only takes into account files from the same
package of the test.

Signed-off-by: Javi Fontan <[email protected]>

* storage/dotgit: add KeepDescriptors option

This option maintains packfile file descriptors opened after reading
objects from them. It improves performance as it does not have to be
opening packfiles each time an object is needed.

Also adds Close to EncodedObjectStorer to close all the files manualy.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/storer: do not expose Close in EncodedObjectStorer interface

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: add KeepDescriptors test

Also delete Close from MockObjectStorage and memory storer.

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: compare files using offset in test

Using equals to compare files it uses diff to do so. This can
potentially consume lots of ram. Changed the comparison to use file
offsets. If the descriptor is reused the offset is maintained.

Signed-off-by: Javi Fontan <[email protected]>

* plumbing/transport: ssh check if list of known_hosts files is empty

Signed-off-by: kuba-- <[email protected]>

* Fix fatal corrupt patch in unified diff format

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* Expose Storage cache.

Signed-off-by: kuba-- <[email protected]>

* git: s/fetch/returns/ on Tag function doc

This is to avoid any ambiguity with the act of "fetching" in git in
general.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add Tag objects to the list of supported objects for walking

This is necessary to support pruning on Tag objects.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Don't touch tag objects orphaned by tag deletion

Deleting a tag ref for an annotated tag in normal git behavior does not
delete the tag object right away. This is handled by the normal GC
process.

Signed-off-by: Chris Marchesi <[email protected]>

* git: Add some tests for annotated tag deletion

Added a couple of tests for annotated tag deletion:

* The first one is a general test and should work regardless of the
fixture used - the tag object could possibly be packed, so we do a prune
*and* a repack operation before testing to see if the object was GCed
correctly.

* The second one actually creates the tag to be deleted, so that the tag
object gets created as a loose, unpacked object. This is so we can
effectively test that purning unpacked objects is now working 100%
correctly (this was failing before because tag objects were not
supported for walking).

Signed-off-by: Chris Marchesi <[email protected]>

* git: s/TagObjectOptions/CreateTagOptions/

Just renaming the TagObjectOptions type to CreateTagOptions so that it's
consistent with the other option types.

Signed-off-by: Chris Marchesi <[email protected]>

* repository: fix test for new Storage constructor

Signed-off-by: Máximo Cuadros <[email protected]>

* *: go modules support

Signed-off-by: Máximo Cuadros <[email protected]>

* travis: drop go1.9 add go1.11

* Fix potential LRU cache size issue.

Signed-off-by: kuba-- <[email protected]>

* Remove empty space to trigger windows build.

Signed-off-by: kuba-- <[email protected]>

* storage/filesystem: keep packs open in PackfileIter

PackfileIter was not taking into account the option KeepDescriptors
and was always closing the file. This caused "file already closed"
errors when iterating packfiles in with KeepDescriptors active.

Signed-off-by: Javi Fontan <[email protected]>

* storage/filesystem: add more doc to NewPackfileIter

Signed-off-by: Javi Fontan <[email protected]>

* all: remove extra 's' in "mismatch"

Signed-off-by: Jongmin Kim <[email protected]>

* test: improve test for urlencoded user:pass

Signed-off-by: Santiago M. Mola <[email protected]>

* use time.IsZero in Prune

Signed-off-by: u5surf <[email protected]>

* Add test for Windows local paths.

Signed-off-by: Filip Navara <[email protected]>

* git: Fix Status.IsClean() documentation

The documentation of the IsClean Method contained a negation, so it was
describing the opposite of its actual behavior.

Fixes src-d#838

Signed-off-by: David Url <[email protected]>

* Plumbing: object, Add support for Log with filenames. Fixes src-d#826 (src-d#979)

plumbing: object, Add support for Log with filenames. Fixes src-d#826

* object: get object size without reading whole object

Signed-off-by: Jeremy Stribling <[email protected]>

* tree: add a Size() method for getting plaintext size

Without reading the entire object into memory.

Signed-off-by: Jeremy Stribling <[email protected]>

* filesystem: add a new test for EncodedObjectSize

Suggested by taruti.

Signed-off-by: Jeremy Stribling <[email protected]>

* repository: allow open non-bare repositories as bare

Signed-off-by: Máximo Cuadros <[email protected]>

* use remote name in fetch while clone, test

Signed-off-by: Máximo Cuadros <[email protected]>

* references: sort: compare author timestamps when commit timestamps are equal, test

Signed-off-by: Máximo Cuadros <[email protected]>

* teach ResolveRevision how to look up annotated tags, test

Signed-off-by: Máximo Cuadros <[email protected]>

* teach ResolveRevision how to look up annotated tags, test

Signed-off-by: Máximo Cuadros <[email protected]>

* packfile: add comment on GetSizeByOffset

Suggested by mcuadros.

Issue: src-d#982
Signed-off-by: Jeremy Stribling <[email protected]>

* blame: fix edge case with missing \n in content length causing mismatched length error

Signed-off-by: Máximo Cuadros <[email protected]>

* repository: improve CheckoutOption.Hash doc

Signed-off-by: Máximo Cuadros <[email protected]>

* remote: use reference deltas on push when the remote server does not
support offset deltas

Signed-off-by: Benjamin Ash <[email protected]>

* Fixed a typo. (src-d#989)

README: Fixed a typo.

* Enables building on openbsd, dragonfly bsd and solaris

Signed-off-by: Yuce Tekol <[email protected]>

* plumbing/format/packfile: Fix broken "thin" packfile support. Fixes src-d#991

Signed-off-by: Javier Peletier <[email protected]>

* plumbing: ReferenceName constructors

Signed-off-by: Máximo Cuadros <[email protected]>

* examples  & documentation: PlainClone with Basic Authentication (Password & Access Token) (src-d#990)

examples: PlainClone with Basic Authentication (Password & Access Token)

* add StackOverflow to support channels

Since we are not redirecting users to StackOverflow for support
questions, it makes sense to add it to the official support channels.

Signed-off-by: Santiago M. Mola <[email protected]>

* plumbing: transport/http, Add missing host/port on redirect. Fixes src-d#820

Signed-off-by: Dave Henderson <[email protected]>

* Fix spelling and grammar in docs and example

Signed-off-by: Lukasz Kokot <[email protected]>

* update gcfg dependency to v1.4.0

Signed-off-by: Dave Henderson <[email protected]>

* repository: added cleanup for the PlainCloneContext()

Signed-off-by: Bartek Jaroszewski <[email protected]>

* improve cleanup implementation, add more tests

Signed-off-by: Santiago M. Mola <[email protected]>

* Update LICENSE

Signed-off-by: Máximo Cuadros <[email protected]>

* http: improve TokenAuth documentation

Users are often confused with TokenAuth, since it might look that it
should be used with GitHub's OAuth tokens. But that is not the case.

TokenAuth implements HTTP bearer authentication. Most git servers will
use HTTP basic authentication (user+passwords) even for OAuth tokens.

Signed-off-by: Santiago M. Mola <[email protected]>

* plumbing: ssh, Fix flaky test TestAdvertisedReferencesNotExists. Fixes src-d#969

Signed-off-by: Colton McCurdy <[email protected]>

* repository: Fix RefSpec for a single tag. Fixes src-d#960

Signed-off-by: Fedor Korotkov <[email protected]>

* storage/filesystem: Added reindex method to  reindex packfiles

Signed-off-by: Javier Peletier <[email protected]>

* plumbing/format/packfile: Added thin pack test

Signed-off-by: Javier Peletier <[email protected]>

* Remove unused method (src-d#1022)

Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>

* plumbing: format/index: support for EOIE extension, by default on git v2.2.0

Signed-off-by: Máximo Cuadros <[email protected]>

* repository: fix plain clone error handling regression

PR src-d#1008 introduced a regression by changing the errors returned by
PlainClone when a repository did not exist.

This change goes back to returned errors as they were in v4.7.0.

Fixes src-d#1027

Signed-off-by: Santiago M. Mola <[email protected]>

* plumbing: format/packfile, performance optimizations for reading large commit histories (src-d#963)

Signed-off-by: Filip Navara <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants