▲ 3 r/git

Split changed line to 2 commits

When I am staging a commit I see some changed lines that should be actually 2 commits. git diff shows old line was changed to new line but I want to add new line in the first commit then in another commit I can remove old line.

I have to do it manually by adding old line back, then git diff shows only new line was added, then I can commit that. Then I delete old line and git diff shows it was removed. Manually works when it's a simple change like that but many lines are involved or lines next to it changed it gets complicated.

I keep commits small to prevent this but it still happens a lot. Does git add in Interactive Mode have a feature to split a changed line into add and remove? Are there other git clients that can handle it?

reddit.com
u/Beautiful-Log5632 — 6 hours ago
▲ 0 r/git

Show new untracked files

I want git diff to include new files that are untracked but there's no way to do it. git add -N is a hack to do it but it breaks stash which I use a lot.

I can try to get a list of new untracked files and add it to git diff output which can solve the problem but git ls-files --exclude-standard --others includes files that are deleted or removed. How can I list only files that are untracked and new like the untracked files in git status?

reddit.com
u/Beautiful-Log5632 — 1 day ago
▲ 0 r/neovim

Using LLM in neovim

I have a openrouter API key and am using it with llm command from python to use it but I don't like it because of bad usability. Do you use any plugin that is good for working with LLM?

I don't mean coding agent that connects to your project. Only something like a chat interface I can ask questions and easily copy and paste text from neovim buffer into the chat buffer.

reddit.com
u/Beautiful-Log5632 — 4 days ago
▲ 2 r/neovim

Lots of ERRORS in LSP logs

There are thousands of lines in my lsp.log file for every LSP that say the same thing about "Cannot find request". Here's an example for lua LSP: "LSP[lua]" "Cannot find request with id 3 whilst attempting to cancel".

I'm using 0.12.3 is there something I can do to stop these errors? Here's an issue for Windows https://github.com/neovim/neovim/issues/36928 but it's happening for me on Linux.

reddit.com
u/Beautiful-Log5632 — 7 days ago

How to test arch install scripts in a VM?

I'm using arch but I want to test if my install script works before reinstalling it. Can I use chroot, VM or systemd-machined to create a fake system and install to it like it's the real system?

Starting from partitioning the disk in that fake system (boot, swap and root partitions), creating filesystems, running arch-chroot, then copying the install scripts into it which will do pacstrap and set up everything.

On the real system I have mounted /files disk that has all the config files that I symlink under /etc. Can I mount it in the VM as /files so the fake system can symlink under its /etc?

reddit.com
u/Beautiful-Log5632 — 8 days ago

Loop with shell command

How do I loop over a list and run a shell command on each list so I can put the output into a file with lineinfile or template or copy? Jinja doesn't let you run shell commands in the template.

reddit.com
u/Beautiful-Log5632 — 18 days ago

uv_python

community.general.uv_python can install python versions but how can I install python packages with uv in ansible? There's no community.general.uv package to do uv tool install PKG.

reddit.com
u/Beautiful-Log5632 — 21 days ago

How to know if template is run in delegate_to?

inventory_hostname_short is supposed to show the delegated name but in delegate_to: localhost it still shows the original hostname. I call the same template task from the original host and from localhost but I can't tell which it is. I want to use a variable in the template to print something different if it's localhost do you know how I can?

reddit.com
u/Beautiful-Log5632 — 22 days ago
▲ 5 r/bash

Get headers for all curl redirects

I can use curl -vL to show the content and headers for every redirect but it's the raw HTTP data. How can I format it better in bash like this?

REQ 1
Content-Type: text/html
Location: /redirect
Status Code: 301
Content-Length: 50
Content: ....

REQ 2
Content-Type: text/plain
Content-Length: 1000
Status Code: 200
Content: ....
reddit.com
u/Beautiful-Log5632 — 28 days ago
▲ 5 r/zsh

Exit shell from vi mode

This exits the shell when there's a partial command when you press CONTROL+D.

exit_zsh() { exit }
zle -N exit_zsh
bindkey '^D' exit_zsh

It works in vi mode when you're in INSERT mode but not in NORMAL mode (press Escape to switch to NORMAL). I have to press i to go back to INSERT mode or CONTROL+C to cancel the command and then CONTROL+D works.

