Skip to content

git: 2.47.2 -> 2.48.1 - #372784

Merged
SuperSandro2000 merged 3 commits into
NixOS:stagingfrom
me-and:git
Feb 12, 2025
Merged

SuperSandro2000 merged 3 commits into
NixOS:stagingfrom
me-and:git

Conversation

@me-and

@me-and me-and commented Jan 10, 2025 •

Copy link
Copy Markdown
Member

Changelogs:

This also includes one commit from #370888, which is necessary for the build to complete.

No substantial changes that affect backwards compatibility AFAICS, so I don't think there's a need for a release note.

Haven't tested all executables in bin/, but I did check git --version as a quick test on top of the test suite and that's fine. Builds of nixosTests.gitdaemon, git.passthru.tests and tests.fetchgit, as safety checks, are on my system now.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jan 10, 2025
@JohnRTitor
JohnRTitor requested a review from vcunat January 11, 2025 02:40
@me-and

me-and commented Jan 13, 2025

Copy link
Copy Markdown
Member Author

@ofborg build git gitFull git.passthru.tests nixpkgs-manual nixpkgs-manual.tests

@LeSuisse

Copy link
Copy Markdown
Member

Note this will be need to be bumped to 2.48.1 to include fixes for CVE-2024-50349 and CVE-2024-52006 (see also #373801)

@me-and me-and changed the title Git: v2.47.1 -> v2.48.0 Git: v2.47.1 -> v2.48.1 Jan 14, 2025
@me-and

me-and commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

I've updated this PR to target Git v2.48.1 rather than v2.48.0. I'm not adding the security tag as I think the security issue is better addressed by #373801.

@SuperSandro2000 SuperSandro2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The commit message and PR title should not contain the v prefix.

@me-and me-and changed the title Git: v2.47.1 -> v2.48.1 Git: 2.47.1 -> 2.48.1 Jan 14, 2025
@me-and

me-and commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

The commit message and PR title should not contain the v prefix.

Fixed, thank you!

@SuperSandro2000 SuperSandro2000 changed the title Git: 2.47.1 -> 2.48.1 git: 2.47.1 -> 2.48.1 Jan 15, 2025

@SuperSandro2000 SuperSandro2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 15, 2025
@matejc

matejc commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

@me-and

me-and commented Jan 17, 2025

Copy link
Copy Markdown
Member Author

@matejc for the security fixes, I think you want #373801, which only covers the security fixes, whereas this is a more substantial update.

@SuperSandro2000

Copy link
Copy Markdown
Member

I've merged the small update. Can you rebase this on staging to fix the conflict?

@me-and

me-and commented Jan 18, 2025

Copy link
Copy Markdown
Member Author

@SuperSandro2000 done! Updated branch with updated commit message for the new version change.

@vcunat vcunat changed the title git: 2.47.1 -> 2.48.1 git: 2.47.2 -> 2.48.1 Jan 19, 2025
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 19, 2025

@SuperSandro2000 SuperSandro2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

build locally with success

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 20, 2025
@SuperSandro2000

Copy link
Copy Markdown
Member

Anyone has an idea why some tests from https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchgit/tests.nix#L49 are now suddenly failing? Do we just update the hashes?

@me-and

me-and commented Jan 25, 2025

Copy link
Copy Markdown
Member Author

Anyone has an idea why some tests from https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchgit/tests.nix#L49 are now suddenly failing? Do we just update the hashes?

Ah! I've just looked at the different test outputs. The issue, at least for tests.fetchgit.leave-git is that the old version of Git created an empty .git/branches directory, which the new version omits. The culprit is git/git@ed060aa.

I'm not sure the best way to handle this. Options I can see:

  1. Update the hashes for the now-failing tests in tests.fetchgit only. That'll mean anything else that uses leaveDotGit, or anything that implies that, will be broken.
  2. Work out everything in nixpkgs that uses leaveDotGit and fix that up, too. I'm not entirely sure how to achieve that, but it sounds like something that at least ought be straightforward. This will still break anything external that uses that function.
  3. Change fetchgit to add the .git/branches directory back. This avoids breaking anything, but I'm not a fan of undoing upstream changes like that.

I'd default to option 2 + a release note, but I'd be interested in thoughts from people who've been doing this longer than I have!

@emilylange

Copy link
Copy Markdown
Member

Quoting https://nixos.org/manual/nixpkgs/unstable/#fetchgit (perma link):

leaveDotGit (Boolean)

Whether the .git directory of the clone should not be removed after checkout.

Be warned though that the git repository format is not stable and this flag is therefore not suitable for actual use by itself. Only use this for testing purposes or in conjunction with removing the .git directory in postFetch.

IMHO we document very clearly that leaveDotGit is not stable.
There are like a hundred uses of leaveDotGit in nixpkgs, most of which rm the .git in postFetch as suggested.
Only a handful don't remove .git, which has reproducibility issues and should likely be fixed regardless of this PR here.

Given that, I suggest going with option 1.
Meaning, we fix the hashes in tests.fetchgit, keep the inherently broken uses of this in nixpkgs as is and also not add a release note.

Opinions?

For build process clarity, build documentation during the build phase.
Without this change, the docs are built during the install phase as
that's when `make` realises they're not yet present.

This also means that the main Git documentation is built before the
contrib/subtree documentation, which is necessary for the subtree
documentation to build successfully in Git v2.48.0-rc0 and -rc1 (and
presumably therefore in v2.48.0 when it is released).
@github-actions github-actions Bot added the 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) label Feb 11, 2025
@me-and

