lafiona commented on code in PR #14033:
URL: https://github.com/apache/arrow/pull/14033#discussion_r993766841
##########
dev/archery/archery/crossbow/core.py:
##########
@@ -361,6 +361,24 @@ def signature(self):
return pygit2.Signature(self.user_name, self.user_email,
int(time.time()))
+ @property
+ def default_branch_name(self):
+ default_branch_name = os.getenv("DEFAULT_BRANCH")
Review Comment:
Since the git repositories do not always have a remote head reference, we
use an environment variable as a another way to get the default branch name.
The addition of support for the environment variable also reduces the reliance
on the hard-coded default branch name value in step 3. After the changes from
this code review, the order will be:
1. Check for an environment variable that will contain the default branch
name (a way for the user to either override the Git remote head reference
heuristic, if needed)
2. Get the default branch from the repository's remote head reference (most
likely to be correct, if present in the repository)
3. Default to `master` and warn that the other two heuristics did not result
in a default branch name
I will change the environment variable to a more specific name, as you
suggested, `ARCHERY_DEFAULT_BRANCH`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]