-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
nix-prefetch-git: Run git-init with --initial-branch=master #113313
nix-prefetch-git: Run git-init with --initial-branch=master #113313
Conversation
Please use master anyway because it was the previous default and this way we can be sure nothing else in the ecosystem breaks. |
I thought about that too but given that Git will AFAIK switch to And again: "[AFAIK] the initial branch name doesn't really matter anyway and since we're not relying on / hardcoding
That being said the current Git default branch name is still Anyway, I don't care about [0]: Git's $ git init --initial-branch=XXX123456789XXX test
Initialized empty Git repository in /tmp/test/.git/
$ cd test
$ git remote add origin https://git.kernel.org/pub/scm/network/wireless/iwd.git
$ git fetch origin
[...]
$ grep -R XXX123456789XXX
.git/HEAD:ref: refs/heads/XXX123456789XXX
$ git checkout -b test 1.9
Switched to a new branch 'test'
$ grep -R XXX123456789XXX
.git/logs/HEAD:0000000000000000000000000000000000000000 aa3dc1b95348dea177e9d8c2c3063b29e20fe2e9 Michael Weiss <dev.primeos@gmail.com> 1613571661 +0100 checkout: moving from XXX123456789XXX to test |
Could those in favor of |
Which will probably be overwritten back to master if it can cause issues. This PR is about hiding a message we don't need to see everytime not changing the defaults of tooling in nixpkgs which could break a lot of things and I just don't want to risk that.
No, this is not about politics or opinion. This is about if it breaks anything around the nix tooling. If it does break anything than we keep master to not break anything. If it does not matter then it is whatever and the default branch could even be homeless-shelter. If you are just hiding the message and don't change anything I feel comfortable to merge this without breaking anything or causing regressions. If you change the default branch I don't feel comfortable to merge it. |
The reason for this change is simply to avoid the following messages that are unnecessary and can be confusing (and these messages will be repeated for each submodule): 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> With this change the behaviour remains unchanged (apart from the suppressed "warning" in the console output of course) and therefore this doesn't cause any hashes to change and by default nix-prefetch-git uses the "fetchgit" branch anyway (branchName can be set to override the default): Switched to a new branch 'fetchgit' For that reason the initial branch name doesn't matter anyway and since we're not relying on / hardcoding "master" we could simply switch to "main" (which seems most common nowadays). See [0] for more details on why this wouldn't break anything. However, since the initial branch name doesn't matter and to avoid any additional risks it was "decided" to keep using "master" (s. NixOS#113313). [0]: NixOS#113313 (comment)
894b155
to
2aadb9a
Compare
Tell that to Git and GitHub ;)
But I explained why it doesn't...
That is of course fine. (I would've obviously been confident enough to merge it as is since I tested it but this PR was mainly for feedback regarding the master -> main change and since nobody seems to really care about it we can stick to master.) |
Edit: Please cast your vote on
master
vs.main
here: #113313 (comment)The reason for this change is simply to avoid the following messages
that are unnecessary and can be confusing (and these messages will be
repeated for each submodule):
This shouldn't cause any hashes to change and nix-prefetch-git uses the
"fetchgit" branch anyway:
For that reason the initial branch name doesn't really matter anyway and
since we're not relying on / hardcoding "master" we can simply switch to
"main" (which seems most common nowadays).
Motivation for this change
Without this change (I'm using an image to showcase the yellow color that makes it look like a warning):
With this change:
Tested using (edit:
--check
doesn't work to test this btw, which I only found out later - luckily I ran additional tests though):cc @bjornfor
We could (/should?) also test this on
staging
first.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)