getlantern / gost

gost is like a vendoring `go get` that uses Git subtrees
Apache License 2.0
31 stars 9 forks source link

Gost adds untracked repos to the code tree without a warning. #2

Closed xiam closed 8 years ago

xiam commented 9 years ago

I had untracked files in my working directory:

git status
On branch gost-test
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    src/bitbucket.org/
    src/code.google.com/p/freetype-go/
    src/github.com/getlantern/enproxy/log.txt
    src/github.com/getlantern/flashlight/client/publicip.go
    src/github.com/getlantern/flashlight/log.txt
    src/github.com/getlantern/go-update/
    src/github.com/golang/
    src/github.com/kr/
    src/github.com/msgehard/
    src/github.com/stretchr/objx/
    src/golang.org/

nothing added to commit but untracked files present (use "git add" to track)

At one point, I wanted to add a package to the current tree using gost.

gost get github.com/getlantern/autoupdate master 

It did work but it also added my untracked stuff (probably nothing useful) to the repo.

git status
On branch gost-test
nothing to commit, working directory clean

The difference between the last commit and one before that one is a lot of files (the contents of all the untracked directories).

git diff 6fbaa3...1a45a1 --name-only | wc -l
1505

The problem is it does not say anything about adding untracked files, and they are certainly not dependencies of the package I wanted to add.

oxtoacart commented 9 years ago

Yikes, not fun. Thanks for catching that!

oxtoacart commented 8 years ago

Fixed by checking for dirty working tree/untracked files.