Skip to content

changed-files fails to detect submodule “rollback” #107

Description

@johanfleury

We have a repository with a submodule and from time to time someone forgets to update the submodule locally and commits an older version.

We’re using changed-files to detect changes inside that submodule and when such “rollback” happens, changed-files reports nothing.

This seems to be because changed-files is using “Symetric Difference Notation” (<commit>...<commit>, three dots) to compare commits and not “Range Notation” (<commit>..<commit>, two dots).

Here are the relevant logs from the action:

  /usr/bin/git diff 844da757bfbc9b09bcb5287adb13bb5a55ea0be4...9c6d3c9a7ee7aa6b9bdecda037408dc92333a1c1 -- path/to/submodule
  diff --git a/path/to/submodule b/path/to/submodule
  index 1949910..46c4e19 160000
  --- a/path/to/submodule
  +++ b/path/to/submodule
  @@ -1 +1 @@
  -Subproject commit 19499108076f5bd687b7ca46f07ca3fd23be8f6f
  +Subproject commit 46c4e195e6a67cfb23cabf1dd9869e7d9ce5c4ee
  /usr/bin/git merge-base 19499108076f5bd687b7ca46f07ca3fd23be8f6f 46c4e195e6a67cfb23cabf1dd9869e7d9ce5c4ee
  46c4e195e6a67cfb23cabf1dd9869e7d9ce5c4ee
  /usr/bin/git log --format=%H 46c4e195e6a67cfb23cabf1dd9869e7d9ce5c4ee..46c4e195e6a67cfb23cabf1dd9869e7d9ce5c4ee
  /usr/bin/git diff --name-status --ignore-submodules=all --diff-filter=ACDMRTUX 19499108076f5bd687b7ca46f07ca3fd23be8f6f...46c4e195e6a67cfb23cabf1dd9869e7d9ce5c4ee
  ##[debug]All diff files: {"A":[],"C":[],"D":[],"M":[],"R":[],"T":[],"U":[],"X":[]}
  All Done!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions