Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@royosherove がすでに取り組んでいます。

2026年10月11日 から。

  • #142 @royosherove による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
git, shell
領域
tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
73
フォーク
11
平均マージ
6時間 46分
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

inceptionstack/lowkey のほかの issue

inceptionstack/lowkey の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。