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

parse revision specifications #428

Merged
merged 75 commits into from Jun 12, 2022
Merged

parse revision specifications #428

merged 75 commits into from Jun 12, 2022

Conversation

Byron
Copy link
Owner

@Byron Byron commented May 24, 2022

'Pure' parsing of rev-specs.

Tasks

Revisions

  • long hex and short hex sha
  • git describe output
  • refnames
  • @ for HEAD

Navigation

@ with ref-name or branch-name anchor

  • [refname]@{date} syntax (with just initial parsing of dates, see git-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] with object needing it to exist
  • rev^{} (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 exclusion
  • a..b - two dot range
  • a...b - three dot symmetric difference

Out of scope

  • gix repo revspec explain - just say something each time the delegate is called.
  • integration with git-repository

@Byron Byron added this to In progress in Collaboration Board May 24, 2022
@Byron Byron changed the title Parse Revision Specifications parse revision specifications May 25, 2022
@Byron Byron mentioned this pull request May 28, 2022
@Byron Byron moved this from In progress to Done in Collaboration Board May 28, 2022
@Byron Byron moved this from Done to In progress in Collaboration Board May 28, 2022
@kalkin
Copy link
Contributor

kalkin commented May 30, 2022

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.

@Byron
Copy link
Owner Author

Byron commented May 30, 2022

No worries, you are welcome any time, all the best!

Byron added 22 commits June 7, 2022 10:45
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.
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.
Byron added 5 commits June 8, 2022 15:10
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.
@Byron Byron merged commit 74e7a46 into main Jun 12, 2022
Collaboration Board automation moved this from In progress to Done Jun 12, 2022
@Byron Byron mentioned this pull request Jun 12, 2022
12 tasks
@Byron Byron deleted the revspec-parsing branch June 12, 2022 09:14
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.

None yet

2 participants