Re: Which file is older in history?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 21, 2013 at 05:29:39PM +0530, Ramkumar Ramachandra wrote:

> > This must be a trick question but the naïve way I think of is
> >
> >         git log --diff-filter=A -- path1 path2
> 
> Thanks, I didn't know about --diff-filter.  I'll need one extra step
> to figure out which commit corresponds to the introduction of which
> file, no?

Maybe

  git log --format=%H --name-status --diff-filter=A -- path1 path2 |
  perl -lne '
    if (/[0-9a-f]{40}/) { $commit = $& }
    elsif (/^A\t(.*)/) { $h{$1} = $commit }
    END { print "$h{$_} $_" for keys(%h) }
  '

?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]