Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

scripts/setup-hooks.sh: fails in a git worktree because .git is a file

Abierto
#137 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@royosherove ya está trabajando en esto.

Desde el 11/10/2026.

  • #142 de @royosherove — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
git, shell
Área
tooling

Línea de trabajo

Read scripts/setup-hooks.sh lines 8–13 and check how it locates the repository and hooks directory. Reproduce the failure in a linked worktree with git worktree add, then verify the script accepts the worktree and targets Git’s hooks directory. Done means setup succeeds in both a regular checkout and a linked worktree; pull request #142 is already open for this issue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug crew: in progress good first issue

scripts/setup-hooks.sh L8-13:

HOOKS_DIR="${REPO_ROOT}/.git/hooks"
if [[ ! -d "${REPO_ROOT}/.git" ]]; then
  echo "Error: not a git repository. Run from the repo root." >&2
  exit 1
fi

Problem: In a linked worktree (git worktree add), .git is a file, not a directory. The script then prints "not a git repository" and exits 1. Also, git does not read hooks from <worktree>/.git/hooks.

Fix:

git -C "$REPO_ROOT" rev-parse --git-dir >/dev/null 2>&1 || { echo "Error: not a git repository." >&2; exit 1; }
HOOKS_DIR="$(git -C "$REPO_ROOT" rev-parse --path-format=absolute --git-path hooks)"

Found by a code read at commit 1e50295. The code was read, but not run on a real instance.

Lenguaje dominante
Shell
Estrellas
73
Forks
11
Merge medio
6 h 46 min
PR fusionados (30 d)
5

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de inceptionstack/lowkey

Todos los issues de inceptionstack/lowkey

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.