Skip to content

Commit 1b60340

Browse files
committed
Include direct commits when finding directory-specific commit
Drop --merges so that both merge commits and direct pushes on the first-parent history are considered. This ensures the latest commit that modified a docker image directory is always used as reference, regardless of whether the change came via a merge or a direct commit.
1 parent 387b709 commit 1b60340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generate-stackbrew-library.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def sort_key(d):
7474
return dirs
7575

7676
def get_directory_commit(branch_commit, dir_path):
77-
"""Get the last merge commit on the first-parent history that changed the given directory."""
78-
output = run_command(["git", "log", "-1", "--first-parent", "--merges", "--format=%H", branch_commit, "--", f"{dir_path}/"])
77+
"""Get the latest commit on the first-parent history that changed the given directory."""
78+
output = run_command(["git", "log", "-1", "--first-parent", "--format=%H", branch_commit, "--", f"{dir_path}/"])
7979
return output.strip()
8080

8181
def get_arches(image, cache):

0 commit comments

Comments
 (0)