repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Revert "nushell: remove buggy svn completions"

9791263c33e81ec8b4244d1d8b1c62619e93db9b

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

This reverts commit f58cd74e58221aea14edcfa6ef3f439b6339376e.

Changed files (13)

+153 / −278 text lines

NB-00718-WSL.symlinks

Modified

+5 / −5 text lines

8 8 ~/.subversion/config
10 10 subversion/diff
11 -~/.subversion/diff
13 -subversion/diff3
14 -~/.subversion/diff3
11 +~/.local/bin/svn.diff
16 13 subversion/merge
17 -~/.subversion/merge
14 +~/.local/bin/svn.merge
19 16 tools/git-info
20 17 ~/.local/bin/git-info
40 37 nushell/scripts
41 38 ~/.config/nushell/scripts
40 +nushell/completions
41 +~/.config/nushell/completions
43 43 topgrade/topgrade.linux.toml
44 44 ~/.config/topgrade.toml

git/gitconfig

Modified

+10 / −0 text lines

2 2 [user]
3 3 name = Oliver Jan Krylow
4 4 email = oliver@bugabinga.net
6 +[alias]
7 + # `git log` with patches shown with difftastic.
8 + dl = -c diff.external=difft log -p --ext-diff
10 + # Show the most recent commit with difftastic.
11 + ds = -c diff.external=difft show --ext-diff
13 + # `git diff` with difftastic.
14 + dft = -c diff.external=difft diff
6 16 [core]
7 17 editor = nvim
8 18 quotepath = false

nushell/completions/svn-completions.nu

Added
new file mode 100644

+114 / −0 text lines

