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

git-worktree-switcher: init at 0.2.4 #355484

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

jiriks74
Copy link
Contributor

@jiriks74 jiriks74 commented Nov 12, 2024

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Nov 12, 2024
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from ffa0a9f to 51cfaf7 Compare November 12, 2024 18:35
@jiriks74 jiriks74 marked this pull request as draft November 12, 2024 18:38
@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Nov 12, 2024
@jiriks74 jiriks74 marked this pull request as ready for review November 12, 2024 19:31
@jiriks74
Copy link
Contributor Author

I think that all everything should now work as expected. I'll look into doing tests as that's something I am not familiar with.
But I think that the rest can be reviewed.

@jiriks74 jiriks74 changed the title Add git worktree switcher feat(pkgs,nixos/modules/programs): Add git worktree switcher Nov 12, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 labels Nov 13, 2024
@mateusauler
Copy link
Contributor

Awesome! I'm willing to co-maintain the package, if you'd like.

@jiriks74
Copy link
Contributor Author

Awesome! I'm willing to co-maintain the package, if you'd like.

I'll gladly add you if you're in the maintainers file.

@mateusauler
Copy link
Contributor

I'll add myself and open a PR to your fork.

@jiriks74
Copy link
Contributor Author

jiriks74 commented Nov 13, 2024

@mateusauler

I didn't find you in the maintainers file.
I can add you if you fork my changes, follow the README for adding maintainers and make a PR. I cannot add you as when you add a GPG signature to a maintainer the commit has to be signed with the key added.

EDIT: The comment appeared right before I sent this one XD. I'll be looking forward to your PR.

@jiriks74
Copy link
Contributor Author

I just added this package and module to my NixOS config. I had to make a modification to the module though:

diff --git a/modules/nixos/git-worktree-switcher.nix b/modules/nixos/git-worktree-switcher.nix
index f1462ab..490c3a2 100644
--- a/modules/nixos/git-worktree-switcher.nix
+++ b/modules/nixos/git-worktree-switcher.nix
@@ -2,6 +2,7 @@
   config,
   pkgs,
   lib,
+  ...
 }:
 
 let

or I'd get

       error: function 'anonymous lambda' called with unexpected argument 'outputs'
       at /nix/store/qc8rd1yhqd06yjfcnpigkfpnfgmyz2dy-source/modules/nixos/git-worktree-switcher.nix:1:1:
            1| {
             | ^
            2|   config,

So it seems like the missing ... creates an issue with flakes.


Is the no ... requirement only for packages or for modules too? (I understood from the docs to avoid it if possible)

I'll be looking through other modules and adding it back if I see ... being commonly used.

@mateusauler
Copy link
Contributor

Whoops, forgot to format the maintainers section in the package file.

@jiriks74
Copy link
Contributor Author

Whoops, forgot to format the maintainers section in the package file.

I'll take care of it. I'll also add back the ... since I misunderstood the docs and it's kinda needed for the module to work.

@mateusauler
Copy link
Contributor

I'll take care of it.

Thanks.

I'll also add back the ... since I misunderstood the docs and it's kinda needed for the module to work.

I'll test it on my config as well and report any problems other than this one.

@FliegendeWurst
Copy link
Member

Please make sure your commit messages follow the guidelines.

@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch 4 times, most recently from 8fceaad to ca7c8e1 Compare November 13, 2024 18:15
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Nov 15, 2024
@jiriks74 jiriks74 mentioned this pull request Nov 25, 2024
13 tasks
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from 3d30c8d to 24c1a26 Compare November 27, 2024 01:09
Copy link
Contributor

@xanderio xanderio left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

The major thing that doesn't look right to me is the fish config part. I've suggested some changes that should make it work. Could you please tests them :)

nixos/doc/manual/release-notes/rl-2411.section.md Outdated Show resolved Hide resolved
pkgs/by-name/gi/git-worktree-switcher/package.nix Outdated Show resolved Hide resolved
nixos/modules/programs/git-worktree-switcher.nix Outdated Show resolved Hide resolved
nixos/modules/programs/git-worktree-switcher.nix Outdated Show resolved Hide resolved
nixos/modules/programs/git-worktree-switcher.nix Outdated Show resolved Hide resolved
nixos/modules/programs/git-worktree-switcher.nix Outdated Show resolved Hide resolved
nixos/modules/programs/git-worktree-switcher.nix Outdated Show resolved Hide resolved
nixos/modules/programs/git-worktree-switcher.nix Outdated Show resolved Hide resolved
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch 2 times, most recently from e3502a2 to 51fc61b Compare December 5, 2024 02:30
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from 51fc61b to c9e223e Compare December 5, 2024 02:37
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from c9e223e to 8d862fc Compare December 8, 2024 14:17
Copy link
Contributor

@mateusauler mateusauler left a comment

Choose a reason for hiding this comment

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

@jiriks74 FYI, I just released v0.2.4.

pkgs/by-name/gi/git-worktree-switcher/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/gi/git-worktree-switcher/disable-update.patch Outdated Show resolved Hide resolved
pkgs/by-name/gi/git-worktree-switcher/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/gi/git-worktree-switcher/package.nix Outdated Show resolved Hide resolved
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from 8d862fc to 7875c53 Compare December 9, 2024 14:25
@jiriks74 jiriks74 changed the title git-worktree-switcher: init at 0.2.3 git-worktree-switcher: init at 0.2.4 Dec 9, 2024
@jiriks74
Copy link
Contributor Author

jiriks74 commented Dec 9, 2024

Thanks for the notice @mateusauler.

I've simplified the patch to removing only the update calls, not the functions themselves (less potential breakages in the future) and updated the package to 0.2.4.

[`git worktree` documentation](https://git-scm.com/docs/git-worktree)
[`git-worktree-switcher` repository](https://github.com/mateusauler/git-worktree-switcher)

From the project's description:

> Switch between git worktrees with speed.

It's a wrapper script around `git worktree` making some tasks,
like switching between worktrees, easier.

> [!Note]
> `git worktree` is a little known feature and adding QoL things can help
it's adoption as it's a considerable upgrade against the `git stash`
workflow.
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from 7875c53 to e25f4a1 Compare December 10, 2024 02:25
This module sets up shells so that they work with
[git-worktree-switcher](https://github.com/mateusauler/git-worktree-switcher)
@jiriks74 jiriks74 force-pushed the add_git-worktree-switcher branch from e25f4a1 to 3318aa5 Compare December 10, 2024 02:39
@xanderio xanderio added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 10, 2024
@leona-ya leona-ya merged commit 2e5a764 into NixOS:master Dec 11, 2024
39 of 40 checks passed
@jiriks74
Copy link
Contributor Author

@mateusauler You can make a pr and add yourself as a mainteiner now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants