arl / tmux-gitbar

Git in your tmux status bar
GNU General Public License v3.0
170 stars 16 forks source link

Bug when reading a newly created repo #54

Closed willianpaixao closed 6 years ago

willianpaixao commented 6 years ago

I noticed that if you enter a folder and hit git init, gitbar seems to have no code handle for having the git folder but no commits. Here follow my log:


/home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: on: integer expression expected        
/home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: master: integer expression expected    
/home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: _NO_REMOTE_TRACKING_: integer expression expected                                                                                            
/home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: ^: integer expression expected

Am I right? I could fix this issue if necessary. Just wanted to confirm with you guys before.

arl commented 6 years ago

Hi Willian, You are very welcome to contribute with a PR for this issue. If you do so, please add tests checking the feature. Depending on the case, a unit and/or an integration test case might suit better.

You should not need to install anything locally to run the tests, Travis-ci will do all for you on code push, as it's especially uneasy to run integration tests locally with TCL/expect, etc.

Thanks a lot Cheers

On Thu, 5 Apr 2018, 14:19 Willian Paixao, notifications@github.com wrote:

I noticed that if you enter a folder and hit git init, gitbar seems to have no code handle for having the git folder but no commits. Here follow my log:

/home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: on: integer expression expected /home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: master: integer expression expected /home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: _NO_REMOTETRACKING: integer expression expected /home/willian/.tmux-gitbar/lib/tmux-gitbar.sh: line 128: test: ^: integer expression expected

Am I right? I could fix this issue if necessary. Just wanted to confirm with you guys before.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aurelien-rainone/tmux-gitbar/issues/54, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdF6nvt25Uoxyx4QB_wY8FmWqKguWe4ks5tlguwgaJpZM4TIWcI .

willianpaixao commented 6 years ago

Ok, I get back to you soon.

arl commented 6 years ago

FYI this is basically the same issue than #52. I'll close the other issue and keep the one you opened.

On Thu, 5 Apr 2018, 15:49 Willian Paixao, notifications@github.com wrote:

Ok, I get back to you soon.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aurelien-rainone/tmux-gitbar/issues/54#issuecomment-378942532, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdF6ouekQcx3Vp3IrmY3UZqagb0p7qtks5tliDqgaJpZM4TIWcI .

savorywatt commented 6 years ago

This error is also happening on a fresh install of Ubuntu LTS 18.04 with the versions listed below.

tmux 2.6 bash 4.4.19

It appears to happen on every command to the shell as well, regardless of if I am in a directory with git related information or not. I eyeballed the tmux-gitbar.sh and it is something in that 128 if block that is freaking out. Bash is not my strong suite so I could not debug further.

ls
cd

all cause it.

arl commented 6 years ago

Ok thanks for reporting

On Fri, 11 May 2018, 04:23 savorywatt, notifications@github.com wrote:

This error is also happening on a fresh install of Ubuntu LTS 18.04 with the versions listed below.

tmux 2.6 bash 4.4.19

It appears to happen on every command to the shell as well, regardless of if I am in a directory with git related information or not. I eyeballed the tmux-gitbar.sh and it is something in that 128 if block that is freaking out. Bash is not my strong suite so I could not debug further.

ls

cd

all cause it.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/aurelien-rainone/tmux-gitbar/issues/54#issuecomment-388240452, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdF6le99tuCyXUsTcKZ3ynYG3GNiVP9ks5txPYPgaJpZM4TIWcI .

ghost commented 6 years ago

I can confirm what @savorywatt said. I'm seeing the same thing under the same setup.

arl commented 6 years ago

Ok. I believe this could be caused by tmux V2.6. not sure though. Can anybody having that issue check if it is different with tmux 2.5 or lower?

On Sat, 26 May 2018, 19:24 Matthew Dumler, notifications@github.com wrote:

I can confirm what @savorywatt https://github.com/savorywatt said. I'm seeing the same thing under the same setup.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/aurelien-rainone/tmux-gitbar/issues/54#issuecomment-392275655, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdF6klL9h9aJ2NduD7hr1qyxgbU2ddSks5t2Y-3gaJpZM4TIWcI .

arl commented 6 years ago

I just tried out with tmux tip (2.7) and I can't reproduce this behavior. I see something strange still, tmux git bar still shows git information of the previously entered git directory, it shouldn't. I'm not sure it might be related though. Anyway I'm going to investigate the issue you reported.