Cloud Stack Ninja

Is it possible to get a diff of the squashed commit of two(or more) commits without having access to actual code and just having diffs?

For example, if I have

diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index f407f19..ca5753a 100755
--- a/app/controllers/passwords_controller.rb
+++ b/app/controllers/passwords_controller.rb
@@ -6,7 +6,11 @@ class Devise::PasswordsController < DeviseController
   append_before_action :assert_reset_token_passed, only: :edit
 
   def new
-    self.resource = AIHelper.generate_movie
+    self.resource = AIHelper.generate_movie do
+      type = :random
+      length = :long
+      [type, length]
+    end
   end
 
   def create

and

diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index ca5753a..354a4b3 100755
--- a/app/controllers/passwords_controller.rb
+++ b/app/controllers/passwords_controller.rb
@@ -36,8 +37,10 @@ def edit
   end
 
   def update
-    self.resource = some_weird_method
-    yield resource if block_given?
+    self.resource = some_kind_of_refactoring do
+      start_of_refactoring
+      end_of_refactoring
+    end
 
     if resource.errors.empty?
       resource.unlock_access! if unlockable?(resource)

Can I somehow get its sum:

diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index f407f19..354a4b3 100755
--- a/app/controllers/passwords_controller.rb
+++ b/app/controllers/passwords_controller.rb
@@ -6,7 +6,11 @@ class Devise::PasswordsController < DeviseController
   append_before_action :assert_reset_token_passed, only: :edit
 
   def new
-    self.resource = AIHelper.generate_movie
+    self.resource = AIHelper.generate_movie do
+      type = :random
+      length = :long
+      [type, length]
+    end
   end
 
   def create
@@ -32,8 +37,10 @@ class Devise::PasswordsController < DeviseController
   end
 
   def update
-    self.resource = some_weird_method
-    yield resource if block_given?
+    self.resource = some_kind_of_refactoring do
+      start_of_refactoring
+      end_of_refactoring
+    end
 
     if resource.errors.empty?
       resource.unlock_access! if unlockable?(resource)

This is an easy example, but I want to know if there is a way to do it with any changes.

Any language would work.



Read more here: https://stackoverflow.com/questions/64397315/is-it-possible-to-squash-commits-by-their-diffs

Content Attribution

This content was originally published by korolvs at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: