mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@ftp.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix adbhid mismerge
Date: Wed, 17 Oct 2007 20:28:34 +0200	[thread overview]
Message-ID: <20071017182834.GA29359@atjola.homenet> (raw)
In-Reply-To: <20071017161821.GB15918@atjola.homenet>

On 2007.10.17 18:18:21 +0200, Björn Steinbrink wrote:
> On 2007.10.16 19:21:53 -0700, Linus Torvalds wrote:
> > 
> > 
> > On Tue, 16 Oct 2007, Linus Torvalds wrote:
> > > 
> > > I don't think you did anything wrong. You used both --full-history 
> > > (implicitly: git-whatchanged) and you made sure to see the diffs for both 
> > > sides of any merge (-m), and that means that you should see every single 
> > > diff involved.
> > 
> > Btw, if anybody can come up with a better way to find these kinds of 
> > mis-merges, I'd love to hear about it.
> > 
> [...]
> > 
> > What I'd actually really like would be something that shows the original 
> > conflict, but that's really expensive to compute (it basically involves 
> > re-doing the merge from scratch - finding the proper base commit(s) etc). 
> > So we never did that.
> 
> 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

Oops!
Obviously I meant to do s/last commit/merge commit/ before sending that
email.

> 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

      reply	other threads:[~2007-10-17 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-17  0:02 Al Viro
2007-10-17  1:21 ` Linus Torvalds
2007-10-17  2:21   ` Linus Torvalds
2007-10-17 16:18     ` Björn Steinbrink
2007-10-17 18:28       ` Björn Steinbrink [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071017182834.GA29359@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®