fork-dev / Tracker

Bug and issue tracker for Fork for Mac
509 stars 12 forks source link

Commit/Changes/File Tree view doesn't render for local branch #1926

Open sirnacnud opened 1 year ago

sirnacnud commented 1 year ago

I am running into an error where the Commit/Changes/File Tree view doesn't render and shows parseError(error: Cannot parse patch for <commitHash>).

The error doesn't happen on all branches, but seems to be local branches and maybe only ones that I recently rebased. I'm not for sure when the error started happening, but only recently.

I am on macOS 13.4.1 and have tried both Fork 2.28.1, 2.29.2, and 2.30.

Screenshot 2023-07-07 at 2 07 47 PM

DanPristupov commented 1 year ago

Hi.

  1. Check the log file ~/Library/Logs/Fork.log
  2. A (possible) related issue from the Windows issue tracker: https://github.com/fork-dev/TrackerWin/issues/1951
sirnacnud commented 1 year ago

Seems like a different error. This is what is in the log file:

❌[PatchTokenizer.swift:260] > Can not find src prefix start in:
diff --git "forkSrcPrefix/MapDownloads/Internal/Persistence/\020DatabaseMigrationStep.swift" "forkDstPrefix/MapDownloads/Internal/Persistence/\020DatabaseMigrationStep.swift"
sirnacnud commented 1 year ago

Seems like the \020 on the file name was causing the issue. I removed this off the file name and it is working now. Strange that Xcode put this on the file name.

DanPristupov commented 1 year ago

\020

You have a weirdly named name which has \020 at the beginning. How is that file named on disk? Do you know how that file was created as I could reproduce that problem?

sirnacnud commented 1 year ago

It must of been some weird bug in Xcode, as I created this file there. In Xcode this special character was not shown at the start of the file name, it just looked normal.

Anyways, thanks for the help.

DanPristupov commented 1 year ago

When I create a file with a leading space (touch " test.txt"), git doesn't encode it with \020:

my:

diff --git forkSrcPrefix/ file.txt forkDstPrefix/ file.txt
                         ^                       ^

yours:

diff --git "forkSrcPrefix/MapDownloads/Internal/Persistence/\020DatabaseMigrationStep.swift" "forkDstPrefix/MapDownloads/Internal/Persistence/\020DatabaseMigrationStep.swift"
                                                            ^^^^                                                                              ^^^^

I will make Fork handle such paths, however, I would really want to know how to reproduce such a case.

DanPristupov commented 1 year ago

Please let me keep this case open until I investigate it. Thank you for reporting that problem 👍

sirnacnud commented 1 year ago

It's not the same as a normal space. ls shows it as a ? and in Finder it looks normal. od shows the 020 character.

duncan@Duncans-MBP:~/Source/native-iphone-client/MapDownloads/Internal/Persistence$ ls *DatabaseMigrationStep.swift
?DatabaseMigrationStep.swift
duncan@Duncans-MBP:~/Source/native-iphone-client/MapDownloads/Internal/Persistence$ ls *DatabaseMigrationStep.swift | od -c
0000000  020   D   a   t   a   b   a   s   e   M   i   g   r   a   t   i
0000020    o   n   S   t   e   p   .   s   w   i   f   t  \n
0000035
mtschoen-unity commented 1 year ago

I've noticed this, too. If I scroll a little bit I can kick it to start rendering again. I don't see any logs like this, though.

stuartro commented 8 months ago

I have run into this "Parse error" issue as well. It is caused by filenames that contain some Unicode characters. For example, I have some text files that have the Unicode bullet character ("∙") in them, and those consistently cause Fork to report a "Parse error".

I needed to do a diff across two branches and ran into this issue yesterday. I tried Sourcetree and found that—while I don’t its UI that much—it worked flawlessly (i.e. didn’t get hung up on Unicode chars).

Perhaps this will help hunting for / resolving this "Parse" issue.