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

Release v0.3.2 #186

Merged
merged 12 commits into from
Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Gopkg.lock -diff
/vendor/** -diff
99 changes: 98 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# version = "2.4.0"


required = ["github.com/golang/dep/cmd/dep"]

[[constraint]]
name = "gopkg.in/src-d/go-git.v4"
version = "=v4.0.0-rc15"
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ precompile:
rm $(BIN_DIR)/$(NAME)

install-dep:
curl -L -o bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64
chmod +x bin/dep
echo 'Installed dep v0.3.2 to bin/dep'
[ -x bin/dep ] || go build -o bin/dep github.com/golang/dep/cmd/dep

dep-ensure: install-dep
bin/dep ensure -v

test:
make
Expand All @@ -45,4 +46,4 @@ update-doc: all
go run _scripts/update-readme.go README.md
go run _scripts/update-cmdref.go CMDREF.md

.PHONY: all precompile install-dep test release update-doc
.PHONY: all precompile install-dep dep-ensure test release update-doc
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ strategy = "symlink"
# * true (default): "volt get" creates skeleton plugconf file at "$VOLTPATH/plugconf/<repos>.vim"
# * false: It does not creates skeleton plugconf file
create_skeleton_plugconf = true

# * true (default): When "volt get" or "volt get -u" fail and "git" command is
# installed, it tries to execute "git clone" or "git pull" as a fallback
# * false: "volt get" or "volt get -u" won't try to execute fallback commands
fallback_git_cmd = true
```

## Self upgrade
Expand Down
14 changes: 7 additions & 7 deletions cmd/builder/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,14 @@ func (builder *copyBuilder) copyReposList(buildReposMap map[pathutil.ReposPath]*
func (builder *copyBuilder) copyReposGit(repos *lockjson.Repos, buildRepos *buildinfo.Repos, vimExePath string, done chan actionReposResult) (int, error) {
src := pathutil.FullReposPath(repos.Path)

// Open ~/volt/repos/{repos}
r, err := git.PlainOpen(src)
if err != nil {
return 0, errors.New("failed to open repository: " + err.Error())
}

// Show warning when HEAD and locked revision are different
head, err := gitutil.GetHEAD(repos.Path)
head, err := gitutil.GetHEADRepository(r)
if err != nil {
return 0, fmt.Errorf("failed to get HEAD revision of %q: %s", src, err.Error())
}
Expand All @@ -160,12 +166,6 @@ func (builder *copyBuilder) copyReposGit(repos *lockjson.Repos, buildRepos *buil
logger.Warn(" Please run 'volt get -l' to update locked revision.")
}

// Open ~/volt/repos/{repos}
r, err := git.PlainOpen(src)
if err != nil {
return 0, errors.New("failed to open repository: " + err.Error())
}

cfg, err := r.Config()
if err != nil {
return 0, errors.New("failed to get repository config: " + err.Error())
Expand Down
20 changes: 11 additions & 9 deletions cmd/builder/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,17 @@ func (builder *symlinkBuilder) installRepos(repos *lockjson.Repos, vimExePath st

copied := false
if repos.Type == lockjson.ReposGitType {
// Open a repository to determine it is bare repository or not
r, err := git.PlainOpen(src)
if err != nil {
done <- actionReposResult{
err: fmt.Errorf("repository %q: %s", src, err.Error()),
}
return
}

// Show warning when HEAD and locked revision are different
head, err := gitutil.GetHEAD(repos.Path)
head, err := gitutil.GetHEADRepository(r)
if err != nil {
done <- actionReposResult{
err: fmt.Errorf("failed to get HEAD revision of %q: %s", src, err.Error()),
Expand All @@ -122,14 +131,6 @@ func (builder *symlinkBuilder) installRepos(repos *lockjson.Repos, vimExePath st
logger.Warn(" Please run 'volt get -l' to update locked revision.")
}

// Open a repository to determine it is bare repository or not
r, err := git.PlainOpen(src)
if err != nil {
done <- actionReposResult{
err: fmt.Errorf("repository %q: %s", src, err.Error()),
}
return
}
cfg, err := r.Config()
if err != nil {
done <- actionReposResult{
Expand All @@ -150,6 +151,7 @@ func (builder *symlinkBuilder) installRepos(repos *lockjson.Repos, vimExePath st
copied = true
}
}

if !copied {
// Make symlinks under vim dir
if err := builder.symlink(src, dst); err != nil {
Expand Down
Loading