me-and commented Feb 11, 2025

Copy link
Copy Markdown
Member Author

@emilylange that makes sense to me! I've just pushed a new version of the branch that updates the hashes in the fetchgit tests, and has a commit message explaining the decision.

@emilylange

Copy link
Copy Markdown
Member

There is a small number (48 vs 84) flip in the commit message of aaf1fff57dd7564ee48e419c7346c077ec6885a9:

Per the fetchgit documentation and discussions in #372748, the contents [...]

vs

Per the fetchgit documentation and discussions in #372784, the contents [...]

I normally don't comment on typos, but this feels like the one exception where is actually makes sense to me :)

me-and and others added 2 commits February 11, 2025 20:00
This version change includes a change to the contents of the .git
directory, which results in changes to hashes for any fetchgit
invocations that set leaveDotGit to true.  Per the fetchgit
documentation and discussions in NixOS#372784, the contents of the .git directory are not stable, so
anyone using that should either only be using it for temporary testing
purposes, or should be removing the .git directory in fetchgit's
postFetch phase, so before the hash is calculated.  That means there's
no need to do any other handling here to avoid compatibility problems,
and can just update the relevant hashes in the fetchgit tests.

There's still a chance this will break some other builds because of the
change to the contents of the .git directory.  If so, whoever's
responsible for those other derivations should either stop using
leaveDotGit, or should follow the documented advice to remove the .git
directory in the postFetch phase.
@me-and

me-and commented Feb 11, 2025

Copy link
Copy Markdown
Member Author

...oops, thank you!

@nix-owners
nix-owners Bot requested a review from philiptaron February 11, 2025 20:01
@github-actions github-actions Bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Feb 11, 2025

@emilylange emilylange left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks! :)

@SuperSandro2000 SuperSandro2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To anyone finding this thread in the future: rm .git in postFetch please :)

@SuperSandro2000
SuperSandro2000 merged commit dbabb64 into NixOS:staging Feb 12, 2025
@me-and me-and mentioned this pull request Feb 13, 2025
24 of 27 tasks
@me-and me-and mentioned this pull request Mar 16, 2025
16 of 25 tasks
@me-and
me-and deleted the git branch January 27, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants