You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TLDR is that it seems like parse-git-diff can handle @@ -74,2 +74 @@, but for 1 line changes git will omit the ,1 and just report @@ -74 +74 @@ and that causes the regex handling in parse-git-diff to break.
I'm no expert here but I think whats happening is that it has an optional capture group for the ,<digit> which should become delLines, but that's missing here so instead the next capture group actually gets put in as delLines, which happens to be addStart, which is 94, so it reports 94 lines in fromFileRange 😢
The text was updated successfully, but these errors were encountered:
See parkerbxyz/suggest-changes#50 (comment)
The TLDR is that it seems like parse-git-diff can handle
@@ -74,2 +74 @@
, but for 1 line changes git will omit the,1
and just report@@ -74 +74 @@
and that causes the regex handling in parse-git-diff to break.I see the "normal" chunk regex here:
parse-git-diff/src/parse-git-diff.ts
Lines 223 to 224 in e8ed56d
Which gets expanded out here:
parse-git-diff/src/parse-git-diff.ts
Lines 268 to 269 in e8ed56d
I'm no expert here but I think whats happening is that it has an optional capture group for the
,<digit>
which should becomedelLines
, but that's missing here so instead the next capture group actually gets put in asdelLines
, which happens to beaddStart
, which is94
, so it reports94
lines infromFileRange
😢The text was updated successfully, but these errors were encountered: