git log -1 --merges --ancestry-path <commit-A>..HEAD -- path/to/fileUse this to identify the first merge commit on the mainline (first-parent path) from <commit-A> to HEAD that touched a specific file. Especially useful when a line disappears due to merge conflict resolution and isn't visible with -S or -G.
git logβ View commit history-1β Return only the most recent matching commit--mergesβ Filter to merge commits only--ancestry-path <A>..HEADβ Follow only the mainline ancestry (parent chain) from A to HEAD-- path/to/fileβ Limit results to commits that changed the specific file