Skip to content

[Bug] Builds fail due to detached HEAD during interactive rebase #3124

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

Closed
rcdailey opened this issue May 22, 2022 · 2 comments
Closed

[Bug] Builds fail due to detached HEAD during interactive rebase #3124

rcdailey opened this issue May 22, 2022 · 2 comments
Labels
Milestone

Comments

@rcdailey
Copy link

Describe the bug

During interactive rebase, HEAD is detached and thus I am not able to build my project. I get the following error:

It looks like the branch being examined is a detached Head pointing to commit '5fa2336'. Without a proper branch name GitVersion cannot determine the build version.

Expected Behavior

Even though I understand the reasons why detached HEAD is not supported, I think it's important to somehow allow the build to succeed during interactive rebase.

Possible Fix

Maybe a temporary version number if REBASE_HEAD exists? It's not really important for version numbers to be accurate during a rebase. The build just needs to succeed for testing purposes.

Steps to Reproduce

  1. Create a branch with 2 commits on it
  2. Perform a git rebase -i origin/master
  3. For the first commit, change it from pick to edit
  4. When the rebase stops at that commit, perform a dotnet build, or compile with visual studio.

Context

The reason why builds are important during interactive rebase can be explained with this example:

  1. I perform an interactive rebase and stop at a specific commit (with edit) to fix an issue
  2. After fixing it, I want to build, run unit tests, and run the application for a quick smoke test. The idea is: At this specific commit, everything should "work" because it's possible to cherry-pick this commit later, or revert it, and it needs to work in isolation from my branch.
@rcdailey rcdailey added the bug label May 22, 2022
@asbjornu
Copy link
Member

Fixed by #3338.

@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

No branches or pull requests

3 participants