Title: Azure DevOps - Git branch name incomplete if it contains a slash · Issue #17 · git-commit-id/git-commit-id-plugin-core · GitHub
Open Graph Title: Azure DevOps - Git branch name incomplete if it contains a slash · Issue #17 · git-commit-id/git-commit-id-plugin-core
X Title: Azure DevOps - Git branch name incomplete if it contains a slash · Issue #17 · git-commit-id/git-commit-id-plugin-core
Description: Azure Devops - Incomplete git branch name Relating to feature git-commit-id/git-commit-id-maven-plugin#438 The predefined variables in Azure Devops can lead to incomplete branch names: According to https://docs.microsoft.com/en-us/azure/...
Open Graph Description: Azure Devops - Incomplete git branch name Relating to feature git-commit-id/git-commit-id-maven-plugin#438 The predefined variables in Azure Devops can lead to incomplete branch names: According to...
X Description: Azure Devops - Incomplete git branch name Relating to feature git-commit-id/git-commit-id-maven-plugin#438 The predefined variables in Azure Devops can lead to incomplete branch names: According to...
Opengraph URL: https://github.com/git-commit-id/git-commit-id-plugin-core/issues/17
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Azure DevOps - Git branch name incomplete if it contains a slash","articleBody":"### Azure Devops - Incomplete git branch name\r\nRelating to feature git-commit-id/git-commit-id-maven-plugin#438 \r\n\r\nThe predefined variables in Azure Devops can lead to incomplete branch names: According to \r\nhttps://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops\u0026tabs=yaml#build-variables\r\nyou can see that BUILD_SOURCEBRANCHNAME only contains everything behind the last slash ('/'). This is incomplete however if the branchname itself contains a slash. \r\nThere is an issue on DevOps side, but it seems they are not changing that behavior\r\nhttps://developercommunity.visualstudio.com/t/azure-devops-build-variable-buildsourcebranchname/519811\r\n\r\nMaybe in this plugin at least we can? If so, the solution should probably be using BUILD_SOURCEBRANCH (complete name, including \"refs/heads/\") and statically removed the \"refs/heads/\" at the beginning\r\n\r\n\r\n\r\n### Steps to Reproduce\r\nHave a branch with a slash in its name (e.g. \"feature/iss123_description\")\r\n\r\n```xml\r\n\u003cplugin\u003e\r\n \u003cgroupId\u003eio.github.git-commit-id\u003c/groupId\u003e\r\n \u003cartifactId\u003egit-commit-id-maven-plugin\u003c/artifactId\u003e\r\n \u003cconfiguration\u003e\r\n \u003cgenerateGitPropertiesFile\u003etrue\u003c/generateGitPropertiesFile\u003e\r\n \u003cgenerateGitPropertiesFilename\u003esrc/main/resources/git.properties\u003c/generateGitPropertiesFilename\u003e\r\n \u003cfailOnNoGitDirectory\u003etrue\u003c/failOnNoGitDirectory\u003e\r\n \u003cdotGitDirectory\u003e${project.basedir}../../../.git\u003c/dotGitDirectory\u003e\r\n \u003cverbose\u003etrue\u003c/verbose\u003e\r\n \u003c/configuration\u003e\r\n\u003c/plugin\u003e\r\n```\r\n\r\nBuild the project in a AzureDevops Pipeline\r\n\r\nResult: The git.properties file contains the branch as \"git.branch=ss123_description\"\r\n\r\n\r\n### Expected behavior\r\n- The git.properties file should contain the branch as \"git.branch=feature/iss123_description\"\r\n\r\n### Additional context\r\nFor reproducibility please provide the following:\r\n\r\n- plugin version 5.0.0\r\n- java version: AdaptOpenJDK 11\r\n- maven version 3.6\r\n- OS version Ubuntu 20.04\r\n","author":{"url":"https://github.com/b509","@type":"Person","name":"b509"},"datePublished":"2022-01-28T14:28:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/17/git-commit-id-plugin-core/issues/17"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c095dbd2-c332-5bcd-6f21-7a70479290f4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E14:12A9AF:E68E1:126383:696AFE35 |
| html-safe-nonce | 2c4ebc0d7114fc47f46e27690c44e40de7afc53028789eea8287362f72e93a54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTE0OjEyQTlBRjpFNjhFMToxMjYzODM6Njk2QUZFMzUiLCJ2aXNpdG9yX2lkIjoiMzA3NDY4NTYwNDg1NTQ3OTg2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 240b4b137c342d8df6ba6359861a02079e2d2e3dfbbcd9db3cbed43cfacc1d3b |
| hovercard-subject-tag | issue:1665091105 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/git-commit-id/git-commit-id-plugin-core/17/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc04eb0078871ef749a546d6b1bbe46b0a038d11ce6f59cfa1a908d260d7bdfc/git-commit-id/git-commit-id-plugin-core/issues/17 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc04eb0078871ef749a546d6b1bbe46b0a038d11ce6f59cfa1a908d260d7bdfc/git-commit-id/git-commit-id-plugin-core/issues/17 |
| og:image:alt | Azure Devops - Incomplete git branch name Relating to feature git-commit-id/git-commit-id-maven-plugin#438 The predefined variables in Azure Devops can lead to incomplete branch names: According to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | b509 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/git-commit-id/git-commit-id-plugin-core git https://github.com/git-commit-id/git-commit-id-plugin-core.git |
| octolytics-dimension-user_id | 43124426 |
| octolytics-dimension-user_login | git-commit-id |
| octolytics-dimension-repository_id | 376144855 |
| octolytics-dimension-repository_nwo | git-commit-id/git-commit-id-plugin-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 376144855 |
| octolytics-dimension-repository_network_root_nwo | git-commit-id/git-commit-id-plugin-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width