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

Nix include git untracked files #406

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

jfroche
Copy link
Contributor

@jfroche jfroche commented Nov 14, 2023

Patch Nix so that it doesn't ignore untracked files in git anymore and
continue to ignore files if they are in a .gitignore.

@jfroche jfroche linked an issue Nov 14, 2023 that may be closed by this pull request
Copy link
Contributor

@soenkehahn soenkehahn left a comment

Choose a reason for hiding this comment

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

I think we should have a test (maybe in GarnSpec.hs) that garn behaves this way now. Happy to pair on that.

src/Garn.hs Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@jfroche jfroche force-pushed the feat/include-untracked-files branch 3 times, most recently from 0336ffd to fc25e99 Compare November 20, 2023 23:22
@jfroche jfroche requested a review from soenkehahn November 20, 2023 23:23
patches = (prevAttrs.patches or [ ]) ++ [
(final.fetchpatch {
name = "include-untracked-files.patch";
url = "https://github.com/NixOS/nix/compare/2.17.1...jfroche:nix:feat/include-untracked-files-2.17.1.patch";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have rebased the pull request in the Nix repository. Due to the recent changes in the main branch, specifically the transition to the libgit2 git implementation, the PR can no longer be directly applied with our current Nix version (2.17.1).
To address this, I've initiated a branch to backport the necessary changes for version 2.17.1.

Copy link
Contributor

@alexdavid alexdavid left a comment

Choose a reason for hiding this comment

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

This looks good to me. I think we can also remove the git add --intent-to-add flake.nix call in src/Garn/GarnConfig.hs:192 as well as the FAQ entry on the website at website/src/pages/main.tsx:263-281

@jfroche jfroche force-pushed the feat/include-untracked-files branch from fc25e99 to cd5d761 Compare November 21, 2023 10:24
@jfroche
Copy link
Contributor Author

jfroche commented Nov 21, 2023

We still get the output of the git init during the test, with something like this:

    builds packages in a git repository with untracked files [ ]Initialized empty Git repository in /tmp/nix-shell.P8XVK8/mockery-5db85674c541bbc8/.git/
    builds packages in a git repository with untracked files [✔]

Not sure what would be the best to remove that.

I also see a lot of warning: Git tree '...' is dirty by nix during the tests, would it make sense to run nix with --no-warn-dirty to maybe reduce confusion for new comers ?

@jfroche jfroche force-pushed the feat/include-untracked-files branch 3 times, most recently from c5166f1 to 78187c9 Compare November 21, 2023 23:52
website/src/pages/main.tsx Outdated Show resolved Hide resolved
test/spec/BuildSpec.hs Outdated Show resolved Hide resolved
@jfroche jfroche force-pushed the feat/include-untracked-files branch from 78187c9 to 4b9daad Compare November 22, 2023 01:11
Patch Nix so that it doesn't ignore untracked files in git anymore and
continue to ignore files if they are in a .gitignore.
@jfroche jfroche force-pushed the feat/include-untracked-files branch from 4b9daad to b0a6ae4 Compare November 22, 2023 01:14
@jfroche jfroche merged commit ef0e83a into main Nov 22, 2023
28 checks passed
@jfroche jfroche deleted the feat/include-untracked-files branch November 22, 2023 01:31
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.

Getting rid of nix’s git staging requirements
3 participants