What do I add to the commands so CONTROL+D always exits that shell?

reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 3 r/swaywm

Change borders on some windows

Can I remove titlebars and borders from some windows not all of them? When I change it it applies to all windows.

reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 5 r/swaywm

Hide all scratchpads

How can I hide a scratchpad not toggle it or switch between them? There's no scratchpad hide only scratchpad show.

reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 2 r/zsh

Add a command to the history

How can I add something from a script as the last history item so when I go up in the history it shows that command as the last one? fc -p adds the whole history. I want to add a specific command like fc --add "echo 'add this'".

reddit.com
u/Beautiful-Log5632 — 1 month ago

Validate on a template that includes other files

Can I use validate on a group of template files together such as files that has include to other files like nginx config?

When there's a change to the main file or any of the included files I want to run the validation on the main file after including all the files. If I try to run the validation on the included file it won't work because validation expects the full file not a partial.

After the files are running on the host can I run a linter command from the ansible machine on them? I can't install the linter on the host.

reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 3 r/nginx

Custom error page with "return" in "if"

Why is my custom error page being shown if I use a return inside if?

server {
    root /srv/html;
    if ($scheme != "https") {
        return 400;
    }
    error_page 400 /errorpages/error400.html;
}

This server returns the 400 error which is good but it shows the default error page not the one I set. I want it to load the error page /srv/html/errorpages/error400.html to show with 400 error.

I want to have different if conditions that return different error codes and it should load the right page under /srv/html/errorpages, for example this should load /srv/html/errorpages/error500.html and /srv/html/errorpages/error501.html.

if ($condition = 0) {
      return 500;
}
if ($condition = 1) {
      return 501;
}
reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 3 r/nginx

Which debian repo to use

If I install nginx from the debian repo I get 1.26.3 but from the nginx repo I get version 1.31.1 so I installed the newer version. Are https://nginx.org/packages/mainline/debian/pool/nginx/n/ the only modules I can install that are compatible with that version?

If I install the older version I can install any of the modules in the debian repos which has all of them such as libnginx-mod-http-dav-ext. Is there a way to use the modules from the debian repo with nginx from the nginx repo or do I have to compile them from source? Installing the module doesn't work.

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libnginx-mod-http-dav-ext : Depends: nginx-abi-1.26.3-1
E: Unable to correct problems, you have held broken packages.
E: The following information from --solver 3.0 may provide additional context:
  Unable to satisfy dependencies. Reached two conflicting decisions:
  1. libnginx-mod-http-dav-ext:amd64=1:3.0.0-6 is selected for install
  2. libnginx-mod-http-dav-ext:amd64 Depends nginx-abi-1.26.3-1
      but none of the choices are installable:
      - nginx:amd64=1.26.3-3+deb13u5 is not selected for install
      - nginx:amd64=1.26.3-3+deb13u4 is not selected for install

Would you install the older version and modules from the debian repo or the newer version and compile modules yourself? Or is there another debian repo that has everything new?

reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 10 r/nginx

Do you have http3 working?

Can anyone share an example http3 config that is working for you?

I tried a simple config and it works in curl with --http3-only but in different browsers the network tab shows http2 but they show http3 for https://quic.nginx.org/ so I'm missing something:

Some of the configs come from mozilla SSL generator.

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    listen 443 quic;
    listen [::]:443 quic;
    add_header Alt-Svc: 'h3=":443"' always;
    ssl_certificate /path/to/signed_cert_plus_intermediates;
    ssl_certificate_key /path/to/private_key;
    ssl_protocols TLSv1.3;
    ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;
    ssl_prefer_server_ciphers off;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;
}
reddit.com
u/Beautiful-Log5632 — 1 month ago
▲ 3 r/nginx

Create a default fallback error page

The 500 error page I set with error_page 500 500_error.html is only getting used when I refer to 500 specifically like try_files $uri =500. If there's another problem like rewrite or internal redirection cycle while internally redirecting it uses the default 500 error page that is hard coded in the source.

How can I create an error page that gets used as a fallback when there's no other error block that catches it in any of the server blocks? I don't want to return the hard coded nginx error page in any case.

reddit.com
u/Beautiful-Log5632 — 1 month ago