Skip to content

Instantly share code, notes, and snippets.

@roscopecoltran
roscopecoltran / wayback.go
Created November 16, 2018 00:15 — forked from davidwalter0/wayback.go
x/vgo: thoughts on selection criteria for non-versioned go repo
// https://gist.github.com/davidwalter0/60f41b53732656c5c546cc8b0a739d11
// x/vgo: thoughts on selection criteria for non-versioned go repo
// Run git branch version selection for non-vgo versioned repository
// as if in a wayback machine.
// Use the dependency's commit ctime as the wayback ctime.
// Commits prior to the wayback ctime in sub-dependencies are eligible.
// Use the newest commit prior to the wayback ctime.
@roscopecoltran
roscopecoltran / walk_go-git_inmemory_worktree.go
Created November 16, 2018 00:16 — forked from athurg/walk_go-git_inmemory_worktree.go
遍历go-git内存文件系统的工作区
package main
import (
"fmt"
"io/ioutil"
"os"
"gopkg.in/src-d/go-billy.v3"
"gopkg.in/src-d/go-billy.v3/memfs"
"gopkg.in/src-d/go-git.v4"
@roscopecoltran
roscopecoltran / main.go
Created November 16, 2018 00:17 — forked from rms1000watt/main.go
Clone Git Repo in Pure Go
import (
"errors"
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws/session"
package main
import (
"fmt"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/utils/ioutil"
)
func main() {
@roscopecoltran
roscopecoltran / detect_dirty_worktree.go
Created November 16, 2018 00:18 — forked from tyru/detect_dirty_worktree.go
Try to detect worktree (currently not working)
package main
import (
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"strings"
@roscopecoltran
roscopecoltran / main.go
Created November 16, 2018 00:18 — forked from arehmandev/main.go
Doing a git clone of a tag in Go - the easy way
package main
import (
"log"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4"
)
@roscopecoltran
roscopecoltran / hercules.go
Created November 16, 2018 00:18 — forked from vmarkovtsev/hercules.go
Imports from internal packages
package hercules
import (
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/hercules.v4/internal/core"
"gopkg.in/src-d/hercules.v4/internal/plumbing"
"gopkg.in/src-d/hercules.v4/internal/plumbing/identity"
"gopkg.in/src-d/hercules.v4/internal/plumbing/uast"
"gopkg.in/src-d/hercules.v4/internal/yaml"
@roscopecoltran
roscopecoltran / hercules.go
Created November 16, 2018 00:18 — forked from vmarkovtsev/hercules.go
Imports from internal packages
package hercules
import (
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/hercules.v4/internal/core"
"gopkg.in/src-d/hercules.v4/internal/plumbing"
"gopkg.in/src-d/hercules.v4/internal/plumbing/identity"
"gopkg.in/src-d/hercules.v4/internal/plumbing/uast"
"gopkg.in/src-d/hercules.v4/internal/yaml"
@roscopecoltran
roscopecoltran / benchmark.go
Created November 16, 2018 00:19 — forked from jfontan/benchmark.go
Benchmark go-git. Time and memory to clone and push
package main
import (
"fmt"
"os"
"runtime"
"time"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/config"
@roscopecoltran
roscopecoltran / clone_test.go
Created November 16, 2018 00:19 — forked from kimh/clone_test.go
Demonstrate go-git race
package clone
import (
"os"
"golang.org/x/crypto/ssh"
"gopkg.in/src-d/go-git.v4"
gitssh "gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
"io/ioutil"
"testing"