From a07ce59fac14211009b7e4c8bdeb32be939476ce Mon Sep 17 00:00:00 2001 From: "jakub.coufal" Date: Mon, 16 Jul 2018 10:51:21 +0200 Subject: [PATCH] Improve memory footprint for large git index --- Gopkg.lock | 76 +++++++++++++++++++++++----------------------- Gopkg.toml | 6 +--- pkg/fetch/fetch.go | 1 + 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 6ce3322..eee096b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -31,8 +31,8 @@ ".", "log" ] - revision = "92cd0815dd1a028a6e69faee9757c7436238e252" - version = "v2.6.1" + revision = "3eb9738c1697594ea6e71a7156a9bb32ed216cf0" + version = "v2.8.0" [[projects]] name = "github.com/emirpasic/gods" @@ -54,28 +54,28 @@ version = "v1.0.0" [[projects]] - branch = "master" name = "github.com/go-openapi/jsonpointer" packages = ["."] revision = "3a0015ad55fa9873f41605d3e8f28cd279c32ab2" + version = "0.15.0" [[projects]] - branch = "master" name = "github.com/go-openapi/jsonreference" packages = ["."] revision = "3fb327e6747da3043567ee86abd02bb6376b6be2" + version = "0.15.0" [[projects]] - branch = "master" name = "github.com/go-openapi/spec" packages = ["."] - revision = "bcff419492eeeb01f76e77d2ebc714dc97b607f5" + revision = "bce47c9386f9ecd6b86f450478a80103c3fe1402" + version = "0.15.0" [[projects]] - branch = "master" name = "github.com/go-openapi/swag" packages = ["."] - revision = "811b1089cde9dad18d4d0c2d09fbdbf28dbd27a5" + revision = "2b0bd4f193d011c203529df626a65d63cb8a79e8" + version = "0.15.0" [[projects]] name = "github.com/gogo/protobuf" @@ -83,8 +83,8 @@ "proto", "sortkeys" ] - revision = "1adfc126b41513cc696b209667c8656ea7aac67c" - version = "v1.0.0" + revision = "7d68e886eac4f7e34d0d82241a6273d6c304c5cf" + version = "v1.1.0" [[projects]] branch = "master" @@ -101,8 +101,8 @@ "ptypes/duration", "ptypes/timestamp" ] - revision = "925541529c1fa6821df4e44ce2723319eb2be768" - version = "v1.0.0" + revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" + version = "v1.1.0" [[projects]] branch = "master" @@ -123,8 +123,8 @@ "compiler", "extensions" ] - revision = "ee43cbb60db7bd22502942cccbc39059117352ab" - version = "v0.1.0" + revision = "7c663266750e7d82587642f65e60bc4083f1f84e" + version = "v0.2.0" [[projects]] branch = "master" @@ -144,8 +144,8 @@ [[projects]] name = "github.com/imdario/mergo" packages = ["."] - revision = "9d5f1277e9a8ed20c3684bda8fde67c05628518c" - version = "v0.3.4" + revision = "9316a62528ac99aaecb4e47eadd6dc8aa6533d58" + version = "v0.3.5" [[projects]] name = "github.com/inconshreveable/mousetrap" @@ -162,8 +162,8 @@ [[projects]] name = "github.com/json-iterator/go" packages = ["."] - revision = "ca39e5af3ece67bbcda3d0f4f56a8e24d9f2dad4" - version = "1.1.3" + revision = "ab8a2e0c74be9d3be70b3184d9acc634935ded82" + version = "1.1.4" [[projects]] name = "github.com/juju/ratelimit" @@ -185,13 +185,13 @@ "jlexer", "jwriter" ] - revision = "8b799c424f57fa123fc63a99d6383bc6e4c02578" + revision = "3fdea8d05856a0c8df22ed4bc71b3219245e4485" [[projects]] branch = "master" name = "github.com/mitchellh/go-homedir" packages = ["."] - revision = "b8bc1bf767474819792c23f32d8286a45736f1c6" + revision = "3864e76763d94a6df2f9960b16a20a33da9f9a66" [[projects]] name = "github.com/modern-go/concurrent" @@ -202,8 +202,8 @@ [[projects]] name = "github.com/modern-go/reflect2" packages = ["."] - revision = "1df9eeb2bb81f327b96228865c5687bc2194af3f" - version = "1.0.0" + revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" + version = "1.0.1" [[projects]] name = "github.com/pelletier/go-buffruneio" @@ -247,8 +247,8 @@ ".", "doc" ] - revision = "a1f051bc3eba734da4772d60e2d677f47cf93ef4" - version = "v0.0.2" + revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385" + version = "v0.0.3" [[projects]] name = "github.com/spf13/pflag" @@ -268,10 +268,10 @@ version = "v1.3.0" [[projects]] - branch = "master" name = "github.com/xanzy/ssh-agent" packages = ["."] - revision = "ba9c9e33906f58169366275e3450db66139a31a9" + revision = "640f0ab560aeb89d523bb6ac322b1244d5c3796c" + version = "v0.2.0" [[projects]] branch = "master" @@ -282,6 +282,7 @@ "ed25519", "ed25519/internal/edwards25519", "internal/chacha20", + "internal/subtle", "openpgp", "openpgp/armor", "openpgp/elgamal", @@ -294,7 +295,7 @@ "ssh/knownhosts", "ssh/terminal" ] - revision = "e73bf333ef8920dbb52ad18d4bd38ad9d9bc76d7" + revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602" [[projects]] branch = "master" @@ -304,10 +305,9 @@ "http/httpguts", "http2", "http2/hpack", - "idna", - "lex/httplex" + "idna" ] - revision = "5f9ae10d9af5b1c89ae6904293b14b064d4ada23" + revision = "d0887baf81f4598189d4e12a37c6da86f0bba4d0" [[projects]] branch = "master" @@ -316,7 +316,7 @@ "unix", "windows" ] - revision = "79b0c6888797020a994db17c8510466c72fe75d9" + revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4" [[projects]] name = "golang.org/x/text" @@ -355,8 +355,8 @@ "osfs", "util" ] - revision = "df053870ae7070b0350624ba5a22161ba3796cc0" - version = "v4.1.1" + revision = "83cf655d40b15b427014d7875d10850f96edba14" + version = "v4.2.0" [[projects]] name = "gopkg.in/src-d/go-git.v4" @@ -391,7 +391,7 @@ "plumbing/transport/ssh", "storage", "storage/filesystem", - "storage/filesystem/internal/dotgit", + "storage/filesystem/dotgit", "storage/memory", "utils/binary", "utils/diff", @@ -402,8 +402,8 @@ "utils/merkletrie/internal/frame", "utils/merkletrie/noder" ] - revision = "b30763cb64afa91c016b23e905af0a378eb1b76d" - version = "v4.3.1" + revision = "3bd5e82b2512d85becae9677fa06b5a973fd4cfb" + version = "v4.5.0" [[projects]] name = "gopkg.in/warnings.v0" @@ -588,11 +588,11 @@ "pkg/common", "pkg/util/proto" ] - revision = "1e45fb05b06309c0d807d0930e1a81fe0a1cd4b8" + revision = "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "8d62002ccf4dad7deb18c6519fec8befe50a4362463dd4583d6fce79d10a4d58" + inputs-digest = "10e440025c8600f5c0e6952033d862fe15482eee9aedbd94a458a79b4218548c" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 290a920..a1088e2 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -14,14 +14,10 @@ name = "k8s.io/api" version = "kubernetes-1.9.1" -[[constraint]] - name = "github.com/go-resty/resty" - version = "1.3.0" - [[constraint]] name = "github.com/spf13/cobra" version = "0.0.2" [[constraint]] name = "gopkg.in/src-d/go-git.v4" - version = "v4.3.1" + version = "v4.5.0" diff --git a/pkg/fetch/fetch.go b/pkg/fetch/fetch.go index 83d8244..be63a39 100644 --- a/pkg/fetch/fetch.go +++ b/pkg/fetch/fetch.go @@ -49,6 +49,7 @@ func (f *fetcher) Fetch() (*object.Commit, error) { r, err = git.PlainClone(f.directory, false, &git.CloneOptions{ URL: f.url, Auth: f.auth, + NoCheckout: true, ReferenceName: plumbing.ReferenceName(fmt.Sprintf("refs/heads/%s", f.branch)), }) if err != nil {