Git error messages are hidden when getting error on a branch
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- git, typescript
- Área
- cli
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 78
- Forks
- 42
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de caprover/caprover-cli
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
caprover/caprover-cli#155 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 58/100
caprover/caprover-cli#153 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
caprover/caprover-cli#148 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
caprover/caprover-cli#144 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
caprover/caprover-cli#143 · 1 reacción ·
Todos los issues de caprover/caprover-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
hugomrdias/playwright-test#753 ·
Los mantenedores suelen responder en 1 día
-
Review view: Daily/Weekly Review header buttons use the app-wide toolbar control stylePosiblemente ocupada @colherdesopa la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
dongdongbh/Mindwtr#1515 ·
Los mantenedores suelen responder en 1 día
-
pending-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
kirodotdev/Kiro#12301 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100