From 6dfbab0b6ce474f4528d221cd4d03f1b8cf4811b Mon Sep 17 00:00:00 2001 From: Nate McMaster <nate.mcmaster@microsoft.com> Date: Fri, 24 Feb 2017 10:08:19 -0800 Subject: [PATCH] More graceful error when running parallel git target --- .gitignore | 1 + makefile.shade | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ef7f8a307b3..a2e5dcfcfc1 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ project.lock.json /HttpSysServer/ /IISIntegration/ /Identity/ +/IdentityService/ /JsonPatch/ /KestrelHttpServer/ /Localization/ diff --git a/makefile.shade b/makefile.shade index d4f8a897c9b..123cc37d816 100644 --- a/makefile.shade +++ b/makefile.shade @@ -92,10 +92,24 @@ var buildTarget = "compile" #update @{ + var errors = new List<string>(); Parallel.ForEach(repositories, repo => { - Git("pull --ff-only", repo); + try + { + Git("pull --ff-only", repo); + } + catch + { + errors.Add(repo); + } }); + + if (errors.Count > 0) + { + Log.Info("Failed to pull: " + string.Join(", ", errors)); + throw new InvalidOperationException("update failed"); + } } #sync-commits @@ -562,13 +576,13 @@ var buildTarget = "compile" #git-clean description='REMOVE ALL CHANGES to the working directory' @{ - Console.WriteLine("This runs `git clean -xfd` in all non-Universe repos."); - Console.WriteLine("This should REMOVE ALL CHANGES to the working directory."); - Console.Write("***** Are you sure? ***** (Y or anything else)? "); - if (Console.ReadLine() != "Y") - { - throw new Exception("git-clean cancelled"); - } + // Console.WriteLine("This runs `git clean -xfd` in all non-Universe repos."); + // Console.WriteLine("This should REMOVE ALL CHANGES to the working directory."); + // Console.Write("***** Are you sure? ***** (Y or anything else)? "); + // if (Console.ReadLine() != "Y") + // { + // throw new Exception("git-clean cancelled"); + // } foreach(var repo in repositories) { GitClean(repo); -- GitLab