In go project, there is a builtin command name "go get"
which will trigger "git clone" or "git pull".

https://github.com/golang/go/blob/master/src/cmd/go/vcs.go#L125

createCmd: []string{"clone {repo} {dir}", "--git-dir={dir}/.git submodule 
update --init --recursive"},
downloadCmd: []string{"pull --ff-only", "submodule update --init 
--recursive"},

It's unwise to clone the whole repository just for Go projects compile with 
source code on master.
Therefor I raise a proposal for --depth args 
cmd/go: use shallow clones for new git checkouts 
<https://github.com/golang/go/issues/13078>
but, Russ (go project maintainer) says @
https://go-review.googlesource.com/#/c/16360/

Does this *reshorten* the history after the pull? I can see this might 
> really frustrate people who checked out into $GOPATH themselves with full 
> history and then just ran 'go get -u' to update it and got a truncated 
> history. Maybe the --depth=1 should only be on clone?

Another possible problem with this CL is that 'go get' expects to be able 
> to look at the tags in the repo and possibly select a different version of 
> the code. It's not clear to me that 'go get' has all the information it 
> needs if only a shallow clone is done. 
>

I'm wondering about is there a proper way for golang project to min 
download size ?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to