Re: [PATCH] fix adbhid mismerge

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Al Viro <viro@...>, <linux-kernel@...>
Date: Wednesday, October 17, 2007 - 12:18 pm

On 2007.10.16 19:21:53 -0700, Linus Torvalds wrote:
[...]

So here's what I came up with:

git grep -l "int keycode, up_flag" \
	$(git-rev-list HEAD --parents -- drivers/macintosh/adbhid.c | \
		egrep '(.{40} ?){3}' | cut -d' ' -f1) \
	-- drivers/macintosh/adbhid.c | grep -o '^[^:]*'

Which gives: b981d8b3f5e008ff10d993be633ad00564fc22cd

Then:
git checkout b981d8b3f5e008ff10d993be633ad00564fc22cd^1
git merge b981d8b3f5e008ff10d993be633ad00564fc22cd^2

And you got your merge conflict.

The idea is, that the above ugliness searches for the last commit that
produced the bad line. The inner git-rev-list call searches for merge
commits (thanks to Ilari in #git for the egrep trick), then git-grep
looks which of these have the "bad line" and the final grep just filters
the filename out.

If the bash thing spits out more than one commit hash, you probably want
to use the last one... I guess... And if the given result doesn't
produce the request merge conflict, well, I guess you could replace HEAD
in the git-rev-list call with the sha1 you got in the first run, but I'm
not entirely sure about that.

Is that helpful?

Björn
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] fix adbhid mismerge, Al Viro, (Tue Oct 16, 8:02 pm)
Re: [PATCH] fix adbhid mismerge, Linus Torvalds, (Tue Oct 16, 9:21 pm)
Re: [PATCH] fix adbhid mismerge, Linus Torvalds, (Tue Oct 16, 10:21 pm)
Re: [PATCH] fix adbhid mismerge, Björn, (Wed Oct 17, 12:18 pm)
Re: [PATCH] fix adbhid mismerge, Björn, (Wed Oct 17, 2:28 pm)