Ignoring whitespaces on diff does not work
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia riproducendo l'esempio Compare con CompareOptions, SimilarityOptions e WhitespaceMode.IgnoreAllWhitespace, quindi confronta il relativo output con git diff --ignore-all-space. Segui il percorso di confronto dei diff che gestisce le modalità di Whitespace. Il lavoro è completato quando le modifiche costituite solo da Whitespace vengono ignorate, mentre le modifiche sostanziali continuano ad apparire nella patch.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected behavior
When I call:
var options =
new CompareOptions()
{
ContextLines = Int32.MaxValue,
IncludeUnmodified = true,
Similarity =
new SimilarityOptions()
{
WhitespaceMode = WhitespaceMode.IgnoreAllWhitespace
}
};
Console.Write(
repo.Diff.Compare<Patch>(
branch.Tip.Tree,
DiffTargets.Index | DiffTargets.WorkingDirectory,
files,
null,
options
).First().Patch
)
the output is the same as using the git command git diff --ignore-all-space:
diff --git a/test.txt b/test.txt
index d209983..b2c9980 100644
--- a/test.txt
+++ b/test.txt
@@ -1,2 +1,2 @@
I am an initial content
-I am a changeable content
\ No newline at end of file
+I am a different content
\ No newline at end of file
Actual behavior
If have a file "test.txt" with committed content:
I am an inital content
I am a changeable content
and uncommitted content:
I am an inital content
I am a different content
(The first line has some additional whitespaces)
When I call:
var options =
new CompareOptions()
{
ContextLines = Int32.MaxValue,
IncludeUnmodified = true,
Similarity =
new SimilarityOptions()
{
WhitespaceMode = WhitespaceMode.IgnoreAllWhitespace
}
};
Console.Write(
repo.Diff.Compare<Patch>(
branch.Tip.Tree,
DiffTargets.Index | DiffTargets.WorkingDirectory,
files,
null,
options
).First().Patch
)
the output is
diff --git a/test.txt b/test.txt
index d209983..b2c9980 100644
--- a/test.txt
+++ b/test.txt
@@ -1,2 +1,2 @@
-I am an initial content
-I am a changeable content
\ No newline at end of file
+I am an initial content
+I am a different content
\ No newline at end of file
Version of LibGit2Sharp (release number or SHA1)
v0.26.2
Operating system(s) tested; .NET runtime tested
- Lingua principale
- C#
- Stelle
- 3.5k
- Fork
- 925
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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.
Altre issue di libgit2/libgit2sharp
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
libgit2/libgit2sharp#2193 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
libgit2/libgit2sharp#2192 · 1 commento ·
-
Website is down Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
libgit2/libgit2sharp#2191 · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
libgit2/libgit2sharp#2189 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
libgit2/libgit2sharp#2187 · 2 commenti ·
Tutte le issue di libgit2/libgit2sharp
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
azurenoops/spin_agent#975 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SubtitleEdit/subtitleedit#15108 · 1 commento ·