diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ 'names' => array( 'conpherence.pkg.css' => '3c8a0668', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => '5edb4679', + 'core.pkg.css' => '7ef29af5', 'core.pkg.js' => '705aec2c', 'differential.pkg.css' => '607c84be', 'differential.pkg.js' => '1b97518d', @@ -31,7 +31,7 @@ 'rsrc/css/aphront/panel-view.css' => '46923d46', 'rsrc/css/aphront/phabricator-nav-view.css' => 'f8a0c1bf', 'rsrc/css/aphront/table-view.css' => '0bb61df1', - 'rsrc/css/aphront/tokenizer.css' => 'b52d0668', + 'rsrc/css/aphront/tokenizer.css' => '34e2a838', 'rsrc/css/aphront/tooltip.css' => 'e3f2412f', 'rsrc/css/aphront/typeahead-browse.css' => 'b7ed02d2', 'rsrc/css/aphront/typeahead.css' => '8779483d', @@ -537,7 +537,7 @@ 'aphront-multi-column-view-css' => 'fbc00ba3', 'aphront-panel-view-css' => '46923d46', 'aphront-table-view-css' => '0bb61df1', - 'aphront-tokenizer-control-css' => 'b52d0668', + 'aphront-tokenizer-control-css' => '34e2a838', 'aphront-tooltip-css' => 'e3f2412f', 'aphront-typeahead-control-css' => '8779483d', 'application-search-view-css' => '0f7c06d8', @@ -1220,6 +1220,10 @@ 'javelin-stratcom', 'javelin-workflow', ), + '34e2a838' => array( + 'aphront-typeahead-control-css', + 'phui-tag-view-css', + ), '37b8a04a' => array( 'javelin-install', 'javelin-util', @@ -1945,10 +1949,6 @@ 'b517bfa0' => array( 'phui-oi-list-view-css', ), - 'b52d0668' => array( - 'aphront-typeahead-control-css', - 'phui-tag-view-css', - ), 'b58d1a2a' => array( 'javelin-behavior', 'javelin-behavior-device', diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php @@ -41,8 +41,19 @@ private function loadGitCommitRef() { $repository = $this->getRepository(); - // NOTE: %B was introduced somewhat recently in git's history, so pull - // commit message information with %s and %b instead. + // See T5028. The "%B" (raw body) mode is not present in very old versions + // of Git. Use "%s" and "%b" ("subject" and "wrapped body") as an + // approximation. + + $git_binary = PhutilBinaryAnalyzer::getForBinary('git'); + $git_version = $git_binary->getBinaryVersion(); + if (version_compare($git_version, '1.7.2', '>=')) { + $body_format = '%B'; + $split_body = false; + } else { + $body_format = '%s%x00%b'; + $split_body = true; + } // Even though we pass --encoding here, git doesn't always succeed, so // we try a little harder, since git *does* tell us what the actual encoding @@ -52,7 +63,22 @@ 'UTF-8', implode( '%x00', - array('%e', '%cn', '%ce', '%an', '%ae', '%T', '%at', '%s%n%n%b')), + array( + '%e', + '%cn', + '%ce', + '%an', + '%ae', + '%T', + '%at', + $body_format, + + // The "git log" output includes a trailing newline. We want to + // faithfully capture only the exact text of the commit message, + // so include an explicit terminator: this makes sure the exact + // body text is surrounded by "\0" characters. + '~', + )), $this->identifier); $parts = explode("\0", $info); @@ -82,6 +108,28 @@ $author_epoch = null; } + if ($split_body) { + // Here, the body is: "subject", "\0", "wrapped body". Stitch the + // pieces back together by putting a newline between them if both + // parts are nonempty. + + $head = $parts[6]; + $tail = $parts[7]; + + if (strlen($head) && strlen($tail)) { + $body = $head."\n\n".$tail; + } else if (strlen($head)) { + $body = $head; + } else if (strlen($tail)) { + $body = $tail; + } else { + $body = ''; + } + } else { + // Here, the body is the raw unwrapped body. + $body = $parts[6]; + } + return id(new DiffusionCommitRef()) ->setCommitterName($parts[0]) ->setCommitterEmail($parts[1]) @@ -89,7 +137,7 @@ ->setAuthorEmail($parts[3]) ->setHashes($hashes) ->setAuthorEpoch($author_epoch) - ->setMessage($parts[6]); + ->setMessage($body); } private function loadMercurialCommitRef() {