You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ijuma (via GitHub)" <gi...@apache.org> on 2023/02/28 22:35:04 UTC

[GitHub] [kafka] ijuma commented on a diff in pull request #13315: KAFKA-14767: Fix missing commitId build error after git gc

ijuma commented on code in PR #13315:
URL: https://github.com/apache/kafka/pull/13315#discussion_r1120878251


##########
build.gradle:
##########
@@ -159,16 +159,9 @@ def determineCommitId() {
   def takeFromHash = 16
   if (project.hasProperty('commitId')) {
     commitId.take(takeFromHash)
-  } else if (file("$rootDir/.git/HEAD").exists()) {
-    def headRef = file("$rootDir/.git/HEAD").text
-    if (headRef.contains('ref: ')) {
-      headRef = headRef.replaceAll('ref: ', '').trim()
-      if (file("$rootDir/.git/$headRef").exists()) {
-        file("$rootDir/.git/$headRef").text.trim().take(takeFromHash)
-      }
-    } else {
-      headRef.trim().take(takeFromHash)
-    }
+  } else if (file("$rootDir/.git").exists()) {
+    def repo = Grgit.open(currentDir: project.getRootDir())

Review Comment:
   The `rat` configuration does something similar, maybe we should have a variable for the git repo that can be used by both tasks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org