From 96a47759ae4c16a700e3ed121e3c80861be51a17 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 28 Aug 2013 16:47:30 -0700 Subject: [PATCH] Make arc patch slightly better about submodules Summary: Ref T3776, Ref T479. Say you have some DN, with a submodule X@Y. Later, X@Z in your working copy / repo. If you run arc patch DN, you'd end up with a dirty working copy claiming that X@Z was wrong and it should be X@Y. To fix, basically run 'submodule init' and 'submodule update'. This makes it so after "arc patch" if you run "git status" it looks clean. Gross part though now is if you then "git checkout master" you'll have a dirty checkout the other way. I think this is better though. Test Plan: made a new repository where I added libphutil @ X, did some work (DX), then made libphutil @ y. When I arc patch'd DX, things looked good! Reviewers: epriestley Reviewed By: epriestley CC: csilvers, Korvin, aran Maniphest Tasks: T479, T3776 Differential Revision: https://secure.phabricator.com/D6837 --- src/workflow/ArcanistPatchWorkflow.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php index a33e1419..51775c11 100644 --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -692,6 +692,10 @@ EOTEXT throw new ArcanistUsageException("Unable to apply patch!"); } + // in case there were any submodule changes involved + $repository_api->execpassthru( + 'submodule update --init'); + if ($this->shouldCommit()) { if ($bundle->getFullAuthor()) { $author_cmd = csprintf('--author=%s', $bundle->getFullAuthor());