kou commented on code in PR #39215:
URL: https://github.com/apache/arrow/pull/39215#discussion_r1445549249


##########
dev/release/test-helper.rb:
##########
@@ -83,15 +83,60 @@ def parse_patch(patch)
       when /\A@@/
         in_hunk = true
         diffs.last[:hunks] << []
-      when /\A[-+]/
+      when /\A-/
         next unless in_hunk
         diffs.last[:hunks].last << line.chomp
+                 when /\A\+/
+                   next unless in_hunk
+                       diffs.last[:hunks].last << 
normalize_added_line(line.chomp)
       end
     end
     diffs.sort_by do |diff|
       diff[:path]
     end
   end
+
+  def generate_hunks(lines)
+    git_diff_context = 3 # The default of Git's diff.context
+    max_lines_for_same_hunk = git_diff_context * 2 + 1
+    previous_i = nil
+    grouped_change_blocks = []
+    lines.each_with_index do |line, i|
+      deleted, added = yield(line)
+      next if deleted.nil? and added.nil?
+      if previous_i.nil? or (i - previous_i) > max_lines_for_same_hunk
+        grouped_change_blocks << []
+      end
+      if i - 1 != previous_i
+        grouped_change_blocks.last << []
+      end
+      grouped_change_blocks.last.last << [deleted, added]
+      previous_i = i
+    end
+    grouped_change_blocks.collect do |change_blocks|
+      hunk = []
+      change_blocks.each do |continuous_changes|
+        continuous_changes.each do |deleted, _|
+          hunk << "-#{deleted}" if deleted
+        end
+        continuous_changes.each do |_, added|
+          hunk << "+#{added}" if added
+        end
+      end
+      hunk
+    end
+  end
+
+  def normalize_pom_xml_output_timestamp(line)
+    line.gsub(/<project\.build\.outputTimestamp>.+?</) do
+      "<project.build.outputTimestamp>2023-12-13T00:00:00Z<"

Review Comment:
   Hmm, it seems that we have miscommunication. Here are what I think:
   * We need the `project.build.outputTimestamp` element in the `pom.xml`.
   * But we don't need to use a special timestamp for the element in the 
`pom.xml` like you did in the first commit in this PR.
   
   `dev/release/test-helper.rb` updates the element's timestamp because it runs 
partial our release process. And the process updates 
`project.build.outputTimestamp`'s timestamp.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to