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

Add HEAD support #3241

Closed

Conversation

simonetognolo
Copy link

@simonetognolo simonetognolo commented Oct 17, 2022

Description

Add support for detached branches through configuration option handle-detached-branch.

Related Issue

Motivation and Context

Detached branches are common with submodules and development scenario. With this option enabled, you can build a project with detached branches without errors.

How Has This Been Tested?

  • Add test GivenARemoteGitRepositoryWhenCheckingOutDetachedHeadUsingExistingImplementationHandleDetachedBranch. I don't know if it's enough, I appreciate suggestions on how to add tests for this purpose.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

It looks like my code follows the code style, but please double check (also for documentation).

@simonetognolo
Copy link
Author

PR submitted, all tests pass. @asbjornu any suggestions for improvement?

Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

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

This is great! It seems like this may also resolve #3124, #2753, #2478, and #2900 as well?

@@ -552,6 +552,11 @@ Example of invalid `Strict`, but valid `Loose`
1.2.3.4
```

### handle-detached-branch
Copy link
Member

Choose a reason for hiding this comment

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

Since you're targeting main, this is going to be rolled into v6. To target v5, you need to rebase and retarget against support/5.x, but I would like to avoid the introduction of new configuration properties. As such, I don't think we need any new configuration properties to add support for detached HEAD?

Copy link
Author

Choose a reason for hiding this comment

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

For me it's ok to go for v6. Are you proposing to change the beaviour and always handle detached branches? Will I remove the handle-detached-branch option and every changes correlated?

src/GitVersion.Core/Core/RepositoryStore.cs Show resolved Hide resolved
@asbjornu
Copy link
Member

Superseded by #3338.

@asbjornu asbjornu closed this Jan 20, 2023
@asbjornu asbjornu added this to the 5.x milestone Jan 20, 2023
@arturcic arturcic modified the milestones: 5.x, 5.12.0 Jan 20, 2023
@arturcic
Copy link
Member

🎉 This issue has been resolved in version 5.12.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging this pull request may close these issues.

[Improvement] Add HEAD support
3 participants