Git error messages are hidden when getting error on a branch
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- git, typescript
- 領域
- cli
調査の方向性
Start at src/utils/ValidationsHandler.ts around line 174, where the branch commit lookup currently hides Git errors. Reproduce the branch lookup failure with a Docker-mounted repository and verify that the CLI preserves and displays Git's diagnostic output alongside the existing error. Done means users can see the underlying Git failure instead of only the generic message.
索引モデルが issue の本文から書いたものです。
説明
We had a problem recently where caprover-cli was showing an error message, but it didn't make any senses:
Cannot find hash of last commit on branch "master".
After a few researches I've found the code that make the error and ran it.
# git rev-parse master
fatal: detected dubious ownership in repository at '<folder>'
To add an exception for this directory, call:
git config --global --add safe.directory <folder>
I've found a similar issue #122 their problem was solved by, not using sudo, but our problem is because we're using docker to run caprover-cli with a volume that is linked to our project folder.
The real issue here is that the code https://github.com/caprover/caprover-cli/blob/c7cdb49850a932c275893ae4289ed16f75c47a1c/src/utils/ValidationsHandler.ts#L174 is obscuring the git error message.
I have a suggestion to display the git error, instead of sending it to /dev/null we could send the error message to a temporary file and print the content when we encounter the error. Being able to have the proper error would have saved us a lot of time.
The program could print something like:
Cannot find hash of last commit on branch "master". Git returned the following errors:
fatal: detected dubious ownership in repository at '<folder>'
To add an exception for this directory, call:
git config --global --add safe.directory <folder>
I would be willing to work on the pull request to add this behaviour.
P.S. for people that have the same problem and are using the caprover/caprover-cli's docker with an upgraded version of git, we added RUN git config --global --add safe.directory <the path of our volume folder> to our Dockerfile to fix the error. We allowed this because we control the docker and it's running locally on our dev's machines, meaning that it's not causing security issues with our workflow.
- 主要言語
- TypeScript
- スター
- 78
- フォーク
- 42
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
caprover/caprover-cli のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
caprover/caprover-cli#155 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
caprover/caprover-cli#153 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
caprover/caprover-cli#148 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
caprover/caprover-cli#144 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
caprover/caprover-cli#143 · リアクション 1 件 ·
caprover/caprover-cli の issue をすべて見る
似ている issue
-
Chip source filter and denial markers miss Storage rows when a Storage activity source is pickedオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
omdsh-dev/DSH-better-sidebar#1141 ·
メンテナーはふだん 2 日以内に返信
-
desktop linux photos
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Cleanup Setup対応中かも @AlexanderKaran が今日担当しました。 オープンdocumentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
e18e/framework-tracker#769 ·
メンテナーはふだん 1 日以内に返信
-
bug v2
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
modelcontextprotocol/servers#5483 ·
メンテナーはふだん 1 日以内に返信