Here's the patch I forgot to attach to my last email.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
>From 10088400f892a7a6d0ed12b825c128c7ef413315 Mon Sep 17 00:00:00 2001
From: Adam Monsen <[email protected]>
Date: Tue, 8 Nov 2011 15:59:07 -0800
Subject: [PATCH] bin/vendors: break if a bundle has local modifications

I'm often developing several Symfony2 bundles at once. I have them all
set up as deps for a single Symfony2 application, and I point Netbeans
at the base of the Symfony2 directory.

Since each [sub]dir in vendor/ is a complete git repository, after
making a bunch of changes I can then dive into each dir and commit/push
as necessary.

If I accidentally run "bin/vendors install" while I have un-pushed
changes, they're blown away by the "git reset --hard" in bin/vendors.
This patch proposes to make the script more cautious, assuming that
local modifications should never be blown away. Note that "--force" is
unimplemented, this is just one idea.
---
 bin/vendors |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/vendors b/bin/vendors
index 8b96132..4852652 100755
--- a/bin/vendors
+++ b/bin/vendors
@@ -102,6 +102,10 @@ foreach ($deps as $name => $dep) {
         system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
     }
 
+    $status = system(sprintf('cd %s && git status --porcelain', escapeshellarg($installDir)));
+    if (!empty($status)) {
+      exit("$name has local modifications. Will not proceed without --force.\n");
+    }
     system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
 
     if ('update' === $command) {
-- 
1.7.5.4

Reply via email to