Please review pull request #210: Perform a hard reset to get module changes opened by (jeffmccune)

Description:

Without this patch the --modules command line option results in the
behavior of using git checkout -f on the puppet master systems using the
local branch.

This is a problem because I frequently re-write history in my topic
branches and the upstream branch will no longer be fast-forward-able
relative to the local branch reference.

The end result is that my changes aren't actually tested if I rewrite
history.

This patch fixes the problem by doing a hard reset of the local topic
branch against the upstream reference. This ensures the local branch is
the exact same as the upstream reference.

The end result is that my changes are tested. =)

  • Opened: Thu May 10 23:50:14 UTC 2012
  • Based on: puppetlabs:master (83a00b878fb6dbcf6762fbd8502286de03bf8301)
  • Requested merge: jeffmccune:fix/master/hard_reset_modules (26dc1aae706889c9a1677cba2731fe4a6af740a6)

Diff follows:

diff --git a/setup/git/04_InstallModules.rb b/setup/git/04_InstallModules.rb
index 96d2f36..3d5068b 100644
--- a/setup/git/04_InstallModules.rb
+++ b/setup/git/04_InstallModules.rb
@@ -48,8 +48,10 @@ def list
                 "remote rm origin",
                 "remote add origin #{mod[:url]}",
                 "fetch origin",
+                "checkout -f #{mod[:ref]}",
+                "reset --hard refs/remotes/origin/#{mod[:ref]}",
                 "clean -fdx",
-                "checkout -f #{mod[:ref]}"]
+    ]
 
     on host, commands.join(" && git ")
   end

    

--
You received this message because you are subscribed to the Google Groups "Puppet 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/puppet-dev?hl=en.

Reply via email to