Noob question: Why patch accepted by git not accepted by libgit2/pygit2?
Abierto
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 408
- Merge medio
- 2 d 57 min
- PR fusionados (30 d)
- 7
Descripción
Hi:
this is my raw diff:
diff --git a/llvm/cmake/modules/FindZ3.cmake b/llvm/cmake/modules/FindZ3.cmake
--- a/llvm/cmake/modules/FindZ3.cmake
+++ b/llvm/cmake/modules/FindZ3.cmake
@@ -75,7 +75,7 @@ unset(Z3_VERSION_STRING)
# First, try to check it dynamically, by compiling a small program that
# prints Z3's version
-if(Z3_INCLUDE_DIR AND Z3_LIBRARIES)
+if(Z3_INCLUDE_DIR AND Z3_LIBRARIES AND NOT CMAKE_CROSSCOMPILING)
# We do not have the Z3 binary to query for a version. Try to use
# a small C++ program to detect it via the Z3_get_version() API call.
check_z3_version(${Z3_INCLUDE_DIR} ${Z3_LIBRARIES})
this is the repo/tag I'm trying to apply to: apple/llvm#swift-5.9-RELEASE
However:
git apply G5664b56043f1f6a838183e74275bfee389fea177.diff
works as intended, yet :
patch_content: str = patchPath.read_text()
patch: Diff = Diff.parse_diff(patch_content)
if (repo.applies(patch,raise_error=True)):
repo.apply(patch)
results in:
hunk at line 75 did not apply
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.
Línea de trabajo
Reproduce la discrepancia usando el diff proporcionado contra apple/llvm-project en swift-5.9-RELEASE. Compara git apply con Diff.parse_diff seguido de repo.applies(..., raise_error=True) y repo.apply(...), y después inspecciona el comportamiento relevante de aplicación de parches de libgit2/pygit2. El trabajo estará terminado cuando identifiques por qué difiere el hunk y documentes o corrijas el comportamiento.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- git, python
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100