Skip Menu |

This queue is for tickets about the Text-Diff-Parser CPAN distribution.

Report information
The Basics
Id: 60476
Status: rejected
Priority: 0/
Queue: Text-Diff-Parser

People
Owner: Nobody in particular
Requestors: mkanat [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.1001
Fixed in: (no value)



Subject: Would be nice to have a lines added/removed count for a whole diff and for each Change
To implement a "diffstat"-like functionality in Perl, it would be nice to have a specific count of the number of lines added/removed by the whole file and by each Change, as opposed to just the general "size" accessor.
On Wed Aug 18 13:10:54 2010, MKANAT wrote: Show quoted text
> To implement a "diffstat"-like functionality in Perl, it would be nice to > have a specific count of the number of lines added/removed by the whole > file and by each Change, as opposed to just the general "size" accessor.
This information is already available : if( $cs->type eq 'ADD' ) { $added += $cs->size; } elsif( $cs->type eq 'REMOVE' ) { $removed += $cs->size; } elsif( $cs->type eq 'MODIFY' ) { $added += $cs->size; $removed += $cs->size; } I could sort of see a ->delta method +size for ADD, -size for REMOVE. But it would be 0 for MODIFY. Or are you thinking of something else?
On Tue Nov 02 22:29:15 2010, GWYN wrote: Show quoted text
> On Wed Aug 18 13:10:54 2010, MKANAT wrote:
> > To implement a "diffstat"-like functionality in Perl, it would be nice to > > have a specific count of the number of lines added/removed by the whole > > file and by each Change, as opposed to just the general "size" accessor.
> > This information is already available : > if( $cs->type eq 'ADD' ) { > $added += $cs->size; > } > elsif( $cs->type eq 'REMOVE' ) { > $removed += $cs->size; > } > elsif( $cs->type eq 'MODIFY' ) { > $added += $cs->size; > $removed += $cs->size; > } > > I could sort of see a ->delta method +size for ADD, -size for REMOVE. > But it would be 0 for MODIFY. > > Or are you thinking of something else?