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

[main] Makefile: set default branch when initializing git #366

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

This should suppress these hints printed during build:

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah self-assigned this Jun 12, 2024
This should suppress these hints printed during build:

    hint: Using 'master' as the name for the initial branch. This default branch name
    hint: is subject to change. To configure the initial branch name to use in all
    hint: of your new repositories, which will suppress this warning, call:
    hint:
    hint: 	git config --global init.defaultBranch <name>
    hint:
    hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
    hint: 'development'. The just-created branch can be renamed via this command:
    hint:
    hint: 	git branch -m <name>

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

Looks like the git version of the Jenkins agents is too old (probably would work once they're updated to a newer LTS version);

+ make CREATE_ARCHIVE=1 docker.io/balenalib/rpi-raspbian:bookworm
make BUILD_IMAGE="docker.io/balenalib/rpi-raspbian:bookworm" build
make[1]: Entering directory '/home/ubuntu/workspace/containerd-packaging_PR-366'
git init --initial-branch=main src/github.com/containerd/containerd
error: unknown option `initial-branch=main'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

    --template <template-directory>
                          directory from which templates will be used
    --bare                create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be shared amongst several users
    -q, --quiet           be quiet
    --separate-git-dir <gitdir>
                          separate git dir from working tree

make[1]: *** [Makefile:60: src/github.com/containerd/containerd] Error 129
make[1]: Leaving directory '/home/ubuntu/workspace/containerd-packaging_PR-366'
make: *** [Makefile:72: docker.io/balenalib/rpi-raspbian:bookworm] Error 2
script returned exit code 2

@thaJeztah
Copy link
Member Author

Yup; looks like ubuntu 20.04 has git

git --version
git version 2.25.1

Which doesn't have the option;

NAME
       git-init - Create an empty Git repository or reinitialize an existing one

SYNOPSIS
       git init [-q | --quiet] [--bare] [--template=<template_directory>]
                 [--separate-git-dir <git dir>]
                 [--shared[=<permissions>]] [directory]

@thaJeztah
Copy link
Member Author

on ubuntu 22.04 it's there; I can check if we have agents with 22.04

git --version
git version 2.34.1
NAME
       git-init - Create an empty Git repository or reinitialize an existing one

SYNOPSIS
       git init [-q | --quiet] [--bare] [--template=<template_directory>]
                 [--separate-git-dir <git dir>] [--object-format=<format>]
                 [-b <branch-name> | --initial-branch=<branch-name>]
                 [--shared[=<permissions>]] [directory]

@thaJeztah
Copy link
Member Author

@thaJeztah thaJeztah marked this pull request as draft June 12, 2024 17:10
@thaJeztah thaJeztah changed the title Makefile: set default branch when initializing git [main] Makefile: set default branch when initializing git Jul 20, 2024
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.

1 participant