-
Notifications
You must be signed in to change notification settings - Fork 87
Added feature that let's you specify how often to fetch #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
with --fetch_t you can specify how many seconds to wait before auto fetching. using the --fetch option gives you the default of 5 minutes still. "--fetch_t 45" for example would fetch every 45 seconds.
Merged changes so that this could be merged easily |
fetch.sh
Outdated
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.
Rather than checking
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.
Agreed. I will change to $@
Nice change, something I've been meaning to get in there for a while. I've left a few review comments that I think might be worth addressing. I might not be right on those, just starting a conversation. If doing this I'd also like to follow the pattern the Colour and Format features have followed where they use |
Thanks, I will look into these. |
in fetch.sh "if" now checks for $@ instead of just $1 in radar-base.sh there is now a parameter expansion on line 170 instead of the if statements. in git-radar, now there is a shift, and a regex check that the next value is a number. If the next value after --fetch_t is not a number, an error is echo'd and it resorts to the default behaviour of 5 minutes.
I have made the changes recommended Update: Looks like I may have an issue with the fetch now. Just wait before merging this for now. Update on the update: It was an error in my parameter sub (that was new to me, and it turns out that I messed it up). All is good now |
Also, let me know your input on this, but I was thinking why bother even having --fetch_t ?? Maybe just use --fetch and check for a numeric argument following --fetch... if there is one, then use that... if not then use the default and then we wont need the error message that I put in... So basically expand the functionality of the already existing --fetch option. I would like to hear your thoughts... |
I am not quite sure I understand what you mean by following the pattern of the colour and format features where they used prepare_bash_colors. Are you thinking of having something like: export FETCH_TIME='30' Which we would be able to have in an rc file? So instead of using the --fetch_t option, using something similar to the above command? |
Looks good, thanks for addressing those. On the pattern I mentioned it goes like this: in
That will set Then in the
So if you pass a time to (Note: none of this code has been executed, likely there are typos everywhere) |
Ah... that makes sense... I will work on that now. |
Okay, I have it working now... Just doing a little bit of testing before pushing it... So with this addition, should we keep the --fetch_t or just get rid of it? Since now we can just do --fetch but have a variable in the bashrc or gitradarrc to specify how long to wait? The commit I will push for this will get rid of fetch_t and just have fetch. Unless I here back before making the change... If you would prefer to keep the fetch_t, I can add it back afterwards. |
Set the variable GIT_RADAR_FETCH_TIME in a bashrc, zshrc or gitradarrc file to customize the fetch time.
Changes are in. Before you merge anything, I can go ahead and squash all of these commits into 1 as well if you would prefer? There has been a lot of changes that have been reverted etc... But if you want to keep the history that is cool too. Just let me know. |
…arameter substitution that has been removed in this commit.
Your PR is merged into this PR |
👍 Thanks for this, good determination shown here. Merging, 🚢 it! |
Added feature that let's you specify how often to fetch
I thought that this would be interesting, and useful for some people since 5 minutes may not be often enough for some people, so I made a modification so that you can easily customize how long to wait before fetching.
with --fetch_t you can specify how many seconds to wait before auto fetching.
using the --fetch option gives you the default of 5 minutes still.
"--fetch_t 45" for example would fetch every 45 seconds.