-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
Solves #38 |
Isnt ready just quite yet have found an overwrite bug... bare with me. |
Right should be okay now if travis doesn't complain. |
I'm not against having another way to install tmux-gitbar, with |
Okay so I'll update the README to explain both methods then. While I would prefer the tmux only method it is a tad to hacky for me and if you are happy to have both then I will add to the readme and additional tests. It also looks like the tests may be failing due to hardcoded path assumptions in the travis tests? If you hold of on merging this PR, I'll add the readme and extra tests required (if any). |
# Load the config file | ||
load_config() { | ||
source "${SCRIPT_DIR}/../tmux-gitbar.conf" | ||
source "${TMUX_GITBAR_CONF}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems the no_extra_output.tcl
integration test fails because the config file is not found, and the string /home/travis/.tmux-gitbar.conf: No such file or directory\r\
,amongst others, are produced when $PROMPT_COMMAND is invoked.
Yeah looks like it is due to an issue in the tmux-gitbar.tmux |
Yes, it would be nice to multiplex the integration tests in such a way that the whole suite is tested against both methods (the bashrc and the tmux method) |
About my last comment, I mean, I don't ask you to code that in this PR. You or me may develop that in a further PR. The only thing i ask, before merging is that the current test suite should pass on travis. |
Yeah that is fair enough, I'll get the current tests and the README done on this one. |
if-shell 'test True' \ | ||
"if-shell 'test -z \"${TMUX_GITBAR_DIR}\"' \ | ||
'TMUX_GITBAR_CONF=\"$HOME/.tmux-gitbar.conf\"' \ | ||
'TMUX_GITBAR_CONF=\"$TMUX_GITBAR_CONF\"'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pseudo code i have in mind for tmux-gitbar.tmux
too bad it involves a new level of nesting... :
""" 1st step: generate configuration """
if "$tmgb_conf" env var is set:
if "$tmgb_conf" file not exist:
if "$tmgb_dir" envvar is set:
"$tmgb_dir/lib/generate_config.sh" $(tmgb_conf)
else:
"$home/.tmgb/lib/generate_config.sh" $(tmgb_conf)
else:
if "$tmgb_dir" envvar is set:
"$tmgb_dir/lib/generate_config.sh" ~/.tmgb.conf
else:
"$home/.tmgb/lib/generate_config.sh" ~/.tmgb.conf
""" 2nd step: install prompt_command
(THIS SHOULDNT BE DIFFERENT THAN CURRENT VERSION"""
if update-gitbar not in $prompt_cmd:
if "$tmgb_dir" is set:
"$prompt_cmd" += "$tmgb_dir/update-gitbar"
else:
"$prompt_cmd" += "~/.tmgb/update-gitbar"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it may have to end up looking like that as the tests still seem to be failing. Its running fine on my local machine which is odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, you mean the tmux method works on your machine? Even after having killed the tmux server in order to clear the tmux env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to have more time tonight, but if that's only a question of tests not passing while all is working locally, i'm gonna fix the tests myself after pulling your branch. When travis will be happy i'm gonna merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just tried it again to double check. Deleted the conf restarted tmux and it's happy.
Ok great I'll have a look at the tests then, tonight or tomorrow when they Le 17 nov. 2016 23:39, "Alex Kornitzer" notifications@github.com a écrit :
|
That seems reasonable, it is working locally but hopefully that isn't due to my distro. If you wouldn't mind investigating my branch that would be great. No worries, really like the project it is very cool. |
Ok, after having played a bit with your branch, i found 2 things:
Checking if $TMUX does the trick: if [ -n "$TMUX" ] && [ -f "${HOME}/.tmux-gitbar/tmux-gitbar.sh" ]; then
source-file "$HOME/.tmux-gitbar/tmux-gitbar.tmux"
fi
There is a naming problem with the env vars in Anyway, here is the diff. I didn't have the time to create another branch and to PR your PR 🙄 😆 so don't know what travis will say about that, but on my machine it works. I'll let you update your PR |
Ah awesome, thanks for doing that. I swear I had tmux-gitbar.tmux looking like that at one stage and it just wasn't working, clearly I had been staring at the computer too long. As it is looking super elegant and not hacky, I have removed the bash version as that is just additional stuff that would have to be maintained :) Apologies for not getting it right first time. Not sure about the failing left right test, I have tried those manually and they are fine but again that isn't saying much with my previous attempts 🙄 |
The new default location for the conf file is ~. This can be changed using an envar if required. The README has also been updated to relfect the changes.
Ok, by looking at the new failed Travis tests, we see that the Yeah the run-shell, if-shell commands... it can get really hairy. Do not If you feel to remove the bashrc version, up to you. I would not have used So the important point to be added to the README is that, now, tmgb.conf is Le 18 nov. 2016 08:08, "Alex Kornitzer" notifications@github.com a écrit :
|
With the new and clean tmux one I was not going to use the bash one either :P I updated the README with how to change the default location. |
Hi, |
Done :) |
fingers crossed ;-) |
Success 👍 |
we like our friend travis when he's green! |
Right so the bash version took me about 4 seconds to knock out but the tmux version took ages (I still dont get it!).
So the tmux version will work the same way as before, there are now to variables that can be set:
The bash version is in scripts and can just be used by putting
in .bashrc
Feel free to remove the bash version, but I just feel that this is much cleaner and as this project is bash dependent I would suggest this may be the better way to go!
I haven't updated the docs yet incase any of this implementation changes during the PR.
Hopefully travis is ready to run the tests.