mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-02 09:58:23 +01:00
add support for using Arcanist with git's log.decorate setting enabled
Summary: Arcanist fails to find git's 'commit <hash>' header when log.decorate is set in one of git's config files. git adds the named refs that point to the commit in parentheses following the hash. This changes the regex used by arcanist to match git commit headers to optionally match the branch names in parentheses following the hash. Test Plan: Run `git config --global log.decorate short` and check that `arc diff` runs successfully. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2344
This commit is contained in:
parent
e9ab03a48e
commit
b32b868a61
4 changed files with 36 additions and 3 deletions
|
@ -215,7 +215,7 @@ final class ArcanistDiffParser {
|
|||
// This is an SVN property change, probably from "svn diff".
|
||||
'(?P<type>Property changes on): (?P<cur>.+)',
|
||||
// This is a git commit message, probably from "git show".
|
||||
'(?P<type>commit) (?P<hash>[a-f0-9]+)',
|
||||
'(?P<type>commit) (?P<hash>[a-f0-9]+)(?: \(.*\))?',
|
||||
// This is a git diff, probably from "git show" or "git diff".
|
||||
// Note that the filenames may appear quoted.
|
||||
'(?P<type>diff --git) '.
|
||||
|
|
|
@ -428,6 +428,7 @@ EOTEXT
|
|||
$this->assertEqual(1, count(reset($changes)->getHunks()));
|
||||
break;
|
||||
case 'git-commit.gitdiff':
|
||||
case 'git-commit-logdecorate.gitdiff':
|
||||
$this->assertEqual(1, count($changes));
|
||||
$change = reset($changes);
|
||||
$this->assertEqual(
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
commit 76e2f1339c298c748aa0b52030799ed202a6537b (HEAD, refs/heads/master)
|
||||
Author: ngao <ngao@2c7ba8d8-a2f7-0310-a573-de162e16dcc7>
|
||||
Date: Wed Mar 3 20:39:39 2010 +0000
|
||||
|
||||
Deprecating UIActionButton (Part 1)
|
||||
|
||||
Summary: Replaces calls to UIActionButton with <ui:button>. I tested most
|
||||
of these calls, but there were some that I didn't know how to
|
||||
reach, so if you are one of the owners of this code, please test
|
||||
your feature in my sandbox: www.ngao.devrs013.facebook.com
|
||||
|
||||
@brosenthal, I removed some logic that was setting a disabled state
|
||||
on a UIActionButton, which is actually a no-op.
|
||||
|
||||
Reviewed By: brosenthal
|
||||
|
||||
Other Commenters: sparker, egiovanola
|
||||
|
||||
Test Plan: www.ngao.devrs013.facebook.com
|
||||
|
||||
Explicitly tested:
|
||||
* ads creation flow (add keyword)
|
||||
* ads manager (conversion tracking)
|
||||
* help center (create a discussion)
|
||||
* new user wizard (next step button)
|
||||
|
||||
Revert: OK
|
||||
|
||||
DiffCamp Revision: 94064
|
||||
|
||||
git-svn-id: svn+ssh://tubbs/svnroot/tfb/trunk/www@223593 2c7ba8d8
|
|
@ -281,11 +281,12 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
|||
return '';
|
||||
} else if ($relative == self::GIT_MAGIC_ROOT_COMMIT) {
|
||||
// First commit.
|
||||
list($stdout) = $this->execxLocal('log --format=medium HEAD');
|
||||
list($stdout) = $this->execxLocal(
|
||||
'log --no-decorate --format=medium HEAD');
|
||||
} else {
|
||||
// 2..N commits.
|
||||
list($stdout) = $this->execxLocal(
|
||||
'log --first-parent --format=medium %s..HEAD',
|
||||
'log --no-decorate --first-parent --format=medium %s..HEAD',
|
||||
$this->getRelativeCommit());
|
||||
}
|
||||
return $stdout;
|
||||
|
|
Loading…
Add table
Reference in a new issue