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

Display commit revision for latest Tag, or first commit #156

Closed
rbuckland opened this issue Nov 2, 2023 · 3 comments
Closed

Display commit revision for latest Tag, or first commit #156

rbuckland opened this issue Nov 2, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@rbuckland
Copy link

I am integrating convco into a monorepo that uses pants for the build of many artefacts (packages)

Pants, given a commit can detail with filters (paths, types) which packages are impacted.

It can also build the said packages with the same filters.

An example of the usage would be


pants --changes-since=$(convco version --tagrev --prefix my/lib/v --paths my/lib ) package list

Convco knows for a given paths (path/to/package) and for a given tag prefix path/to/package/v , what the latest tag is.

What I am looking for is to ask convco for the commit of that tag instead (version --tagrev)

Currently I do this lookup in shell with calls to convco and to git log

It will be nice to do this only with convco

In scenario where there is no tag then convco should print the first introducing commit (if paths or the first commit if no paths)

Thoughts ?

@rbuckland rbuckland added the enhancement New feature or request label Nov 2, 2023
hdevalke added a commit that referenced this issue Nov 6, 2023
Print out the commit sha of the version when running `convco version --commit-sha`

Refs: #156
@hdevalke
Copy link
Collaborator

hdevalke commented Nov 6, 2023

I used --commit-sha in #158 , but i think it might work to add a flag --print-prefix as pants probably understands all kinds of git revisions for --changed-since

this is what it prints for this repository at e9d98f7.

❯ git log --oneline -1 v0.4.3
feeea90 (tag: v0.4.3) chore: release v0.4.3

❯ cargo run -q -- version
0.4.3

❯ cargo run -q -- version --commit-sha
feeea9022f2795d280602aaba4d3c24a8088f125

hdevalke added a commit that referenced this issue Nov 6, 2023
Print the prefix before the semantic version using `convco version --print-prefix` or `convco version --pp`.

Refs: #156
hdevalke added a commit that referenced this issue Nov 6, 2023
Print out the commit sha of the version when running `convco version --commit-sha`

Refs: #156
hdevalke added a commit that referenced this issue Nov 6, 2023
Print the prefix before the semantic version using `convco version --print-prefix` or `convco version --pp`.

Refs: #156
@hdevalke
Copy link
Collaborator

hdevalke commented Nov 6, 2023

I also added an option to print the prefix in front of the semantic version convco version --print-prefix or convco version --pp

@hdevalke hdevalke closed this as completed Nov 6, 2023
@rbuckland
Copy link
Author

Very nice. Thanks !

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

No branches or pull requests

2 participants