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

Handle the branch-before-tag case #20

Merged
merged 1 commit into from
Feb 12, 2021
Merged

Handle the branch-before-tag case #20

merged 1 commit into from
Feb 12, 2021

Conversation

smlx
Copy link
Owner

@smlx smlx commented Feb 12, 2021

This PR adds logic for handling a more complex git history.

Consider this tree. We want to know what to tag HEAD, which is at the
tip of [main]:

  M─┐ [main] chore: merge again
  │ o [new-branch-1] fix: another minor change
  M─│─┐ <v0.1.1> chore: merge
  │ │ o [new-branch-2] fix: minor change
  I─┴─┘ <v0.1.0> chore: initial commit

The [main] parent of the current HEAD contains these commits:

  * chore: merge again
  * <v0.1.1> chore: merge

The [new-branch-1] parent of the current HEAD contains these commits:

  * chore: merge again
  * fix: another minor change
  * <v0.1.0> chore: initial commit

Either history considered by itself indicates the new tag for HEAD
should be v0.1.1. But that is not correct, because the histories need to
be _combined_ to determine the correct version: v0.1.2.

This is the scenario that this commit fixes.
@smlx smlx added the bug Something isn't working label Feb 12, 2021
@smlx smlx merged commit 2672e48 into main Feb 12, 2021
@smlx smlx deleted the log-order-again branch February 12, 2021 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant