gowatch icon indicating copy to clipboard operation
gowatch copied to clipboard

Multiple build problem on git branches

Open kabessao opened this issue 3 years ago • 7 comments

The project I'm working on has many branches that at some point are going to be merged to master, and whenever I switch branches with the application running it starts building for each modified file.

Ex.: if I change to a branch that has 100 files different from master, the application will build 100 times.

It would be nice if the application could wait, like, 1 second for files to change to build.

kabessao avatar Oct 13 '21 19:10 kabessao

Thanks for the feedback,I will confirm this issue later.

silenceper avatar Oct 14 '21 02:10 silenceper

@kabessao Are you using the latest version?

A one-second delay has been processed in the project,Is it that the delay is not enough.

https://github.com/silenceper/gowatch/blob/f7b7964cc6d5b41313282c5bb3feb4c452e7334c/gowatch.go#L58-L66

https://github.com/silenceper/gowatch/blob/f7b7964cc6d5b41313282c5bb3feb4c452e7334c/gowatch.go#L110-L118

silenceper avatar Oct 15 '21 13:10 silenceper

I belive I am, I'm using this command to install gowatch:

go get github.com/silenceper/gowatch

and inside the docker it says 1.5 on gowatch -v

and just stashing files and applying the stash later on the repo makes it build multiple times. There were 5 go files and it built 5 times one after the other.

here is a print of the log (had to redact some parts to prevent me getting into problems) : image

kabessao avatar Oct 15 '21 17:10 kabessao

I've just cross checked the lines that the log shows with your code on master and indeed it does not match, and checking the code inside the docker image confirms it.

That means this command is not getting the latest version:

go get github.com/silenceper/gowatch

kabessao avatar Oct 15 '21 18:10 kabessao

try this:

go get -u github.com/silenceper/gowatch

silenceper avatar Oct 18 '21 02:10 silenceper

Same result, it gave me the older version.

I don't know if this helps since I'm new to golang, but this is the docker image we're using golang:1.16-alphine3.13

kabessao avatar Oct 18 '21 14:10 kabessao

Maybe you can also try to download https://github.com/silenceper/gowatch/releases/tag/v1.5.1 from here, and install the binary files directly

silenceper avatar Oct 19 '21 02:10 silenceper