Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Initial rc support #40

Merged
merged 3 commits into from
Nov 23, 2016
Merged

Initial rc support #40

merged 3 commits into from
Nov 23, 2016

Conversation

alexkornitzer
Copy link
Contributor

This is basically a clone of functionality available in bash-git-prompt.
ATM it only supports the ability to ignore repos in the same way as the
aforementioned project.

The above kind of covers it, haven't updated the README incase you reject the changes or wish to change aspects of this. Have only ported the ignore feature as I use it. It currently supports TMUX_GITBAR_IGNORE and stores it in .tmux-gitbar-rc

@arl
Copy link
Owner

arl commented Nov 23, 2016

Hi Alex, I'm not against the idea, but why add a new configuration file? while we could add a new option to the current one (option that would default to disabled).

@alexkornitzer
Copy link
Contributor Author

This file is more of a per repo configuration file, i.e. disable tmux-gitbar for certain repos.

@arl
Copy link
Owner

arl commented Nov 23, 2016

It makes sense. I'm ok with that, but i would prefer to have it called .tmgb-ignore. Can you update the PR please?

@alexkornitzer
Copy link
Contributor Author

Yep I can so that, but that change only makes sense if there are no future plans to support other repo specific stuff like: GIT_PROMPT_FETCH_REMOTE_STATUS=0, and GIT_PROMPT_SHOW_UNTRACKED_FILES=no (taken from bash-git-prompt).

So I could name as above and then just check that the file exists and ignore its contents or I could name the file something like .tmgb-rc or .tmgb-local.conf and check for the IGNORE variable in the file?

@arl
Copy link
Owner

arl commented Nov 23, 2016

If one wants to ignore a repo, one won't need other conf options for this repo, so i guess checking for the existence of .tmgb-ignore in the repo would make the trick.
If and when we will support repo-specific options, the configuration file shall have a different name, like .tmgbconf for example.

@arl
Copy link
Owner

arl commented Nov 23, 2016

Maybe .tmgbignore is better? so the repo-specific file could be .tmgbconfig and this woudl be kind of symmetric with git!

@alexkornitzer
Copy link
Contributor Author

Could go straight with .tmgbconfig as if we are mirroring git style then you put the files you want to ignore in the .gitignore which would conflict the the style proposed above.

Also is tmgb meant to update when changing pane, as it does not do that for me!
And is it possible to be more precise with the tmgb placement?

@arl
Copy link
Owner

arl commented Nov 23, 2016

Checking the existence of a file is straightforward, overall if one wants to have its repo ignored. Don't forget udpate-gitbar is run every time the user presses enter, so the less useless work it does, the best. Checking the existence of .tmgbignore is better for me than checking the existence of a file + actually reading it and looking for a specific value. I would stick with .tmgbignore

Prior to tmux 2.3, there was no way to know if the user switches pane, so the git bar updates to the repository corresponding to the current pane only after having pressed enter. I opened an issue about that: taking advantage of tmux 2.3 hook feature in order to update immediately when switching panes. At this point it's a bit of a major update because there won't be no more the need to install a $PROMPT_COMMAND.

About tmgb placement, there is only left or right for now. I feel like the status bar would be look bloated if we were mixing other information along with it, but that's just personal taste. But you can place tmux keywords inside the tmux status string

@alexkornitzer
Copy link
Contributor Author

.tmgbignore approach done.

Ah right so that would require two implementations and a check for tmux version then, I assume?

Yeah, I can't think of an easy way to do it but I use tmuxline.vim and would ideally like it on the right but not as the rightmost element. Not a major problem though.

Individual repos can now be ignored by placing the file .tmgbignore
within the intended repo.
@arl
Copy link
Owner

arl commented Nov 23, 2016

Yes indeed.

@arl
Copy link
Owner

arl commented Nov 23, 2016

Before merging, I'd like to add about the new feature in the README, and add some basic tests. If you can do either of both, or both, that would be great. :D If not, I'll do it but I don't know when since i'm a bit overloaded currently.
Thanks a lot Alex

@alexkornitzer
Copy link
Contributor Author

Yeah I should be able to do that. Where do you want the feature in the README? and I assume I can append the tests into an already existing file?

@arl arl merged commit a92fb70 into arl:master Nov 23, 2016
@arl
Copy link
Owner

arl commented Nov 23, 2016

That's just perfect! Good job!
Thanks a lot

@alexkornitzer
Copy link
Contributor Author

No worries, had to make up for my botched last PR :)

@arl
Copy link
Owner

arl commented Nov 23, 2016

Ha ha... I've seen way worse ;-)

Le 23 nov. 2016 22:51, "Alex Kornitzer" notifications@github.com a écrit :

No worries, had to make up for my botched last PR :)


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#40 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdF6qlb06SMZKCtOo6McZUaKR42eDszks5rBLVLgaJpZM4K6wvs
.

@rbuckley
Copy link

What does the ignore actually do? I've put it in a large repo because it was causing me issues (taking several seconds to print the prompt because update_gitbar was running).

When I put .tmgbignore in the directory, the status on my tmux bar goes away, but I still see update_gitbar taking several seconds before the prompt is printed.

Thanks.

@arl
Copy link
Owner

arl commented Jun 20, 2018 via email

@rbuckley
Copy link

Hi, thanks for the quick response.

It is a large Android repo, about 28GB.

time outputs:
With tmux gitbar
real 0m4.564s
user 0m1.396s
sys 0m1.622s

After unexporting PROMPT_COMMAND
real 0m3.629s
user 0m1.190s
sys 0m1.660s

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants