-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
parse revision specifications #428
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
I see you started an own implementation. That's good, because I'm currently very busy with moving and starting a new job. Sorry for letting you down, hope I can help out at some other point, once everything settled. |
No worries, you are welcome any time, all the best! |
Also partially done with experimentation using `git rev-parse`.
Benefit of this is that the basic structure of the parser is setup early.
more structure for tests
This will be useful for all methods/functions that want to take a single spec only. Whenever a range is set, even if no other actual revision is provided, it indicates the input has different intentions than what we require.
This is something for git-repository anyway, but it seems like a lot of work for a rarely used feature and a big dependency which might not ever be faithfully implemented as the regex engines will probably differ.
They parse it backwards, which we most certainly won't do though.
…dling (#427) It needs cleanup for sure.
That way other crates can know which candidates to discard off the bat instead of having to match on an error. It's mere convenience.
- prepare for proper consumption of all navigation tokens
Even though plenty of special cases aren't handled yet.
I din't think git does much if any of that, but it seems right to have it for the time when regex will be supported.
It's more consistent, convenient and powerful.
It's probably a good idea to have CI check them with the latest dependencies, as some sort of 'little bird they use in mines'
Note that for now we don't support anything else after the path indicator, which is a little limiting but something that seems to be good enough for git as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
'Pure' parsing of rev-specs.
Tasks
Revisions
git describe
outputHEAD
Navigation
@
with ref-name or branch-name anchor[refname]
@{date
} syntax (with just initial parsing of dates, seegit-date
refname
@{n
}`@{
n}
@{
-n}
[branchname]
@{upstream|u} and[branchname]
@{push}any anchor
rev
^[n]
(<rev>^0
== commit)rev
^{type
} (type = [commit, tree, tag, blob] withobject
needing it to existrev
^{} (deref tag)rev
^{/text or regex
} (skip actual regex handling which has additional rules)rev
~[n]
rev
:path
text or regex
n
:]path
(stage entry lookup)Ranges
rev
- commit exclusiona
..b
- two dot rangea
...b
- three dot symmetric differenceOut of scope
gix repo revspec explain
- just say something each time the delegate is called.git-repository