-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
bin/vendors: break if a bundle has local modifications #232
Conversation
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.
I'm -1 on this; I feel like bin/vendors should never contain user modifications, and so I WANT any changes that have crept in to be blown away. Any time I've been tempted to write hacky code as a shortcut, this deters me and forces me to find a cleaner way to handle things :) In development, I usually point the autoloader to a local path on my machine where I'm making changes (you can even pass it an array if you have some production bundles and some in development within the same namespace, though you have to be careful with this because odd things can and do happen). Then I can easily isolate my work (into a new Netbeans project, for example), commit at will, and not be at risk of losing work from a rogue |
I like your autoloader suggestion! I'll give that a shot. |
I'm going to merge it as many people have actually lost work because of this. |
Commits ------- 29dd189 bin/vendors: break if a bundle has local modifications Discussion ---------- 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. Also see my recent post about same to the symfony-devs mailing list. --------------------------------------------------------------------------- by Problematic at 2011/11/11 12:33:11 -0800 I'm -1 on this; I feel like bin/vendors should never contain user modifications, and so I WANT any changes that have crept in to be blown away. Any time I've been tempted to write hacky code as a shortcut, this deters me and forces me to find a cleaner way to handle things :) In development, I usually point the autoloader to a local path on my machine where I'm making changes (you can even pass it an array if you have some production bundles and some in development within the same namespace, though you have to be careful with this because odd things can and do happen). Then I can easily isolate my work (into a new Netbeans project, for example), commit at will, and not be at risk of losing work from a rogue `php bin/vendors install` call. --------------------------------------------------------------------------- by meonkeys at 2011/11/11 20:23:29 -0800 I like your autoloader suggestion! I'll give that a shot. --------------------------------------------------------------------------- by meonkeys at 2011/11/17 13:03:45 -0800 See also: <https://groups.google.com/d/msg/symfony-devs/bd8uu5khdeI/kFCuexhibfIJ>
Just for information (this happened to me several time) you can recover your modif using |
@vicb if they were committed, they are not concerned by this patch as they would not appear in |
@stof: right, but committed work will be blown away by the I wasn't sure how to easily/robustly figure out if there were un-pushed changes, so I left that out of the patch. And I had used the reflog safety net to retrieve commits in that case, too. |
I can't install a new Symfony project anymore due to this change. When I run
Since I start without a vendor folder, it's obvious I didn't make any changes. So I did a I also tried a |
check the github help for the whitespace issue |
(this is not in reply to vicb) For more help managing many custom bundles in one app, see: https://groups.google.com/d/msg/symfony-devs/VHJoi1tvzqE/lWVi93cdlOkJ It's a tiny Bash script that may help you avoid having to manually recover commits after running "bin/vendors install" with unpushed changes in one or more bundles. |
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.
Also see my recent post about same to the symfony-devs mailing list.