Skip to content

hide old range-diff comments on a force push - #13

Open
bc1cindy wants to merge 1 commit into
diffstatfrom
hide-outdated
Open

bc1cindy wants to merge 1 commit into
diffstatfrom
hide-outdated

Conversation

@bc1cindy

@bc1cindy bc1cindy commented Oct 8, 2026

Copy link
Copy Markdown
Member

closes #3: on a force push, earlier range-diff comments at least hide-after-days old (three by default) are hidden as outdated.

@bc1cindy

bc1cindy commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

tested in #14 with hide-after-days 0

Captura de Tela 2026-10-08 às 15 01 28

@bc1cindy
bc1cindy added this pull request to stack #12 October 8, 2026 17:59
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
range-diff for force push ccd0b99e27 → ca81308641 October 8, 2026 23:23 UTC: 1 modified; 1 commit; base b8f8398d75 → fd22377b79 (diverged, 3 ahead and 3 behind)

reproduce: git range-diff b8f8398..ccd0b99 fd22377..ca81308

1:  ccd0b99e27 +158 -8 7f ! 1:  ca81308641 +158 -8 7f Hide old range-diff comments on a force push
1: ccd0b99e27 ! 1: ca81308641 Hide old range-diff comments on a force push
@@ tests/test_action.py: class ActionTest(unittest.TestCase):
  
      def test_force_push_full_checkout(self):
 @@ tests/test_action.py: class ActionTest(unittest.TestCase):
-         self.after = self.git("rev-parse", "HEAD")
-         self.assertNotIn("base <a", self.run_action())
+         self.after = self.commit("child again\n", "child", amend=True, path="child")
+         self.run_action(base_ref="topic", rewound=[self.before])
  
 +    def test_old_range_diff_comments_are_hidden(self):
 +        old = comment("OLD", "2000-01-01T00:00:00Z")

1 similar comment
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
range-diff for force push ccd0b99e27 → ca81308641 October 8, 2026 23:23 UTC: 1 modified; 1 commit; base b8f8398d75 → fd22377b79 (diverged, 3 ahead and 3 behind)

reproduce: git range-diff b8f8398..ccd0b99 fd22377..ca81308

1:  ccd0b99e27 +158 -8 7f ! 1:  ca81308641 +158 -8 7f Hide old range-diff comments on a force push
1: ccd0b99e27 ! 1: ca81308641 Hide old range-diff comments on a force push
@@ tests/test_action.py: class ActionTest(unittest.TestCase):
  
      def test_force_push_full_checkout(self):
 @@ tests/test_action.py: class ActionTest(unittest.TestCase):
-         self.after = self.git("rev-parse", "HEAD")
-         self.assertNotIn("base <a", self.run_action())
+         self.after = self.commit("child again\n", "child", amend=True, path="child")
+         self.run_action(base_ref="topic", rewound=[self.before])
  
 +    def test_old_range_diff_comments_are_hidden(self):
 +        old = comment("OLD", "2000-01-01T00:00:00Z")

Earlier range-diff comments at least hide-after-days old (three by
default) are minimized as outdated, so a long pull request stays readable.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
range-diff for force push ca81308641 → dd4d856d15 October 9, 2026 11:59 UTC: 1 modified; 1 commit; base fd22377b79 → db1484fe10 (diverged, 2 ahead and 2 behind)

reproduce: git range-diff fd22377..ca81308 db1484f..dd4d856

1:  ca81308641 +158 -8 7f ! 1:  dd4d856d15 +158 -8 7f Hide old range-diff comments on a force push
1: ca81308641 ! 1: dd4d856d15 Hide old range-diff comments on a force push
@@ Commit message
 
  ## README.md ##
 @@ README.md: changes. The summary line says how many commits the series had before and
- after, and whether its base is the same, a descendant of the old one, or
- diverged from it. A base branch that was itself rewritten, as a parent in a
- stack, is recognized from its force pushes in the repository's activity log.
--Inputs and outputs are described in [action.yml](action.yml).
-+Range-diff comments at least three days old are hidden as outdated on the
-+next force push; `hide-after-days` changes or disables that. Inputs and
-+outputs are described in [action.yml](action.yml).
+ after, and whether its base is the same, a descendant or an ancestor of the
+ old one, or diverged from it. A base branch that was itself rewritten, as a
+ parent in a stack, is recognized from its force pushes in the repository's
+-activity log. Inputs and outputs are described in [action.yml](action.yml).
++activity log. Range-diff comments at least three days old are hidden as
++outdated on the next force push; `hide-after-days` changes or disables that.
++Inputs and outputs are described in [action.yml](action.yml).
  
  `pull_request_target` gives fork PRs a token that can comment. It is safe here
  because nothing from the PR runs: the checkout is the base branch, the action

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
range-diff for force push ca81308641 → dd4d856d15 October 9, 2026 11:59 UTC: 1 modified; 1 commit; base fd22377b79 → db1484fe10 (diverged, 2 ahead and 2 behind)

reproduce: git range-diff fd22377..ca81308 db1484f..dd4d856

1:  ca81308641 +158 -8 7f ! 1:  dd4d856d15 +158 -8 7f Hide old range-diff comments on a force push
1: ca81308641 ! 1: dd4d856d15 Hide old range-diff comments on a force push
@@ Commit message
 
  ## README.md ##
 @@ README.md: changes. The summary line says how many commits the series had before and
- after, and whether its base is the same, a descendant of the old one, or
- diverged from it. A base branch that was itself rewritten, as a parent in a
- stack, is recognized from its force pushes in the repository's activity log.
--Inputs and outputs are described in [action.yml](action.yml).
-+Range-diff comments at least three days old are hidden as outdated on the
-+next force push; `hide-after-days` changes or disables that. Inputs and
-+outputs are described in [action.yml](action.yml).
+ after, and whether its base is the same, a descendant or an ancestor of the
+ old one, or diverged from it. A base branch that was itself rewritten, as a
+ parent in a stack, is recognized from its force pushes in the repository's
+-activity log. Inputs and outputs are described in [action.yml](action.yml).
++activity log. Range-diff comments at least three days old are hidden as
++outdated on the next force push; `hide-after-days` changes or disables that.
++Inputs and outputs are described in [action.yml](action.yml).
  
  `pull_request_target` gives fork PRs a token that can comment. It is safe here
  because nothing from the PR runs: the checkout is the base branch, the action

@oakagent

Copy link
Copy Markdown

ACK dd4d856 (automated): reviewed 1 commit dd4d856; no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

automatically hide previous comments as outdated

2 participants