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

Set initial-branch (#427) #465

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

Set initial-branch (#427) #465

wants to merge 1 commit into from

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Mar 24, 2021

Fixes #427

Suppress noise about that git itself is changing its default branch. When actions/checkout is used, it will always be given a specific branch (or similar) to check things out, and thus the default branch is not used...

Run actions/checkout@v2.0.0
Run actions/checkout@v2.0.0
  with:
    fetch-depth: 2
    repository: org/repo
    token: ***
    persist-credentials: true
    clean: true
    lfs: false
Syncing repository: org/repo
Working directory is '/home/runner/work/org/repo'
/usr/bin/git version
git version 2.30.0
Deleting the contents of '/home/runner/work/org/repo'
/usr/bin/git init /home/runner/work/org/repo
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>
Initialized empty Git repository in /home/runner/work/org/repo/.git/

See #465 (comment) for a proof.

@jsoref
Copy link
Contributor Author

jsoref commented Apr 7, 2021

@ericsciple: is there something I need to do to get this considered?

@jsoref
Copy link
Contributor Author

jsoref commented Apr 18, 2021

@thboop @dscho: is there something I need to do to move this forward?

Copy link
Contributor

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a shorter name, and I would have much preferred a proper analysis why this change is safe (instead, I was forced to perform that analysis myself, from scratch, and I imagine that this is the problem that prevents the team from merging this PR: it just asks for too much effort on the reviewers' side).

Having said that, I would not mind this PR being merged as-is, I would merely prefer above-mentioned issues to be addressed.

@jsoref
Copy link
Contributor Author

jsoref commented Jun 24, 2021

@hross what do I need to do to move this forward?

@dscho
Copy link
Contributor

dscho commented Jun 29, 2021

@ericsciple @TingluoHuang ping?

@jsoref
Copy link
Contributor Author

jsoref commented Jan 12, 2023

@vanZeben is there something that can be done to move this along?

@kbrock
Copy link

kbrock commented Jun 6, 2023

Looks like this stalled.

Are there other suggestions on silencing this warning? It shows up quite a few times.

@jsoref
Copy link
Contributor Author

jsoref commented Jun 7, 2023

@kbrock: I can rebase and you can use my fork that has the fix. Otherwise, you could technically create an action / wrapper /step that does:

git config --global init.defaultBranch silence_warning_about_default_branch

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
@jsoref jsoref requested a review from a team as a code owner June 7, 2023 15:30
@MestreLion
Copy link

My opinions on this:

  • The long form --initial-branch was a great choice. It's self-descriptive, and would have little to no point saving a few bytes with -b
  • The chosen branch name is only temporary and not referenced anywhere. It couldn't be otherwise, as the current master used by default is not hardcoded anywhere in this tool, and even when it doesn't match the cloned repo's this tool works on them just fine.
  • So, how about dummy? It's short, it clearly states it is temporary and irrelevant, and it avoids taking sides about master/main.

And remember that just like @dscho I'm not a maintainer (and not even a contributor), just a developer very interested in this PR going forward and eventually being accepted. It's been more than an year guys!

(PS: @jsoref , you might mark your conversation with @dscho as resolved, it would be one less red status on the pending items summary, this might incentivize a reviewer . And maybe ping an actual (human) maintainer/reviewer, as that CODEOWNERS file you used to ping the team seems to have errors (@actions/actions-runtime is not an actual team), so no one was actually pinged.)

@jsoref
Copy link
Contributor Author

jsoref commented Nov 28, 2024

@mouismail?

I'm happy to pick any name that a codeowner suggests.

Personally I use placeholder for my default branches (it doesn't have any negative connotations), but I don't want people to think that I'm actively favoring that here or that my use of placeholder would relate to the use here...

Anyway, I'm more than happy to update this (or any of my other PRs) although I'm about to be relatively unavailable for a bit.

@MestreLion
Copy link

Anyway, I'm more than happy to update this (or any of my other PRs) although I'm about to be relatively unavailable for a bit.

I suggest you preemptively change the branch name now to something shorter, such as your placeholder (a good choice!), or dummy, main or even master (current implicit default), just to avoid a situation where a reviewer asks for a change and this PR blocks again because you're unavailable. I believe the shorter names above will make it more likely for this PR to be accepted and merged without changes even if you're AFK.

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.

Suppress hint: Using 'master' as the name for the initial branch. This default branch name
4 participants