GIT_WORK_TREE and GIT_DIR env variables populated when using NVIM_APPNAME and git bare repo #144
Replies: 1 comment
-
No not intentional or expected. Hotpot has no awareness of git or work trees or anything. I have vague memory of discussion around It's not rocks.nvim or something else? Does it still occur if you just install hotpot manually to via the Are you sure they're not supposed to be populated when you're inside a dir in a worktree x bare-repo? They look reasonable to me. If you can provide me instructions to duplicate your setup I might be able to take a look, but as is, I cant figure how hotpot would cause this besides a side effect of interacting with nvim/uv file functions. |
Beta Was this translation helpful? Give feedback.
-
Trying to track down a tricky issue that arose when using hotpot and having a bare repo home directory.
Essentially, AFAICT, when starting neovim using NVIM_APPNAME from within the designated config directory (i.e.
~/config/$NVIM_APPNAME
) it appears that the environment variables for GIT_WORK_TREE and GIT_DIR are added to the environment variables available from within nvim.For instance here's the output of `vim.uv.os_environ()` when starting neovim from my homedir (i.e `~ $ NVIM_APPNAME=hotrocks nvim`):
{
ATUIN_HISTORY_ID = "0192a7f6af8777d6bba8e6a32d0aeb15",
ATUIN_SESSION = "0192a7b51e1f73ac89186bc1a7f11eb1",
AURDEST = "/pkg/aur/aurutils/sync",
CHROOT = "/home/ghost/chroot",
COLORTERM = "truecolor",
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus",
DEBUGINFOD_URLS = "https://debuginfod.archlinux.org ",
DELTA_PAGER = "less",
DESKTOP_SESSION = "gnome",
DISPLAY = ":0",
EDITOR = "/usr/bin/nvim",
FZF_DEFAULT_OPTS = '\n --color=fg:-1,fg+:#41c7b9,bg:-1,bg+:#184956\n --color=hl:#5f87af,hl+:#75b938,info:#afaf87,marker:#fa5750\n --color=prompt:#00d624,spinner:#af88eb,pointer:#bd96fa,header:#87afaf\n --color=border:#103c48,label:#aeaeae,query:#d9d9d9\n --border="rounded" --border-label="" --preview-window="border-rounded" --prompt="> "\n --marker=">" --pointer="◆" --separator="─" --scrollbar="│"\n --color=fg:-1,fg+:#41c7b9,bg:-1,bg+:#184956\n --color=hl:#5f87af,hl+:#75b938,info:#afaf87,marker:#fa5750\n --color=prompt:#00d624,spinner:#af88eb,pointer:#bd96fa,header:#87afaf\n --color=border:#103c48,label:#aeaeae,query:#d9d9d9\n --border="rounded" --border-label="" --preview-window="border-rounded" --prompt="> "\n --marker=">" --pointer="◆" --separator="─" --scrollbar="│"\n --color=fg:-1,fg+:#41c7b9,bg:-1,bg+:#184956\n --color=hl:#5f87af,hl+:#75b938,info:#afaf87,marker:#fa5750\n --color=prompt:#00d624,spinner:#af88eb,pointer:#bd96fa,header:#87afaf\n --color=border:#103c48,label:#aeaeae,query:#d9d9d9\n --border="rounded" --border-label="" --preview-window="border-rounded" --prompt="> "\n --marker=">" --pointer="◆" --separator="─" --scrollbar="│"',
GDMSESSION = "gnome",
GDM_LANG = "en_US.UTF-8",
GEM_HOME = "/home/ghost/.local/share/gem/ruby/3.3.0",
GIO_LAUNCHED_DESKTOP_FILE = "/usr/share/applications/org.codeberg.dnkl.foot.desktop",
GIO_LAUNCHED_DESKTOP_FILE_PID = "6092",
GJS_DEBUG_OUTPUT = "stderr",
GJS_DEBUG_TOPICS = "JS ERROR;JS LOG",
GNOME_SETUP_DISPLAY = ":1",
HG = "/usr/bin/hg",
HOME = "/home/ghost",
INVOCATION_ID = "385f429ce23a4d3585d5a7fedace0318",
JOURNAL_STREAM = "9:11340",
LANG = "en_US.UTF-8",
LIBVA_DRIVERS_PATH = "/usr/lib/dri",
LIBVA_DRIVER_NAME = "iHD",
LOGNAME = "ghost",
LUAROCKS_CONFIG = "/home/ghost/.local/share/hotrocks/rocks/luarocks-config.lua",
MAIL = "/var/spool/mail/ghost",
MANAGERPID = "1261",
MANPAGER = "/usr/bin/nvimpager",
MANWIDTH = "999",
MEMORY_PRESSURE_WATCH = "/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/session.slice/[email protected]/memory.pressure",
MEMORY_PRESSURE_WRITE = "c29tZSAyMDAwMDAgMjAwMDAwMAA=",
MOTD_SHOWN = "pam",
MOZ_ENABLE_WAYLAND = "1",
MYVIMRC = "/home/ghost/.config/hotrocks/init.lua",
NVIM_APPNAME = "hotrocks",
NVIM_LOG_FILE = "/home/ghost/.local/state/hotrocks/log",
OLDPWD = "/home/ghost/.config/hotrocks",
PAGER = "/usr/bin/nvimpager",
PATH = "/home/ghost/.local/share/hotrocks/rocks/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/ghost/.local/bin:/home/ghost/.local/bin/scripts:/home/ghost/.node_modules/bin:/home/ghost/go/bin:/home/ghost/.cargo/bin:/home/ghost/.local/share/gem/ruby/3.3.0/bin",
PWD = "/home/ghost",
QT_QPA_PLATFORM = "wayland",
RIPGREP_CONFIG_PATH = "/home/ghost/.config/rg/.ripgreprc",
SESSION_MANAGER = "local/lap:@/tmp/.ICE-unix/1358,unix/lap:/tmp/.ICE-unix/1358",
SHELL = "/usr/bin/zsh",
SHLVL = "2",
SKIM_DEFAULT_COMMAND = "/usr/bin/rg --files --hidden --no-require-git",
SSH_AUTH_SOCK = "/run/user/1000/ssh-agent.socket",
SYSTEMD_EXEC_PID = "1380",
TERM = "foot-extra-git",
USER = "ghost",
USERNAME = "ghost",
VIMRUNTIME = "/usr/share/nvim/runtime",
WAYLAND_DISPLAY = "wayland-0",
XAUTHORITY = "/run/user/1000/.mutter-Xwaylandauth.NJI0V2",
XDG_CONFIG_HOME = "/home/ghost/.config",
XDG_CURRENT_DESKTOP = "GNOME",
XDG_DATA_DIRS = "/home/ghost/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/",
XDG_MENU_PREFIX = "gnome-",
XDG_RUNTIME_DIR = "/run/user/1000",
XDG_SESSION_CLASS = "user",
XDG_SESSION_DESKTOP = "gnome",
XDG_SESSION_TYPE = "wayland",
ZELLIJ = "0",
ZELLIJ_PANE_ID = "5",
ZELLIJ_SESSION_NAME = "joyous-crab",
_ = "/usr/bin/nvim",
npm_config_prefix = "/home/ghost/.node_modules"
}
and here's the same output when starting nvim from the ~/.config/hotrocks directory (i.e. `~/.config/hotrocks $ NVIM_APPNAME=hotrocks nvim`) - Notice now the presence of GIT_DIR and GIT_WORK_TREE.:
{
ATUIN_HISTORY_ID = "0192a7fbb7da74848ec4f4f8883531f8",
ATUIN_SESSION = "0192a7b51e1f73ac89186bc1a7f11eb1",
AURDEST = "/pkg/aur/aurutils/sync",
CHROOT = "/home/ghost/chroot",
COLORTERM = "truecolor",
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus",
DEBUGINFOD_URLS = "https://debuginfod.archlinux.org ",
DELTA_PAGER = "less",
DESKTOP_SESSION = "gnome",
DISPLAY = ":0",
EDITOR = "/usr/bin/nvim",
FZF_DEFAULT_OPTS = '\n --color=fg:-1,fg+:#41c7b9,bg:-1,bg+:#184956\n --color=hl:#5f87af,hl+:#75b938,info:#afaf87,marker:#fa5750\n --color=prompt:#00d624,spinner:#af88eb,pointer:#bd96fa,header:#87afaf\n --color=border:#103c48,label:#aeaeae,query:#d9d9d9\n --border="rounded" --border-label="" --preview-window="border-rounded" --prompt="> "\n --marker=">" --pointer="◆" --separator="─" --scrollbar="│"\n --color=fg:-1,fg+:#41c7b9,bg:-1,bg+:#184956\n --color=hl:#5f87af,hl+:#75b938,info:#afaf87,marker:#fa5750\n --color=prompt:#00d624,spinner:#af88eb,pointer:#bd96fa,header:#87afaf\n --color=border:#103c48,label:#aeaeae,query:#d9d9d9\n --border="rounded" --border-label="" --preview-window="border-rounded" --prompt="> "\n --marker=">" --pointer="◆" --separator="─" --scrollbar="│"\n --color=fg:-1,fg+:#41c7b9,bg:-1,bg+:#184956\n --color=hl:#5f87af,hl+:#75b938,info:#afaf87,marker:#fa5750\n --color=prompt:#00d624,spinner:#af88eb,pointer:#bd96fa,header:#87afaf\n --color=border:#103c48,label:#aeaeae,query:#d9d9d9\n --border="rounded" --border-label="" --preview-window="border-rounded" --prompt="> "\n --marker=">" --pointer="◆" --separator="─" --scrollbar="│"',
GDMSESSION = "gnome",
GDM_LANG = "en_US.UTF-8",
GEM_HOME = "/home/ghost/.local/share/gem/ruby/3.3.0",
GIO_LAUNCHED_DESKTOP_FILE = "/usr/share/applications/org.codeberg.dnkl.foot.desktop",
GIO_LAUNCHED_DESKTOP_FILE_PID = "6092",
GIT_DIR = "/home/ghost/.config/dotz",
GIT_WORK_TREE = "/home/ghost",
GJS_DEBUG_OUTPUT = "stderr",
GJS_DEBUG_TOPICS = "JS ERROR;JS LOG",
GNOME_SETUP_DISPLAY = ":1",
HG = "/usr/bin/hg",
HOME = "/home/ghost",
INVOCATION_ID = "385f429ce23a4d3585d5a7fedace0318",
JOURNAL_STREAM = "9:11340",
LANG = "en_US.UTF-8",
LIBVA_DRIVERS_PATH = "/usr/lib/dri",
LIBVA_DRIVER_NAME = "iHD",
LOGNAME = "ghost",
LUAROCKS_CONFIG = "/home/ghost/.local/share/hotrocks/rocks/luarocks-config.lua",
MAIL = "/var/spool/mail/ghost",
MANAGERPID = "1261",
MANPAGER = "/usr/bin/nvimpager",
MANWIDTH = "999",
MEMORY_PRESSURE_WATCH = "/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/session.slice/[email protected]/memory.pressure",
MEMORY_PRESSURE_WRITE = "c29tZSAyMDAwMDAgMjAwMDAwMAA=",
MOTD_SHOWN = "pam",
MOZ_ENABLE_WAYLAND = "1",
MYVIMRC = "/home/ghost/.config/hotrocks/init.lua",
NVIM_APPNAME = "hotrocks",
NVIM_LOG_FILE = "/home/ghost/.local/state/hotrocks/log",
OLDPWD = "/home/ghost",
PAGER = "/usr/bin/nvimpager",
PATH = "/home/ghost/.local/share/hotrocks/rocks/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/ghost/.local/bin:/home/ghost/.local/bin/scripts:/home/ghost/.node_modules/bin:/home/ghost/go/bin:/home/ghost/.cargo/bin:/home/ghost/.local/share/gem/ruby/3.3.0/bin",
PWD = "/home/ghost/.config/hotrocks",
QT_QPA_PLATFORM = "wayland",
RIPGREP_CONFIG_PATH = "/home/ghost/.config/rg/.ripgreprc",
SESSION_MANAGER = "local/lap:@/tmp/.ICE-unix/1358,unix/lap:/tmp/.ICE-unix/1358",
SHELL = "/usr/bin/zsh",
SHLVL = "2",
SKIM_DEFAULT_COMMAND = "/usr/bin/rg --files --hidden --no-require-git",
SSH_AUTH_SOCK = "/run/user/1000/ssh-agent.socket",
SYSTEMD_EXEC_PID = "1380",
TERM = "foot-extra-git",
USER = "ghost",
USERNAME = "ghost",
VIMRUNTIME = "/usr/share/nvim/runtime",
WAYLAND_DISPLAY = "wayland-0",
XAUTHORITY = "/run/user/1000/.mutter-Xwaylandauth.NJI0V2",
XDG_CONFIG_HOME = "/home/ghost/.config",
XDG_CURRENT_DESKTOP = "GNOME",
XDG_DATA_DIRS = "/home/ghost/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/",
XDG_MENU_PREFIX = "gnome-",
XDG_RUNTIME_DIR = "/run/user/1000",
XDG_SESSION_CLASS = "user",
XDG_SESSION_DESKTOP = "gnome",
XDG_SESSION_TYPE = "wayland",
ZELLIJ = "0",
ZELLIJ_PANE_ID = "5",
ZELLIJ_SESSION_NAME = "joyous-crab",
_ = "/usr/bin/nvim",
npm_config_prefix = "/home/ghost/.node_modules"
}
I think this is happening from hotpot, but can't find where and how? Is this expected behavior? If it is in fact related to hotpot, I'd have to assume it is. Is this something that is configurable?
Beta Was this translation helpful? Give feedback.
All reactions