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

feat(git): add support for :: in #committish #91

Merged
merged 2 commits into from
Jun 22, 2022
Merged

feat(git): add support for :: in #committish #91

merged 2 commits into from
Jun 22, 2022

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Jun 21, 2022

This builds off of #46, and
more specifically the spec laid out by @coreyfarrell. Namely:

For each :: separated item:

  • If the item has no : then it is a commit-ish
  • If the item has : then split into name and value.
    • If the name is semver then do semver lookup of ref or tag
    • If the name is path then use the value as the subdir to install from.
    • If the name is unknown then warn that the name-value pair is being ignored.

This loop errors if duplicate values are found.
Unknown values log a warning instead of erroring.

This also introduces the concept of a path specifier that is assigned
to the gitSubdir attribute. Consuming libs (e.g. pacote) will need to
look for that and react to its presence accordingly.

Credit: @sspiff for the original PR and @coreyfarrell for the spec

sspiff and others added 2 commits June 21, 2022 12:37
This iterates on the spec outlined by @coreyfarrel in
#46.

For each :: separated item:
  * If the item has no : then it is a commit-ish
  * If the item has : then split into name and value.
    * If the name is semver then do semver lookup of ref or tag
    * If the name is path then use the value as the subdir to install from.
    * If the name is unknown then warn that the name-value pair is being ignored.

This loop errors if duplicate values are found.
Unknown values log a warning instead of erroring.
@wraithgar wraithgar requested a review from a team as a code owner June 21, 2022 20:51
@wraithgar wraithgar added the Agenda will be discussed at the Open RFC call label Jun 21, 2022
Copy link
Contributor

@nlf nlf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@wraithgar wraithgar changed the title feat: feat(git): add support for :: in #committish feat(git): add support for :: in #committish Jun 22, 2022
@wraithgar wraithgar merged commit 246f1e9 into main Jun 22, 2022
@wraithgar wraithgar deleted the gar/46 branch June 22, 2022 20:42
@prmichaelsen
Copy link

ahhhhhh shieeeet

@darcyclarke darcyclarke removed the Agenda will be discussed at the Open RFC call label Jun 29, 2022
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.

5 participants