Git error messages are hidden when getting error on a branch
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- git, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 78
- Fork
- 42
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của caprover/caprover-cli
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
caprover/caprover-cli#155 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
caprover/caprover-cli#153 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
caprover/caprover-cli#148 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
caprover/caprover-cli#144 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
caprover/caprover-cli#143 · 1 reaction ·
Tất cả issue của caprover/caprover-cli
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
shoelace-style/webawesome#2979 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Chip source filter and denial markers miss Storage rows when a Storage activity source is pickedĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
omdsh-dev/DSH-better-sidebar#1141 ·
Maintainer thường phản hồi trong vòng 2 ngày