Re: [PATCH 1/2] tests: eliminate unnecessary setup test assertions

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

 



On Fri, May 06, 2011 at 05:48:01PM -0400, Jeff King wrote:

>   pattern_authors() {
>     git grep -n "$@" |
>     while IFS=: read file line match; do
>       git blame -L "$line,$line" "$file"
>     done |
>     perl -lpe '/\((.*?) \d+-\d+-\d+/; $_=$1'
>   }

Two minor complaints on git-blame; maybe somebody can point out
something clever I've missed.

  1. blame's "-L" understands patterns already. So in theory I could
     tell it "blame all lines that match pattern X". But I don't think
     there is a way to do that (it tries looking to for _one_ range to
     blame for each -L, not a set of ranges).

  2. Parsing the human-readable output blame output sucks. But parsing
     --porcelain is annoyingly complex for quick-and-dirty things like
     this. It doesn't repeat the commit information per-line.

     I guess we could have an inefficient --line-porcelain format that
     breaks down ranges into single lines and repeats the commit info
     for each one.

     The clever among you may notice that in this particular case,
     though, I could have gotten away with regular --porcelain as I
     blame a single line at a time.

-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]