From 4aec6b9ba33c31463e9f162e664cf22f09506e4a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 18 Sep 2024 17:25:12 +0200 Subject: [PATCH 1/6] vcs: Rename from git to support multiple vcs --- .dotter/global.toml | 8 ++++---- {git => vcs}/.config/git/config | 0 {git => vcs}/.config/git/ignore | 0 {git => vcs}/.config/sh/alias.d/git.sh | 0 {git => vcs}/.config/zsh/completions/_gitignore | 0 {git => vcs}/.local/bin/gitignore | 0 {git => vcs}/README.md | 0 7 files changed, 4 insertions(+), 4 deletions(-) rename {git => vcs}/.config/git/config (100%) rename {git => vcs}/.config/git/ignore (100%) rename {git => vcs}/.config/sh/alias.d/git.sh (100%) rename {git => vcs}/.config/zsh/completions/_gitignore (100%) rename {git => vcs}/.local/bin/gitignore (100%) rename {git => vcs}/README.md (100%) diff --git a/.dotter/global.toml b/.dotter/global.toml index 22633cd..0c4ad8a 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -4,7 +4,7 @@ # a development environment based on git and nvim. [base] -depends = ["shell", "git", "nvim", "scripts", "ssh", "terminal", "bootstrap"] +depends = ["shell", "vcs", "nvim", "scripts", "ssh", "terminal", "bootstrap"] [bootstrap.files] "bootstrap/dotlink.sh" = "~/.config/sh/alias.d/dotlink.sh" @@ -13,9 +13,9 @@ depends = ["shell", "git", "nvim", "scripts", "ssh", "terminal", "bootstrap"] "sh/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } sh = "~" -[git.files] -"git/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } -git = "~" +[vcs.files] +"vcs/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } +vcs = "~" [nvim.files] "nvim/.config/nvim/spell/de.utf-8.add.spl" = { target = "~/.config/nvim/spell/de.utf-8.add.spl", type = "symbolic" } diff --git a/git/.config/git/config b/vcs/.config/git/config similarity index 100% rename from git/.config/git/config rename to vcs/.config/git/config diff --git a/git/.config/git/ignore b/vcs/.config/git/ignore similarity index 100% rename from git/.config/git/ignore rename to vcs/.config/git/ignore diff --git a/git/.config/sh/alias.d/git.sh b/vcs/.config/sh/alias.d/git.sh similarity index 100% rename from git/.config/sh/alias.d/git.sh rename to vcs/.config/sh/alias.d/git.sh diff --git a/git/.config/zsh/completions/_gitignore b/vcs/.config/zsh/completions/_gitignore similarity index 100% rename from git/.config/zsh/completions/_gitignore rename to vcs/.config/zsh/completions/_gitignore diff --git a/git/.local/bin/gitignore b/vcs/.local/bin/gitignore similarity index 100% rename from git/.local/bin/gitignore rename to vcs/.local/bin/gitignore diff --git a/git/README.md b/vcs/README.md similarity index 100% rename from git/README.md rename to vcs/README.md From 0b6f0c235d1e87c50aa4c93e4fc73328d909dfe5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 18 Sep 2024 17:28:13 +0200 Subject: [PATCH 2/6] vcs: Add jujutsu config file --- vcs/.config/jj/config.toml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 vcs/.config/jj/config.toml diff --git a/vcs/.config/jj/config.toml b/vcs/.config/jj/config.toml new file mode 100644 index 0000000..ca7ec70 --- /dev/null +++ b/vcs/.config/jj/config.toml @@ -0,0 +1,8 @@ +[user] +email = "marty.oehme@gmail.com" +name = "Marty Oehme" + +[signing] +sign-all = true +backend = "gpg" +key = "73BA40D5AFAF49C9" From bcd93eb237ce704873e15b46245f9f8466a27b0e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 18 Sep 2024 17:38:44 +0200 Subject: [PATCH 3/6] vcs: Restructure vcs module Just like writing and qutebrowser modules, restructured the version control software module to make more use of dotter's ability to precisely link files. All contained programs have a top-level directory and all the files that correspond to that specific software lie beneath in the directory tree. --- .dotter/global.toml | 4 ++++ vcs/README.md | 8 +++++--- vcs/{.config => git}/git/config | 0 vcs/{.config => git}/git/ignore | 0 vcs/{.config => git}/sh/alias.d/git.sh | 0 .../config}/zsh/completions/_gitignore | 0 vcs/{.local => gitignore/local}/bin/gitignore | 0 vcs/{.config => }/jj/config.toml | 0 8 files changed, 9 insertions(+), 3 deletions(-) rename vcs/{.config => git}/git/config (100%) rename vcs/{.config => git}/git/ignore (100%) rename vcs/{.config => git}/sh/alias.d/git.sh (100%) rename vcs/{.config => gitignore/config}/zsh/completions/_gitignore (100%) rename vcs/{.local => gitignore/local}/bin/gitignore (100%) rename vcs/{.config => }/jj/config.toml (100%) diff --git a/.dotter/global.toml b/.dotter/global.toml index 0c4ad8a..c6294a9 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -15,6 +15,10 @@ sh = "~" [vcs.files] "vcs/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } +"vcs/git" = "~/.config" +"vcs/jj" = "~/.config/jj" +"vcs/gitignore/config" = "~/.config" +"vcs/gitignore/local" = "~/.local" vcs = "~" [nvim.files] diff --git a/vcs/README.md b/vcs/README.md index 1c38319..6315168 100644 --- a/vcs/README.md +++ b/vcs/README.md @@ -1,15 +1,17 @@ -# Git module +# Version control software module [git](https://git-scm.com/) - a distributed version control system +[jujutsu](https://martinvonz.github.io/jj/latest/) - a change-based version control system ## What's in this module [[_TOC_]] -## Global git settings +## Global vcs settings -This is probably the first thing that needs to be customized, since it points to a different identity for each git user. +This are probably the first things that need to be customized, since it points to a different identity for each git user. I sign all my commits by default, so take out the corresponding lines if you don't, or exchange it with your gpg key. +Similarly for jujutsu, change the identity and remove the lines concerning gpg signing if you don't use it. Git will rewrite any remotes using http(s) to use the ssh notation for pushes to github and gitlab so that, even if you set up the repository using an https url you can utilize your usual ssh key for pushing. diff --git a/vcs/.config/git/config b/vcs/git/git/config similarity index 100% rename from vcs/.config/git/config rename to vcs/git/git/config diff --git a/vcs/.config/git/ignore b/vcs/git/git/ignore similarity index 100% rename from vcs/.config/git/ignore rename to vcs/git/git/ignore diff --git a/vcs/.config/sh/alias.d/git.sh b/vcs/git/sh/alias.d/git.sh similarity index 100% rename from vcs/.config/sh/alias.d/git.sh rename to vcs/git/sh/alias.d/git.sh diff --git a/vcs/.config/zsh/completions/_gitignore b/vcs/gitignore/config/zsh/completions/_gitignore similarity index 100% rename from vcs/.config/zsh/completions/_gitignore rename to vcs/gitignore/config/zsh/completions/_gitignore diff --git a/vcs/.local/bin/gitignore b/vcs/gitignore/local/bin/gitignore similarity index 100% rename from vcs/.local/bin/gitignore rename to vcs/gitignore/local/bin/gitignore diff --git a/vcs/.config/jj/config.toml b/vcs/jj/config.toml similarity index 100% rename from vcs/.config/jj/config.toml rename to vcs/jj/config.toml From bfb4fadee0bac175a965df90dd033e74fc60b05d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 18 Sep 2024 17:46:05 +0200 Subject: [PATCH 4/6] vcs: Add aliases for jj --- .dotter/global.toml | 2 +- vcs/jj/{ => jj}/config.toml | 0 vcs/jj/sh/alias.d/jj.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) rename vcs/jj/{ => jj}/config.toml (100%) create mode 100644 vcs/jj/sh/alias.d/jj.sh diff --git a/.dotter/global.toml b/.dotter/global.toml index c6294a9..504b5b7 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -16,7 +16,7 @@ sh = "~" [vcs.files] "vcs/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } "vcs/git" = "~/.config" -"vcs/jj" = "~/.config/jj" +"vcs/jj" = "~/.config" "vcs/gitignore/config" = "~/.config" "vcs/gitignore/local" = "~/.local" vcs = "~" diff --git a/vcs/jj/config.toml b/vcs/jj/jj/config.toml similarity index 100% rename from vcs/jj/config.toml rename to vcs/jj/jj/config.toml diff --git a/vcs/jj/sh/alias.d/jj.sh b/vcs/jj/sh/alias.d/jj.sh new file mode 100644 index 0000000..ed69305 --- /dev/null +++ b/vcs/jj/sh/alias.d/jj.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +if ! exist jj; then + return 1 +fi + +alias j='jj' # necessary for a thing as easy to type? +if exist lazyjj; then + alias lj="lazyjj" +fi +alias js="jj status" + +alias jd="jj describe" +alias jn="jj new" +alias jc="jj commit" + +alias jl='jj log' +alias jlo='jj log --summary' +alias jloo='jj log --patch' +alias jo="jj op log" + +alias jss="jj squash" +alias jsi="jj squash --interactive" + +alias je="jj edit" +alias jee="jj next --edit" + +alias jun="jj undo" + +alias jp="jj git push" From 11d6a08bcc64e40385a8866cc4be72b5a5517d2b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 19 Sep 2024 10:07:32 +0200 Subject: [PATCH 5/6] vcs: Set default diff editor Using neovim 'hunk.nvim' plugin --- vcs/jj/jj/config.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcs/jj/jj/config.toml b/vcs/jj/jj/config.toml index ca7ec70..603c3b2 100644 --- a/vcs/jj/jj/config.toml +++ b/vcs/jj/jj/config.toml @@ -6,3 +6,7 @@ name = "Marty Oehme" sign-all = true backend = "gpg" key = "73BA40D5AFAF49C9" + +[ui] +default-command = "log" +diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] From b3124eb582761eb6cabce38ff2c0efd058008fc9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 19 Sep 2024 10:07:57 +0200 Subject: [PATCH 6/6] nvim: Change nvim tree to neotree plugin --- nvim/.config/nvim/lua/plugins/pickers.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/pickers.lua b/nvim/.config/nvim/lua/plugins/pickers.lua index 7637b6d..c8d1053 100644 --- a/nvim/.config/nvim/lua/plugins/pickers.lua +++ b/nvim/.config/nvim/lua/plugins/pickers.lua @@ -15,13 +15,20 @@ return { event = { "BufEnter" }, }, -- integrate file manager { - "nvim-tree/nvim-tree.lua", -- integrate file tree - config = true, - dependencies = { "nvim-tree/nvim-web-devicons", config = true }, - cmd = "NvimTreeToggle", - keys = { - { "se", "NvimTreeToggle", desc = "filetree", silent = true }, + "nvim-neo-tree/neo-tree.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + { "nvim-tree/nvim-web-devicons", optional = true }, }, + cmd = "Neotree", + opts = { + source_selector = { winbar = true }, + }, + keys = { + { "se", "Neotree toggle left", desc = "filetree", silent = true }, + }, + lazy = false }, { "MagicDuck/grug-far.nvim", lazy = false, opts = {} }, -- fuzzy matching picker