From 8a54924d2aeffa841a3764b2c916211a8219c34c Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Thu, 17 Oct 2024 22:25:11 +0200 Subject: [PATCH] nix-prefetch-git: set branch name to suppress hint from git In my system logs I see this every time a new eval starts: ``` hydra-evaluator[PID]: hint: Using 'master' as the name for the initial branch. This default branch name hydra-evaluator[PID]: hint: is subject to change. To configure the initial branch name to use in all hydra-evaluator[PID]: hint: of your new repositories, which will suppress this warning, call: hydra-evaluator[PID]: hint: hydra-evaluator[PID]: hint: git config --global init.defaultBranch hydra-evaluator[PID]: hint: hydra-evaluator[PID]: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hydra-evaluator[PID]: hint: 'development'. The just-created branch can be renamed via this command: hydra-evaluator[PID]: hint: hydra-evaluator[PID]: hint: git branch -m ``` This ensures this hint is not logged anymore and unclutters the syslog. I presume it does not really matter what name is chosen for the branch. --- src/script/nix-prefetch-git | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/nix-prefetch-git b/src/script/nix-prefetch-git index 3fe399c8..316eb9b0 100755 --- a/src/script/nix-prefetch-git +++ b/src/script/nix-prefetch-git @@ -78,7 +78,7 @@ fi init_remote(){ local url=$1; - git init; + git init --initial-branch=trunk; git remote add origin $url; }