Makes arc work [task] work with git. Creates git branch with task id and task name.
Details
- Reviewers
aklapper - Group Reviewers
O1: Blessed Committers - Maniphest Tasks
- T15993: Support for arc work T12345 (workOnTask workflow)
Try arc work T12345
Diff Detail
- Repository
- rARC Arcanist
- Branch
- T15993-support-for-arc-work-t12345-(workontask-workflow) (branched from master)
- Lint
Lint Warnings Severity Location Code Message Warning src/work/ArcanistWorkEngine.php:230 TXT3 Line Too Long Advice src/work/ArcanistWorkEngine.php:228 XHP16 TODO Comment - Unit
Tests Passed - Build Status
Buildable 1735 Build 1735: arc lint + arc unit
Event Timeline
Thanks! I share a comment on the fly, maybe more comments soon after a test :)
src/work/ArcanistWorkEngine.php | ||
---|---|---|
231 | Multi-byte support for emojis |
src/work/ArcanistWorkEngine.php | ||
---|---|---|
201 | This should not be indented |
Setting Request Changes per the small review comments so far (as I am looking at https://we.phorge.it/differential/query/all/ and it helps to see correct statuses)
Hi @nib - still thanks and you are welcome in updating this patch using something like this:
arc patch D25872 (edits) arc diff
If you can't, we can eventually help. Thanks!
I've tested this and I'm impressed. You probably have changed my life.
Since the original workflow was completely borked I supposed this is the minimal viable product. But note that running the command twice causes this:
STDERR fatal: a branch named 'T15187-blabla' already exists
- Probably in this specific case it should just try to checkout there without creating the branch (?). I also don't think it should behave like arc patch that creates something different.
- Also, what should happen if the title changes a bit and if I run it again? Maybe it should detect tasks starting with Tsomething and use that?
What do you think about? Note that I'm still impressed and happy as-is lol
Hopefully the latest change will work for you. Now it checks existing git branches matching "T12345*" and if any exist, it will git checkout the first one, else it will create it from the task name.
So that should allow you to change the task title, and to use arc work T12345 as many times as you want without error.
@aklapper Would it make sense to move the branch-naming lines into a function in class ArcanistGitWorkEngine, since it the branch-naming is git-specific? E.g.
public function buildBranchName($task_ref) { $task_name = $task_ref->getName(); // regex, preg_replace, trim, etc return $branch_name; }
Probably yes so it's easier with Subversion and Mercurial in the future (?)
Probably something with "for task" in the name like buildBranchNameForTask($task_ref)
src/work/ArcanistWorkEngine.php | ||
---|---|---|
201 | And we can remove this newline <3 ihih |