When browsing my repository hosted inside Phorge, I see the following exception showing up:
Diff Parse Exception: Expected '\ No newline at end of file'. 342 343 [… diff content] 344 [… diff content] 345 [… diff content] 346 [… diff content] >>> 347 \ Nincs új sor a fájl végén
Backtrace:
arcanist(head=master, ref.master=8426ebc053b3), phorge(head=master, ref.master=0a17287e08cd) #0 <#2> ArcanistDiffParser::didFailParse(string) called at [<arcanist>/src/parser/ArcanistDiffParser.php:959] #1 <#2> ArcanistDiffParser::parseChangeset(ArcanistDiffChange) called at [<arcanist>/src/parser/ArcanistDiffParser.php:350] #2 <#2> ArcanistDiffParser::parseDiff(string) called at [<phorge>/src/infrastructure/diff/PhabricatorDifferenceEngine.php:143] #3 <#2> PhabricatorDifferenceEngine::generateChangesetFromFileContent(string, string) called at [<phorge>/src/applications/differential/parser/DifferentialChangesetParser.php:1481] #4 <#2> DifferentialChangesetParser::realignDiff(DifferentialChangeset, DifferentialHunkParser) called at [<phorge>/src/applications/differential/parser/DifferentialChangesetParser.php:637] #5 <#2> DifferentialChangesetParser::process() called at [<phorge>/src/applications/differential/parser/DifferentialChangesetParser.php:624] #6 <#2> DifferentialChangesetParser::tryCacheStuff() called at [<phorge>/src/applications/differential/parser/DifferentialChangesetParser.php:791] #7 <#2> DifferentialChangesetParser::render(NULL, NULL, array) called at [<phorge>/src/applications/differential/parser/DifferentialChangesetParser.php:76] #8 <#2> DifferentialChangesetParser::renderChangeset() called at [<phorge>/src/applications/differential/parser/DifferentialChangesetParser.php:1902] #9 <#2> DifferentialChangesetParser::newChangesetResponse() called at [<phorge>/src/applications/diffusion/controller/DiffusionDiffController.php:141] #10 <#2> DiffusionDiffController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284] #11 phlog(Exception) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41] #12 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, Exception) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751] #13 AphrontApplicationConfiguration::handleThrowable(Exception) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296] #14 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204] #15 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
My locale is Hungarian and at the end it says exactly "No newline at end of file" just in another language.
Reproducer:
echo A > a.txt echo -n A > b.txt diff a.txt b.txt
LC_ALL=C diff a.txt b.txt --- a.txt 2023-06-30 16:57:35.309109363 +0200 +++ b.txt 2023-06-30 16:57:40.837179111 +0200 @@ -1 +1 @@ -A +A \ No newline at end of file
LC_ALL=hu_HU.UTF-8 diff a.txt b.txt --- a.txt 2023-06-30 16:57:35.309109363 +0200 +++ b.txt 2023-06-30 16:57:40.837179111 +0200 @@ -1 +1 @@ -A +A \ Nincs új sor a fájl végén