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

Detached Head Detection Improvement #588

Merged
merged 23 commits into from
Dec 18, 2024

Conversation

kmcgreg5
Copy link

@kmcgreg5 kmcgreg5 commented Dec 18, 2024

To avoid overhead associated with git status, changes git detached head detection to use the git symbolic-ref command. Head will be a reference to the branch if the repository is in a non-detached state, so the command will exit with a 0 RC. If the branch is in a detached state, HEAD will just contain the commit and not a reference. So the command will return a non-zero RC after failing to find a reference.

The -q option suppresses error output from a detached state.

This does change the return from false to true on an error scenario, in case that's important.

Resolves #587.

drbruce-git and others added 23 commits October 17, 2022 15:19
Merge develop into main for zAppBuild 3.0.0 release
zAppBuild 3.7.0 version file update
Release zAppBuild 3.10.0
Release zAppBuild 3.10.1
Signed-off-by: Kai McGregor <[email protected]>
Signed-off-by: Kai McGregor <[email protected]>
Signed-off-by: Kai McGregor <[email protected]>
Signed-off-by: Kai McGregor <[email protected]>
Signed-off-by: Kai McGregor <[email protected]>
Signed-off-by: Kai McGregor <[email protected]>
Signed-off-by: Kai McGregor <[email protected]>
@kmcgreg5 kmcgreg5 force-pushed the detached-head-performance-fix branch from 54ed716 to a027e87 Compare December 18, 2024 14:40
@dennis-behm dennis-behm changed the base branch from main to develop December 18, 2024 15:44
Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

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

Thank you @kmcgreg5 . Looks good to me. Thanks for implementing.

@dennis-behm dennis-behm merged commit 02c4f2c into IBM:develop Dec 18, 2024
1 check passed
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.

Update check for detached head state
3 participants