git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: git@vger.kernel.org
Cc: Johannes Sixt <j6t@kdbg.org>
Subject: Re: Can't find the revelant commit with git-log
Date: Wed, 26 Jan 2011 19:11:56 +0100	[thread overview]
Message-ID: <4D4063EC.7090509@lsrfire.ath.cx> (raw)
In-Reply-To: <m239og12pe.fsf@gmail.com>

Am 26.01.2011 09:36, schrieb Francis Moreau:
> Francis Moreau <francis.moro@gmail.com> writes:
> 
>> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>>
>>> Try -m (show full diff for merge commits), as the change you're looking
>>> for seems to have been introduced by a merge, not a regular commit.
>>>
>>> 	$ opts="--stat -Sblacklist_iommu -m --oneline"
>>> 	$ revs="v2.6.27..v2.6.28"
>>>
>>> 	$ git log $opts $revs -- drivers/pci/intel-iommu.c
>>>
>>> This returns nothing.  Hmm.  Let's try this instead:
>>>
>>> 	$ git log $opts $revs -- drivers/pci/
>>> 	057316c (from 3e2dab9) Merge branch 'linus' into test
>>> 	 drivers/pci/intel-iommu.c |  307 ++++++++++++++++++++------------------------
>>> 	 1 files changed, 140 insertions(+), 167 deletions(-)
>>> 	6b2ada8 (from 3b7ecb5) Merge branches 'core/softlockup', 'core/softirq', 'core/resources', 'core/printk' and 'core/misc' into core-v28-for-linus
>>> 	 drivers/pci/intel-iommu.c |  187 ++++++--------------------------------------
>>> 	 1 files changed, 26 insertions(+), 161 deletions(-)
>>> 	d847059 (from 725c258) Merge branch 'x86/apic' into x86-v28-for-linus-phase4-B
>>> 	 drivers/pci/intel-iommu.c |  185 ++++++---------------------------------------
>>> 	 1 files changed, 25 insertions(+), 160 deletions(-)
>>> 	725c258 (from 129d6ab) Merge branches 'core/iommu', 'x86/amd-iommu' and 'x86/iommu' into x86-v28-for-linus-phase3-B
>>> 	 drivers/pci/intel-iommu.c |   25 ++++++++++++++++++++++++-
>>> 	 1 files changed, 24 insertions(+), 1 deletions(-)
>>> 	6e03f99 (from 9821626) Merge branch 'linus' into x86/iommu
>>> 	 drivers/pci/intel-iommu.c |   23 +++++++++++++++++++++++
>>> 	 1 files changed, 23 insertions(+), 0 deletions(-)
>>>
>>> Strange, why did we need to remove the last path component to get these
>>> results which say that exactly the file we previously specified was changed?
>>
>> ah... I think I've been hit by this, since I tried '-m' too but see
>> nothing and was not smart enough to remove the filename from the path.
>>
>>> Also interesting, and matching the above results in that we see the need for
>>> the -m flag confirmed:
> 
> BTW, couldn't '-m' automatically set when '-S' is given ?

I can't see a connection between the two options.  Merges are ignored by
default (without -m) because they shouldn't contain any changes that
aren't already present in one of the merged branches (by convention),
and diffs with a single parent are easier to read.  This is true with or
without -S.

So far we have two action items, I think:

	- Make git grep report non-matching path specs (new feature).

	- Find out why removing the last path component made a
	  difference in the case above (looks like a bug, but I don't
	  understand what's going on).

Taking into account what Johannes said regarding the disappearance of
the function during a merge instead of as part of a regular commit, I
don't think these changes would help you much with your use case,
though.  You would still be looking at a complicated net of commits,
with the action happening in non-obvious places (merges).

Perhaps --graph can help a bit, see for yourself:

	$ git log --graph -Sblacklist_iommu -m --oneline \
	v2.6.27..v2.6.28 -- drivers/pci/

If you start at v.2.6.26 instead -- e.g. to catch the commit that
introduced the function -- then the graph gets a lot more colourful and
too complicated, at least for me, though.

René

  parent reply	other threads:[~2011-01-26 18:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25  9:01 Can't find the revelant commit with git-log Francis Moreau
2011-01-25 16:12 ` René Scharfe
2011-01-25 17:44   ` Francis Moreau
2011-01-26  8:36     ` Francis Moreau
2011-01-26 10:44       ` Johannes Sixt
2011-01-26 20:56         ` Francis Moreau
2011-01-26 21:03           ` Sverre Rabbelier
2011-01-26 21:08             ` Francis Moreau
2011-01-26 21:14               ` Sverre Rabbelier
2011-01-26 21:31                 ` Francis Moreau
2011-01-26 21:24               ` Junio C Hamano
2011-01-26 21:32                 ` Francis Moreau
2011-01-26 18:11       ` René Scharfe [this message]
2011-01-28 20:29         ` René Scharfe
2011-01-29  0:02           ` Junio C Hamano
2011-01-29  2:34             ` René Scharfe
2011-01-29  5:47               ` Junio C Hamano
2011-01-29 20:26                 ` René Scharfe
2011-02-01 21:28                   ` Junio C Hamano
2011-02-07 22:51                   ` Junio C Hamano
2011-02-10 18:50                     ` René Scharfe
2011-01-29 20:26               ` René Scharfe
2011-01-28 22:01         ` René Scharfe
2011-01-29 12:52           ` Francis Moreau
2011-01-29 13:02             ` René Scharfe
2011-01-29 13:57               ` Francis Moreau
2011-01-29 15:17                 ` René Scharfe
2011-01-26  9:01   ` Francis Moreau
2011-01-26 18:39     ` René Scharfe
2011-01-26 19:50       ` Francis Moreau

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=4D4063EC.7090509@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /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;
as well as URLs for NNTP newsgroup(s).