Noob question: Why patch accepted by git not accepted by libgit2/pygit2?
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.7k
- Fork
- 408
- Merge medio
- 2g 57m
- PR unite (30g)
- 7
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci la discrepanza usando il diff fornito rispetto ad apple/llvm-project su swift-5.9-RELEASE. Confronta git apply con Diff.parse_diff seguito da repo.applies(..., raise_error=True) e repo.apply(...), quindi esamina il comportamento rilevante di applicazione delle patch di libgit2/pygit2. Il lavoro è completato quando hai identificato perché l’hunk differisce e hai documentato o corretto il comportamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git, python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100