1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00
phorge-arcanist/src
Javier Arteaga 46009145f7 Minimize reliance on 'git branch' output format
Summary:
Ref T5554. Both the current branch name (if on a branch), as well as the
list of all local branches, can be retrieved without having to parse the
output from "git branch".

Unfortunately, there seems to be no git plumbing for "get list of
branches containing this commit" yet.
(see http://marc.info/?l=git&m=141408477614635&w=2)

For that case, this commit whitelists the output from "git branch" using
the known valid branch names from "git for-each-ref".

Test Plan:
Set up a test repo with this structure:
```
|   *  Commit B1, on branch "subfeature"
|  /
| *    Commit A1, on branch "feature"
|/
*      Commit M1, on branch "master"
|
```

In `subfeature`, I tried:
* `arc which --base 'git:branch-unique(master)'`
* `arc feature`
After that, I detached my HEAD (don't worry, I got better) and tried again.

Nothing looked broken.

(Tested with git 1.7.2.5 and 2.5.0.)

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T5554

Differential Revision: https://secure.phabricator.com/D13989
2015-08-24 17:57:41 -07:00
..
__tests__ Use PhutilLibraryTestCase 2015-01-07 07:37:59 +11:00
configuration Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-11 06:50:47 +10:00
difference Extend from Phobject 2015-06-15 15:47:33 +10:00
differential Extend from Phobject 2015-06-15 15:47:33 +10:00
docs/book Minor documentation improvements 2015-06-08 11:31:35 +10:00
events/constant Remove @group annotations 2014-07-09 09:12:13 +10:00
exception pht all the things 2015-05-13 21:00:53 +10:00
extensions Changes to Arcanist for libphutil "extensions/" 2013-04-22 14:38:49 -07:00
hgdaemon Extend from Phobject 2015-06-15 15:47:33 +10:00
internationalization Fix a translation ("to ignore these changes...") 2015-06-01 06:50:46 -07:00
lint Exclude variables used in strings inside closures when checking for undeclared variables 2015-08-21 07:26:52 +10:00
parser Various linter fixes 2015-08-11 22:35:40 +10:00
repository Minimize reliance on 'git branch' output format 2015-08-24 17:57:41 -07:00
unit Fix arc unit --everything 2015-08-11 22:37:28 +10:00
upload Provide more documentation for Arcanist upload stuff 2015-05-27 10:26:27 -07:00
workflow Fix wrong plural of an arc land message 2015-08-20 04:19:22 -07:00
workingcopyidentity Extend from Phobject 2015-06-15 15:47:33 +10:00
__phutil_library_init__.php Delete license headers from files 2012-11-05 11:16:24 -08:00
__phutil_library_map__.php Add a Composer linter 2015-08-19 21:39:11 +10:00