@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Accept pushes with arbitrary Git refs

Summary:
Depends on D20419. Ref T13277. Fixes T8936. Fixes T9383. Fixes T12300. When you push arbitrary refs to Phabricator, the push log currently complains if those refs are not tags or branches.

Upstream Git now features "notes", and there's no reason to prevent writes to arbitrary refs, particularly beause we plan to start using them soon (see T13278).

Allow these writes as affecting raw refs.

Test Plan:
- Pushed an arbitrary ref.
- Pushed some Git notes.
- Wrote a Herald ref rule, saw "ref" in the dropdown.

{F6376492}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13277, T8936, T9383, T12300

Differential Revision: https://secure.phabricator.com/D20420

+7 -4
+1 -4
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
··· 459 459 $ref_type = PhabricatorRepositoryPushLog::REFTYPE_TAG; 460 460 $ref_raw = substr($ref_raw, strlen('refs/tags/')); 461 461 } else { 462 - throw new Exception( 463 - pht( 464 - "Unable to identify the reftype of '%s'. Rejecting push.", 465 - $ref_raw)); 462 + $ref_type = PhabricatorRepositoryPushLog::REFTYPE_REF; 466 463 } 467 464 468 465 $ref_update = $this->newPushLog()
+1
src/applications/diffusion/herald/DiffusionPreCommitRefTypeHeraldField.php
··· 24 24 $types = array( 25 25 PhabricatorRepositoryPushLog::REFTYPE_BRANCH => pht('branch (git/hg)'), 26 26 PhabricatorRepositoryPushLog::REFTYPE_TAG => pht('tag (git)'), 27 + PhabricatorRepositoryPushLog::REFTYPE_REF => pht('ref (git)'), 27 28 PhabricatorRepositoryPushLog::REFTYPE_BOOKMARK => pht('bookmark (hg)'), 28 29 ); 29 30
+1
src/applications/repository/storage/PhabricatorRepositoryPushLog.php
··· 17 17 const REFTYPE_TAG = 'tag'; 18 18 const REFTYPE_BOOKMARK = 'bookmark'; 19 19 const REFTYPE_COMMIT = 'commit'; 20 + const REFTYPE_REF = 'ref'; 20 21 21 22 const CHANGEFLAG_ADD = 1; 22 23 const CHANGEFLAG_DELETE = 2;
+4
src/applications/repository/worker/PhabricatorRepositoryPushMailWorker.php
··· 149 149 $type_name = pht('bookmark'); 150 150 $type_prefix = pht('bookmark:'); 151 151 break; 152 + case PhabricatorRepositoryPushLog::REFTYPE_REF: 153 + $type_name = pht('ref'); 154 + $type_prefix = pht('ref:'); 155 + break; 152 156 case PhabricatorRepositoryPushLog::REFTYPE_COMMIT: 153 157 default: 154 158 break;