All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: Adam Monsen <haircut@gmail.com>, git@vger.kernel.org
Subject: Re: frustrated forensics: hard to find diff that undid a fix
Date: Sat, 5 Mar 2011 06:51:00 -0600	[thread overview]
Message-ID: <20110305125100.GA14547@elie> (raw)
In-Reply-To: <m37hcd7qfv.fsf@localhost.localdomain>

Hi,

Jakub Narebski wrote:

> I guess that pickaxe also needs -c or -m.

I am not so sure.

Pickaxe is used to ask, "what commit introduced this string?".  Using
"git log --raw -c", I can see that the current state of
contrib/fast-import/git-p4 came about in commit 6d74e5c9d (Merge
branch 'mh/p4', 2011-03-04):

| $ git log --oneline --raw -c
| 07873dc Merge branch 'maint'
| 
| 6d74e5c Merge branch 'mh/p4'
| 
| ::100755 100755 100755 a4f440d... 8b00fd8... 2df3bb2... MM
| contrib/fast-import/git-p4
[...]

Now, working backwards, I ask git:

| $ git log --oneline -S "$(cat contrib/fast-import/git-p4)" maint..master
| $

No hits.  Maybe it's from one of those mergey diffs?

| $ git log --oneline -m -S "$(cat contrib/fast-import/git-p4)" maint..master
| 07873dc (from 964498e) Merge branch 'maint'
| 6d74e5c (from 08fd871) Merge branch 'mh/p4'
| 6d74e5c (from c9dbab0) Merge branch 'mh/p4'
| $

Too many hits (it includes every merge in which one side contains
the string and the other does not).  How about -c, which seemed to
produce such nice output with --raw?

| $ git log --oneline -c -S "$(cat contrib/fast-import/git-p4)" maint..master
| 07873dc Merge branch 'maint'
| 6d74e5c Merge branch 'mh/p4'
| 08fd871 Merge branch 'mg/maint-difftool-vim-readonly'
| 5cb3c9b Merge branch 'jn/maint-commit-missing-template'
| 1538f21 Merge branch 'jk/diffstat-binary'
| 24161eb Merge branch 'lt/rename-no-extra-copy-detection'
| [...]

Oh.  diff_tree_combined_merge simply doesn't know about pickaxe,
so -c and --cc with -S print _all_ merges.

So the only sensible way to use pickaxe with merges is

| $ git log --oneline -m --first-parent \
|	-S "$(cat contrib/fast-import/git-p4)" maint..master
| 6d74e5c Merge branch 'mh/p4'

for now.  I'd be happy to help anyone hoping to improve this.
(Hopefully all that is needed is something like the
diff_queue_is_empty() check from v0.99~504 --- Diffcore updates,
2005-05-22.)

  reply	other threads:[~2011-03-05 12:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-05  6:20 frustrated forensics: hard to find diff that undid a fix Adam Monsen
2011-03-05 10:00 ` Jonathan del Strother
2011-03-05 11:33 ` Jakub Narebski
2011-03-05 12:51   ` Jonathan Nieder [this message]
2011-03-05 13:48     ` Jeff King
2011-03-05 14:34   ` Adam Monsen
2011-03-05 19:56     ` [PATCH 0/2] improve combined diff documentation Adam Monsen
2011-03-05 19:56     ` [PATCH 1/2] documentation fix: git log -p does not imply -c Adam Monsen
2011-03-07  0:36       ` Junio C Hamano
2011-03-07 15:47         ` Jeff King
2011-03-07 18:37           ` Junio C Hamano
2011-03-07 19:12             ` Jeff King
2011-03-07 21:57               ` [PATCH v3] Documentation " Adam Monsen
2011-03-08  0:21                 ` Junio C Hamano
2011-03-08  0:49                   ` [PATCH v4] " Adam Monsen
2011-03-08 19:43                     ` Junio C Hamano
2011-03-08 20:46                       ` Adam Monsen
2011-03-09  0:58                         ` Junio C Hamano
2011-03-09 21:25                           ` Adam Monsen
2011-03-09 21:27                             ` [PATCH] SubmittingPatches: clean up commit message tips Adam Monsen
2011-03-09 22:20                               ` Junio C Hamano
2011-03-08 20:51                       ` [PATCH v5] diff format documentation: clarify --cc and -c Adam Monsen
2011-03-08 21:03                       ` [PATCH v6] " Adam Monsen
2011-03-08  1:19                   ` [PATCH v3] Documentation fix: git log -p does not imply -c Jeff King
2011-03-05 19:56     ` [PATCH 2/2] English grammar fixes for combined diff doc Adam Monsen
2011-03-05 14:29 ` frustrated forensics: hard to find diff that undid a fix Martin von Zweigbergk

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=20110305125100.GA14547@elie \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=haircut@gmail.com \
    --cc=jnareb@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.