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

fetchGit: allow fetching annotated tags #6766

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

balsoft
Copy link
Member

@balsoft balsoft commented Jul 5, 2022

Git doesn't like pointing a branch ref to an annotated tag, however the
other way around is fine. Use this to allow fetchGit to fetch annotated
tags, without specifically annotating them as such.

(hopefully) fixes #3701

Please review with care! I'm not sure this doesn't break some important assumption elsewhere.

Tested by poking around locally.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-01-20-nix-team-meeting-minutes-25/25432/1

@fricklerhandwerk fricklerhandwerk added the feature Feature request or proposal label Feb 24, 2023
@edolstra edolstra modified the milestones: nix-2.14, nix-2.15 Feb 28, 2023
@edolstra edolstra modified the milestones: nix-2.15, nix-2.16, nix-2.17 May 26, 2023
@thufschmitt
Copy link
Member

After digging a bit into that, it turns out that the thing that matters is that annotated tags aren't commits (they are their own thing), and Git doesn't allow writing something that's not a commit hash under /refs/heads (check here). Git being gentle-enough, it's nearly always fine to use a tag hash instead of a commit tag, so I think that fix is correct. Maybe for clarity we could use something else than tags though (since these refs don't have to be tags). I do like nixrefs 😛

And obviously: Can you add some tests for this?

@thufschmitt thufschmitt self-assigned this Jun 12, 2023
@thufschmitt thufschmitt added the idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. label Jun 12, 2023
@Ericson2314 Ericson2314 added the fetching Networking with the outside (non-Nix) world, input locking label Jun 14, 2023
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-06-12-nix-team-meeting-minutes-62/29315/1

Git doesn't like pointing a branch ref to an annotated tag, however the
other way around is fine. Use this to allow fetchGit to fetch annotated
tags, without specifically annotating them as such.
@github-actions github-actions bot added the tests label Jun 28, 2023
@edolstra edolstra modified the milestones: nix-2.17, nix-2.18 Jul 24, 2023
@edolstra edolstra modified the milestones: nix-2.18, nix-2.19 Sep 20, 2023
@edolstra edolstra modified the milestones: nix-2.19, nix-2.20 Nov 20, 2023
@edolstra edolstra modified the milestones: nix-2.20, nix-2.21 Mar 4, 2024
@edolstra edolstra modified the milestones: nix-2.21, nix-2.22 Mar 11, 2024
@edolstra edolstra modified the milestones: nix-2.22, nix-2.23 Apr 23, 2024
@edolstra edolstra removed this from the nix-2.23 milestone Jun 12, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-10-02-nix-team-meeting-minutes-183/53815/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fetchGit can't handle annotated tags
6 participants