Skip to content
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

Fix for versions after 0.29 #100

Merged
merged 1 commit into from
May 11, 2015
Merged

Conversation

epmatsw
Copy link

@epmatsw epmatsw commented Apr 30, 2015

The regex used to check if the version is > 0.25 breaks for versions with format 0.AB.X where A > 2 and B < 5. This means that with the latest version of ag (0.30.0), the result formatting gets messed up.

The check is using [2-9][5-9] to check the middle number, so:
0.19.0 - fail
0.20.0 - fail
0.25.0 - pass
0.30.0 - fail (current version :()
0.31.0 - fail
0.35.0 - pass
0.40.0 - fail

The new regex is a little more complicated, but uses (2[5-9])|([3-9][0-9]).
0.19.0 - fail
0.20.0 - fail
0.25.0 - pass
0.30.0 - pass (current version :D)
0.31.0 - pass
0.35.0 - pass
0.40.0 - pass

@Numkil
Copy link

Numkil commented May 8, 2015

If you are interested I already fixed this in my fork of this project. I don't think anyone is answering here anymore. I only started the fork because I wanted more stuff to be merged and added, but I'm determined to keep adding stuff and accepting merges for a long time.

@epmatsw
Copy link
Author

epmatsw commented May 8, 2015

Looks nice @Numkil. You should talk to the maintainer of the Silver Search and get the README updated to point at your repository.

@Numkil
Copy link

Numkil commented May 8, 2015

Not sure if it's ready yet (mainly AgFile doens't work as it should yet) and I don't want to rule out the work done here. I will when I don't get any other responses here for the next month or so. Thanks btw, if you end up using it and encounter some bugs, do not hesitate to create an issue. I'm active daily on github.

@losingkeys
Copy link
Collaborator

I'm around (maintainer), but sparse at the moment. I'll try to find some time in the coming weeks to clean up the PRs in this project. Thanks for your hard work!

@Numkil
Copy link

Numkil commented May 9, 2015

@losingkeys, That's great. I haven't made a pull request for the asynchronous feature because it triggered so many other small changes everywhere that's it is become a huge change. But if you take a look at it and decide You would like it in this official repository I will split it up in several smaller pull requests for you

@losingkeys
Copy link
Collaborator

@Numkil after I clean up (or respond to) existing PRs/issues I'll take a look at your fork and let you know.

@losingkeys
Copy link
Collaborator

@epmatsw nice catch, and thanks for the pull! What do you think about changing the regex to '\d\+.[2-9][05-9]\(.\d\+\)\?' instead?

Also I think there's another PR that introduces tests. This seems like a good candidate for that. I'll try to update this PR w/more info once I figure that out.

@epmatsw
Copy link
Author

epmatsw commented May 9, 2015

That was my initial fix. However, that check incorrectly passes for 0.20.0. That may not be a big deal, but it's the reason I had the two separate conditions.

On May 9, 2015, at 10:32 AM, Josh Hoff [email protected] wrote:

@epmatsw nice catch, and thanks for the pull! What do you think about changing the regex to '\d+.[2-9]05-9?' instead?

Also I think there's another PR that introduces tests. This seems like a good candidate for that. I'll try to update this PR w/more info once I figure that out.


Reply to this email directly or view it on GitHub.

@losingkeys
Copy link
Collaborator

@epmatsw ahh, good catch. Thanks again for the work and the paitence 😄

losingkeys added a commit that referenced this pull request May 11, 2015
@losingkeys losingkeys merged commit 97f0524 into rking:master May 11, 2015
@losingkeys losingkeys mentioned this pull request May 17, 2015
@amerlyq
Copy link

amerlyq commented Nov 28, 2015

I think, that more robust way would be to discard all older versions, because their format is already well-known, then trying to guess all possible future formats.
Therefore this check must be rewritten to something like:

!split(system("ag --version"), "\_s")[2] =~ '\v0\.%(\d|1\d|2[0-4])%(.\d+)?'

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

Successfully merging this pull request may close these issues.

4 participants