1 +def "complete svn subcommands" [] {
2 + ^svn help
3 + | lines
4 + | skip until { str starts-with "Available subcommands:" }
5 + | skip 1
6 + | each { str trim }
7 + | take until { is-empty }
8 + | split column " "
9 + | get column1
12 +def "complete svn add paths" [] {
13 + ^svn status --depth infinity
14 + | lines
15 + | parse "{mode} {file}"
16 + | str trim
17 + | where mode == '?'
18 + | get file
21 +def "complete svn revert paths" [] {
22 + ^svn status --depth infinity
23 + | lines
24 + | parse "{mode} {file}"
25 + | where mode == 'M'
26 + | str trim
27 + | get file
30 +def "complete svn depth" [] { ['empty', 'files', 'immediates', 'infinity'] }
32 +def "complete svn changelists" [] {
33 + ^svn status --depth infinity
34 + | lines
35 + | parse "--- Changelist '{changelist}':"
36 + | get --ignore-errors changelist
39 +# FIXME: This is commented out in order to leave unexterne'd commands be.
40 +#
41 +# Subversion is a tool for version control.
42 +# For additional information, see http://subversion.apache.org/
43 +#export extern svn [
44 + #subcommand?: string@"complete svn subcommands" # for help on a specific subcommand.
45 + #--version # to see the program version and RA modules
46 + #--quiet # to see just the version number
47 + #--verbose # to see dependency versions as well
48 +#]
50 +# help (?, h): Describe the usage of this program or its subcommands.
51 +# usage: help [SUBCOMMAND...]
52 +export extern "svn help" [
53 + subcommand?: string@"complete svn subcommands" # for help on a specific subcommand.
54 + --verbose(-v) # also show experimental subcommands and options
57 +# Print the status of working copy files and directories.
58 +export extern "svn status" [
59 + ...paths: path # PATHs
60 + --show-updates(-u) # display update information
61 + --verbose(-v) # print extra information
62 + --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
63 + --revision(-r): string # ARG (some commands also take ARG1:ARG2 range)
64 + --quiet(-q) # don't print unversioned items
65 + --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores
66 + --incremental # give output suitable for concatenation
67 + --xml # output in XML
68 + --ignore-externals # ignore externals definitions
69 + --changelist:string@"complete svn changelists" # operate only on members of changelist ARG
72 +# FIXME: https://github.com/nushell/nushell/issues/5012
73 +# rest parameters do not play well with completions yet
74 +# the `paths` parameter should be `...paths`
76 +# Put new files and directories under version control.
77 +export extern "svn add" [
78 + paths: path@"complete svn add paths" # unversioned PATHs for addition
79 + --targets: path # pass contents of file ARG as additional args
80 + --non-recursive(-N) # obsolete; same as --depth=empty
81 + --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
82 + --quiet(-q) # print nothing, or only summary information
83 + --force # ignore already versioned paths
84 + --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores
85 + --auto-props # enable automatic properties
86 + --no-auto-props # disable automatic properties
87 + --parents # add intermediate parents
90 +# Restore pristine working copy state (undo local changes).
91 +export extern "svn revert" [
92 + paths: path@"complete svn revert paths"
93 + --targets: path # pass contents of file as additional args
94 + --recursive(-R) # descend recursively, same as --depth=infinity
95 + --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
96 + --quiet(-q) # print nothing, or only summary information
97 + --changelist: string@"complete svn changelists" # operate only on members of changelist ARG
98 + --remove-added # reverting an added item will remove it from disk
101 +# FIXME
102 +# SVN uses aliases for subcommands. E.g. `co` for `checkout`.
103 +# How to express that with nu extern commands?
105 +# Check out a working copy from a repository.
106 +export extern "svn checkout" [
107 + ...url_with_rev:string # source
108 + path: path # destination
109 + --revision(-r) # ARG (some commands also take ARG1:ARG2 range)
110 + --quiet(-q) # print nothing, or only summary information
111 + --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
112 + --force # force operation to run
113 + --ignore-externals # ignore externals definitions

nushell/env.nu

Modified

+7 / −0 text lines

70 70 $env.NU_LIB_DIRS = [
71 71 ($nu.default-config-dir | path join 'scripts')
72 + ($nu.default-config-dir | path join 'completions')
74 75 # generate aliases here and now, so that we can apply conditions.
79 80 if not (which zoxide | is-empty) {
80 81 zoxide init nushell | save -f ($nu.default-config-dir | path join 'zoxide.nu')
84 +if not (which carapace | is-empty) {
85 + $env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense' # TODO: figure out sensible bridges
86 + mkdir ~/.cache/carapace
87 + carapace _carapace nushell | save --force ~/.cache/carapace/init.nu

nushell/login.nu

Modified

+7 / −0 text lines

11 11 use fedora_bootstrip.nu
12 12 use notes.nu
14 +use svn-completions.nu *
14 16 if $env.WIN32 {
15 17 use refreshenv.nu *
21 23 # this will fail if zoxide is not installed yet
22 24 source ($nu.default-config-dir | path join "zoxide.nu")
26 +# FIXME: just like the zoxide script, this will fail if carapace is not around
27 +# in both cases an empty file needs to be genereated, if the commands are not in PATH
28 +# so that this source never fails
29 +source ( [$nu.home-path '.cache' 'carapace' 'init.nu'] | path join)
24 31 source ($nu.default-config-dir | path join "scripts/direnv.nu")
26 33 todo commands

subversion/config

Modified

+3 / −3 text lines

51 51 ### Set diff-cmd to the absolute path of your 'diff' program.
52 52 ### This will override the compile-time default, which is to use
53 53 ### Subversion's internal diff implementation.
54 -#diff-cmd = /home/oli/.subversion/diff
54 +diff-cmd = svn.diff
55 55 ### Diff-extensions are arguments passed to an external diff
56 56 ### program or to Subversion's internal diff implementation.
57 57 ### Set diff-extensions to override the default arguments ('-u').
59 59 ### Set diff3-cmd to the absolute path of your 'diff3' program.
60 60 ### This will override the compile-time default, which is to use
61 61 ### Subversion's internal diff3 implementation.
62 -#diff3-cmd = /home/oli/.subversion/diff3
62 +diff3-cmd = svn.diff3
63 63 ### Set diff3-has-program-arg to 'yes' if your 'diff3' program
64 64 ### accepts the '--diff-program' option.
65 65 # diff3-has-program-arg = no
66 66 ### Set merge-tool-cmd to the command used to invoke your external
67 67 ### merging tool of choice. Subversion will pass 5 arguments to
68 68 ### the specified command: base theirs mine merged wcfile
69 -#merge-tool-cmd = /home/oli/.subversion/merge
69 +merge-tool-cmd = svn.merge
71 71 ### Section for configuring tunnel agents.
72 72 [tunnels]

subversion/config.win32

Deleted
deleted file mode 100644

+0 / −184 text lines

1 -### This file configures various client-side behaviors.
2 -###
3 -### The commented-out examples below are intended to demonstrate
4 -### how to use this file.
6 -### Section for authentication and authorization customizations.
7 -[auth]
8 -### Set password stores used by Subversion. They should be
9 -### delimited by spaces or commas. The order of values determines
10 -### the order in which password stores are used.
11 -### Valid password stores:
12 -### gnome-keyring (Unix-like systems)
13 -### kwallet (Unix-like systems)
14 -### gpg-agent (Unix-like systems)
15 -### keychain (Mac OS X)
16 -### windows-cryptoapi (Windows)
17 -# password-stores = gpg-agent,gnome-keyring,kwallet
18 -### To disable all password stores, use an empty list:
19 -# password-stores =
20 -###
21 -### Set KWallet wallet used by Subversion. If empty or unset,
22 -### then the default network wallet will be used.
23 -# kwallet-wallet =
24 -###
25 -### Include PID (Process ID) in Subversion application name when
26 -### using KWallet. It defaults to 'no'.
27 -# kwallet-svn-application-name-with-pid = yes
28 -###
29 -### Set ssl-client-cert-file-prompt to 'yes' to cause the client
30 -### to prompt for a path to a client cert file when the server
31 -### requests a client cert but no client cert file is found in the
32 -### expected place (see the 'ssl-client-cert-file' option in the
33 -### 'servers' configuration file). Defaults to 'no'.
34 -# ssl-client-cert-file-prompt = no
35 -###
36 -### The rest of the [auth] section in this file has been deprecated.
37 -### Both 'store-passwords' and 'store-auth-creds' can now be
38 -### specified in the 'servers' file in your config directory
39 -### and are documented there. Anything specified in this section
40 -### is overridden by settings specified in the 'servers' file.
41 -# store-passwords = no
42 -# store-auth-creds = no
44 -### Section for configuring external helper applications.
45 -[helpers]
46 -### Set editor-cmd to the command used to invoke your text editor.
47 -### This will override the environment variables that Subversion
48 -### examines by default to find this information ($EDITOR,
49 -### et al).
50 -editor-cmd = nvim
51 -### Set diff-cmd to the absolute path of your 'diff' program.
52 -### This will override the compile-time default, which is to use
53 -### Subversion's internal diff implementation.
54 -#diff-cmd = C:/Users/okr/AppData/Roaming/Subversion/diff.bat
55 -### Diff-extensions are arguments passed to an external diff
56 -### program or to Subversion's internal diff implementation.
57 -### Set diff-extensions to override the default arguments ('-u').
58 -# diff-extensions =
59 -### Set diff3-cmd to the absolute path of your 'diff3' program.
60 -### This will override the compile-time default, which is to use
61 -### Subversion's internal diff3 implementation.
62 -#diff3-cmd = C:/Users/okr/AppData/Roaming/Subversion/diff3.bat
63 -### Set diff3-has-program-arg to 'yes' if your 'diff3' program
64 -### accepts the '--diff-program' option.
65 -# diff3-has-program-arg = no
66 -### Set merge-tool-cmd to the command used to invoke your external
67 -### merging tool of choice. Subversion will pass 5 arguments to
68 -### the specified command: base theirs mine merged wcfile
69 -#merge-tool-cmd = C:/Users/okr/AppData/Roaming/Subversion/merge.bat
71 -### Section for configuring tunnel agents.
72 -[tunnels]
73 -### Configure svn protocol tunnel schemes here. By default, only
74 -### the 'ssh' scheme is defined. You can define other schemes to
75 -### be used with 'svn+scheme://hostname/path' URLs. A scheme
76 -### definition is simply a command, optionally prefixed by an
77 -### environment variable name which can override the command if it
78 -### is defined. The command (or environment variable) may contain
79 -### arguments, using standard shell quoting for arguments with
80 -### spaces. The command will be invoked as:
81 -### <command> <hostname> svnserve -t
82 -### (If the URL includes a username, then the hostname will be
83 -### passed to the tunnel agent as <user>@<hostname>.) If the
84 -### built-in ssh scheme were not predefined, it could be defined
85 -### as:
86 -# ssh = $SVN_SSH ssh -q -o ControlMaster=no --
87 -### If you wanted to define a new 'rsh' scheme, to be used with
88 -### 'svn+rsh:' URLs, you could do so as follows:
89 -# rsh = rsh --
90 -### Or, if you wanted to specify a full path and arguments:
91 -# rsh = /path/to/rsh -l myusername --
92 -### On Windows, if you are specifying a full path to a command,
93 -### use a forward slash (/) or a paired backslash (\\) as the
94 -### path separator. A single backslash will be treated as an
95 -### escape for the following character.
97 -### Section for configuring miscellaneous Subversion options.
98 -[miscellany]
99 -### Set global-ignores to a set of whitespace-delimited globs
100 -### which Subversion will ignore in its 'status' output, and
101 -### while importing or adding files and directories.
102 -### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
103 -# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__
104 -# *.rej *~ #*# .#* .*.swp .DS_Store [Tt]humbs.db
105 -### Set log-encoding to the default encoding for log messages
106 -# log-encoding = latin1
107 -### Set use-commit-times to make checkout/update/switch/revert
108 -### put last-committed timestamps on every file touched.
109 -# use-commit-times = yes
110 -### Set no-unlock to prevent 'svn commit' from automatically
111 -### releasing locks on files.
112 -# no-unlock = yes
113 -### Set mime-types-file to a MIME type registry file, used to
114 -### provide hints to Subversion's MIME type auto-detection
115 -### algorithm.
116 -# mime-types-file = /path/to/mime.types
117 -### Set preserved-conflict-file-exts to a whitespace-delimited
118 -### list of patterns matching file extensions which should be
119 -### preserved in generated conflict file names. By default,
120 -### conflict files use custom extensions.
121 -# preserved-conflict-file-exts = doc ppt xls od?
122 -### Set enable-auto-props to 'yes' to enable automatic properties
123 -### for 'svn add' and 'svn import', it defaults to 'no'.
124 -### Automatic properties are defined in the section 'auto-props'.
125 -# enable-auto-props = yes
126 -### Set interactive-conflicts to 'no' to disable interactive
127 -### conflict resolution prompting. It defaults to 'yes'.
128 -# interactive-conflicts = no
129 -### Set memory-cache-size to define the size of the memory cache
130 -### used by the client when accessing a FSFS repository via
131 -### ra_local (the file:// scheme). The value represents the number
132 -### of MB used by the cache.
133 -# memory-cache-size = 16
134 -### Set diff-ignore-content-type to 'yes' to cause 'svn diff' to
135 -### attempt to show differences of all modified files regardless
136 -### of their MIME content type. By default, Subversion will only
137 -### attempt to show differences for files believed to have human-
138 -### readable (non-binary) content. This option is especially
139 -### useful when Subversion is configured (via the 'diff-cmd'
140 -### option) to employ an external differencing tool which is able
141 -### to show meaningful differences for binary file formats. [New
142 -### in 1.9]
143 -# diff-ignore-content-type = no
145 -### Section for configuring automatic properties.
146 -[auto-props]
147 -### The format of the entries is:
148 -### file-name-pattern = propname[=value][;propname[=value]...]
149 -### The file-name-pattern can contain wildcards (such as '*' and
150 -### '?'). All entries which match (case-insensitively) will be
151 -### applied to the file. Note that auto-props functionality
152 -### must be enabled, which is typically done by setting the
153 -### 'enable-auto-props' option.
154 -# *.c = svn:eol-style=native
155 -# *.cpp = svn:eol-style=native
156 -# *.h = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
157 -# *.dsp = svn:eol-style=CRLF
158 -# *.dsw = svn:eol-style=CRLF
159 -# *.sh = svn:eol-style=native;svn:executable
160 -# *.txt = svn:eol-style=native;svn:keywords=Author Date Id Rev URL;
161 -# *.png = svn:mime-type=image/png
162 -# *.jpg = svn:mime-type=image/jpeg
163 -# Makefile = svn:eol-style=native
165 -### Section for configuring working copies.
166 -[working-copy]
167 -### Set to a list of the names of specific clients that should use
168 -### exclusive SQLite locking of working copies. This increases the
169 -### performance of the client but prevents concurrent access by
170 -### other clients. Third-party clients may also support this
171 -### option.
172 -### Possible values:
173 -### svn (the command line client)
174 -# exclusive-locking-clients =
175 -### Set to true to enable exclusive SQLite locking of working
176 -### copies by all clients using the 1.8 APIs. Enabling this may
177 -### cause some clients to fail to work properly. This does not have
178 -### to be set for exclusive-locking-clients to work.
179 -# exclusive-locking = false
180 -### Set the SQLite busy timeout in milliseconds: the maximum time
181 -### the client waits to get access to the SQLite database before
182 -### returning an error. The default is 10000, i.e. 10 seconds.
183 -### Longer values may be useful when exclusive locking is enabled.
184 -# busy-timeout = 10000

subversion/diff

Modified

+1 / −1 text lines

1 -#!/usr/bin/java --source 17
1 +#!/usr/bin/java --source 17 -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xms32m -Xmx32m -XX:+AlwaysPreTouch -Xshare:on
3 3 import static java.lang.System.* ;
4 4 import java.util.*;

subversion/diff.bat

Deleted
deleted file mode 100644

+0 / −2 text lines

1 -@echo off
2 -java --source 17 %~dp0/diff %*

subversion/diff3

Deleted
deleted file mode 100755

+0 / −74 text lines

1 -#!/usr/bin/java --source 17
3 -import static java.lang.System.* ;
4 -import java.util.*;
6 -class diff3 {
7 - public static void main(String[] command_line_arguments) throws Throwable
8 - {
9 - if(command_line_arguments.length != 9)
10 - throw fail("svn diff3 was supposed to give us 9 arguments. did the interface change? we got %s arguments.", command_line_arguments.length);
12 - //some old gnudiff flag, which meld ignores
13 - var ignored_unified_flag = command_line_arguments[0];
15 - if(!ignored_unified_flag.equals("-u"))
16 - throw fail("the first argument should be the `-u` flag, which meld will ignore, but was %s.", ignored_unified_flag);
18 - var left_label_flag = command_line_arguments[1];
19 - var left_label = command_line_arguments[2];
20 - var right_label_flag = command_line_arguments[3];
21 - var right_label = command_line_arguments[4];
23 - if(!(left_label_flag.equals("-L") && right_label_flag.equals("-L")))
24 - throw fail("flags for the labes should have been `-L`, but were %s and %s.", left_label_flag, right_label_flag);
26 - var left_file = command_line_arguments[5];
27 - var right_file = command_line_arguments[6];
29 - out.printf("%s --label '%s' '%s' --label '%s' '%s'%n", emphasize_global("meld"), left_label, left_file, right_label, right_file);
30 - throw fail("not yet");
31 - // var code = call("meld","--auto-merge", "--label", left_label, left_file, "--label", right_label, right_file);
32 - // throw exit(code);
33 - }
35 - static int call( String... command) throws Exception
36 - {
37 - return new ProcessBuilder()
38 - .command(command)
39 - .inheritIO()
40 - .start()
41 - .onExit()
42 - .join()
43 - .exitValue();
44 - }
46 - static Throwable exit(int code) {
47 - System.exit(code);
48 - //abuse control flow to make compiler realize `exit` will never return
49 - return new Throwable();
50 - }
52 - static String emphasize_global(String message) {
53 - return "\033[4m" + message + "\033[0m";
54 - }
56 - static String emphasize_local(String message) {
57 - return "\033[3m" + message + "\033[0m";
58 - }
60 - static Throwable fail(String message, Object... arguments) {
61 - out.printf(message, arguments);
62 - System.exit(1);
63 - //abuse control flow to make compiler realize `exit` will never return
64 - return new Throwable();
65 - }
67 - static Throwable fail() {
68 - System.exit(1);
69 - //abuse control flow to make compiler realize `exit` will never return
70 - return new Throwable();
71 - }
72 -}
74 -// vim:ft=java

subversion/diff3.bat

Deleted
deleted file mode 100644

+0 / −2 text lines

1 -@echo off
2 -java --source 17 %~dp0/diff3 %*

subversion/merge

Modified

+6 / −5 text lines

15 15 var merged_file = command_line_arguments[3];
16 16 var wcpath_file = command_line_arguments[4];
18 - var code = call("meld", "--label", "Mine", mine_file, "--label", "WC", wcpath_file, "--label", "Theirs", theirs_file, "--output", merged_file);
19 - throw exit(code);
18 + //TODO: use neovide, once my WSL can du GUI
19 + var code = call("nvim", "-d", wcpath_file, merged_file, theirs_file );
20 + throw exit(code);
22 23 static int call( String... command) throws Exception
33 34 static Throwable exit(int code) {
34 35 System.exit(code);
35 36 //abuse control flow to make compiler realize `exit` will never return
36 - return new Throwable();
37 + return new Throwable();
39 40 static String emphasize_global(String message) {
48 49 out.printf(message, arguments);
49 50 System.exit(1);
50 51 //abuse control flow to make compiler realize `exit` will never return
51 - return new Throwable();
52 + return new Throwable();
54 55 static Throwable fail() {
55 56 System.exit(1);
56 57 //abuse control flow to make compiler realize `exit` will never return
57 - return new Throwable();
58 + return new Throwable();
60 61 // vim:ft=java

subversion/merge.bat

Deleted
deleted file mode 100644

+0 / −2 text lines

1 -@echo off
2 -java --source 17 %~dp0/merge %*