Is there a way to identify “side” commits (commits that edit the same lines and lead to a conflict) for a specific commit?
A very simplified example
$ git init $ echo test > test $ git add test $ git commit -m "First commit" $ echo test1 > test $ git commit -am "Second commit" $ git l * 95a29dd Second commit * 30a68e6 First commit $ type test test1
Assuming that at this point for some reason I want to return 30a68e6 .
$ git revert 30a68e6 error: could not revert 30a68e6... First commit hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit'
Naturally, this will lead to a conflict, since 95a29dd edited the same line.
Is it possible to know in advance that the return of 30a68e6 will lead to a conflict, and if so, with what commit (i.e. 95a29dd )?
To give a little context, I need this because I need some commits to be canceled automatically. In this case, if I know that 30a68e6 should be canceled, I want to be able to identify the “security deposit” that should be canceled first in order to avoid conflict (for example, 30a68e6 ). I know that just returning all 30a68e6..HEAD will work, but I would like to avoid re-commits that won't conflict with 30a68e6 .
source share