Page MenuHomePhabricator

Consecutive "arc patch" attempt creating up to 3 branches before failing
Open, Needs TriagePublic

Description

Given a D 69 that's pending review, running arc patch D69 currently creates branch arcpatch-D69. Then, after the diff is updated by the author and the reviewer wants to see the updated changes, a consecutive arc patch D69 creates arcpatch-D69_1. This happens up to arcpatch-D69_3.

After that, it fails saying "Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again.".

The solution is to just delete those previous branches, but shouldn't consecutive arc patch calls pull the updated diff for D 69 into the existing arcpatch-D69 every time? This is on Windows 8.1, current arcanist + libphutils.

>>> [17] <exec> $ git rev-parse --verify "arcpatch-D69"                                                                                                         
<<< [17] <exec> 988,148 us                                                                                                                                      
Branch name arcpatch-D69 already exists; trying a new name.                                                                                                     
>>> [18] <exec> $ git rev-parse --verify "arcpatch-D69_1"                                                                                                       
<<< [18] <exec> 584,228 us                                                                                                                                      
Branch name arcpatch-D69_1 already exists; trying a new name.                                                                                                   
>>> [19] <exec> $ git rev-parse --verify "arcpatch-D69_2"                                                                                                       
<<< [19] <exec> 574,197 us                                                                                                                                      
Branch name arcpatch-D69_2 already exists; trying a new name.                                                                                                   
>>> [20] <exec> $ git rev-parse --verify "arcpatch-D69_3"                                                                                                       
<<< [20] <exec> 172,490 us                                                                                                                                      
Branch name arcpatch-D69_3 already exists; trying a new name.                                                                                                   
                                                                                                                                                                
[2016-01-13 15:19:27] EXCEPTION: (Exception) Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again. at [<arcanist>\src\workflow\ArcanistPatchWorkflow.php:250]                                                                                                            
arcanist(head=master, ref.master=05c12eb9d9cb), phutil(head=master, ref.master=0fa7efbf09d7)                                                                    
  #0 ArcanistPatchWorkflow::getBranchName(ArcanistBundle) called at [<arcanist>\src\workflow\ArcanistPatchWorkflow.php:303]                                     
  #1 ArcanistPatchWorkflow::createBranch(ArcanistBundle, boolean) called at [<arcanist>\src\workflow\ArcanistPatchWorkflow.php:453]                             
  #2 ArcanistPatchWorkflow::run() called at [<arcanist>\src\workflow\ArcanistPatchWorkflow.php:397]                                                             
  #3 ArcanistPatchWorkflow::run() called at [<arcanist>\scripts\arcanist.php:392]

Event Timeline

If you already have a branch named arcpatch-D69, it is intentional that we do not overwrite it. You may have made local changes there, and it would be very bad for us to destroy your work.

That said, there is no technical reason for us to stop at 3.

See also T3277.

*nod* I found that task and used it to clean my arcpatch branches. If I may make a suggestion, could arc patch try to be clever about it and overwrite arcpatch-D69 only if there are no local modifications, and/or after confirming with the user?