| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  |  | 
| 2 |  |  |  |  |  |  | # Created on: 2014-03-11 20:58:59 | 
| 3 |  |  |  |  |  |  | # Create by:  Ivan Wills | 
| 4 |  |  |  |  |  |  | # $Id$ | 
| 5 |  |  |  |  |  |  | # $Revision$, $HeadURL$, $Date$ | 
| 6 |  |  |  |  |  |  | # $Revision$, $Source$, $Date$ | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | use strict; | 
| 9 | 2 |  |  | 2 |  | 85882 | use warnings; | 
|  | 2 |  |  |  |  | 12 |  | 
|  | 2 |  |  |  |  | 51 |  | 
| 10 | 2 |  |  | 2 |  | 9 | use version; | 
|  | 2 |  |  |  |  | 3 |  | 
|  | 2 |  |  |  |  | 41 |  | 
| 11 | 2 |  |  | 2 |  | 361 | use Getopt::Long; | 
|  | 2 |  |  |  |  | 1560 |  | 
|  | 2 |  |  |  |  | 10 |  | 
| 12 | 2 |  |  | 2 |  | 795 | use Pod::Usage (); | 
|  | 2 |  |  |  |  | 10325 |  | 
|  | 2 |  |  |  |  | 14 |  | 
| 13 | 2 |  |  | 2 |  | 1173 | use Data::Dumper qw/Dumper/; | 
|  | 2 |  |  |  |  | 86653 |  | 
|  | 2 |  |  |  |  | 64 |  | 
| 14 | 2 |  |  | 2 |  | 563 | use English qw/ -no_match_vars /; | 
|  | 2 |  |  |  |  | 5095 |  | 
|  | 2 |  |  |  |  | 148 |  | 
| 15 | 2 |  |  | 2 |  | 387 | use App::Git::Workflow; | 
|  | 2 |  |  |  |  | 2896 |  | 
|  | 2 |  |  |  |  | 14 |  | 
| 16 | 2 |  |  | 2 |  | 1054 | use App::Git::Workflow::Command qw/get_options/; | 
|  | 2 |  |  |  |  | 7 |  | 
|  | 2 |  |  |  |  | 81 |  | 
| 17 | 2 |  |  | 2 |  | 457 |  | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 531 |  | 
| 18 |  |  |  |  |  |  | our $VERSION  = version->new(1.1.19); | 
| 19 |  |  |  |  |  |  | our $workflow = App::Git::Workflow->new; | 
| 20 |  |  |  |  |  |  | our ($name)   = $PROGRAM_NAME =~ m{^.*/(.*?)$}mxs; | 
| 21 |  |  |  |  |  |  | our %option; | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | get_options( | 
| 24 |  |  |  |  |  |  | \%option, | 
| 25 | 2 |  |  | 2 | 1 | 10 | 'quiet|q', | 
| 26 |  |  |  |  |  |  | ); | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | my @files = map { /^#\s+modified:\s+(.*)\n/ } | 
| 29 |  |  |  |  |  |  | grep {/^#\s+modified:\s+/ } | 
| 30 | 4 |  |  |  |  | 15 | $workflow->git->status; | 
| 31 | 2 |  |  |  |  | 8 |  | 
|  | 4 |  |  |  |  | 15 |  | 
| 32 |  |  |  |  |  |  | for my $file (@files) { | 
| 33 |  |  |  |  |  |  | my $diff = $workflow->git->diff('--ignore-all-space', $file); | 
| 34 | 2 |  |  |  |  | 5 | chomp $diff; | 
| 35 | 4 |  |  |  |  | 11 |  | 
| 36 | 4 |  |  |  |  | 13 | if ( !$diff ) { | 
| 37 |  |  |  |  |  |  | warn "\t$file\n" unless $option{quiet}; | 
| 38 | 4 | 100 |  |  |  | 10 | $workflow->git->checkout($file); | 
| 39 | 2 | 100 |  |  |  | 55 | } | 
| 40 | 2 |  |  |  |  | 9 | } | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | return; | 
| 43 |  |  |  |  |  |  | } | 
| 44 | 2 |  |  |  |  | 5 |  | 
| 45 |  |  |  |  |  |  | 1; | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | =head1 NAME | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | git-cows - checkout whitespace only changed files | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | =head1 VERSION | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | This documentation refers to git-cows version 1.1.19 | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | git-cows [option] | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | OPTIONS: | 
| 61 |  |  |  |  |  |  | -q --quiet    Suppress notifying of files changed | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | -v --verbose  Show more detailed option | 
| 64 |  |  |  |  |  |  | --version  Prints the version information | 
| 65 |  |  |  |  |  |  | --help     Prints this help information | 
| 66 |  |  |  |  |  |  | --man      Prints the full documentation for git-cows | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  | C<git-cows> resets any files that only contain whitespace changes. | 
| 71 |  |  |  |  |  |  | This is done by finding all files modified (as shown by a C<git status>) and | 
| 72 |  |  |  |  |  |  | run them through C<git diff -w>. If any file results in no out put is shown | 
| 73 |  |  |  |  |  |  | (i.e. the changes are only white spaces) the file is then C<git checkout>ed to | 
| 74 |  |  |  |  |  |  | remove those changes. | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | This makes it easier make your commits clean of pointless whitespace only | 
| 77 |  |  |  |  |  |  | changes and makes others work easier. | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  | =head1 SUBROUTINES/METHODS | 
| 80 |  |  |  |  |  |  |  | 
| 81 |  |  |  |  |  |  | =head2 C<run ()> | 
| 82 |  |  |  |  |  |  |  | 
| 83 |  |  |  |  |  |  | Executes the git workflow command | 
| 84 |  |  |  |  |  |  |  | 
| 85 |  |  |  |  |  |  | =head1 DIAGNOSTICS | 
| 86 |  |  |  |  |  |  |  | 
| 87 |  |  |  |  |  |  | =head1 CONFIGURATION AND ENVIRONMENT | 
| 88 |  |  |  |  |  |  |  | 
| 89 |  |  |  |  |  |  | =head1 DEPENDENCIES | 
| 90 |  |  |  |  |  |  |  | 
| 91 |  |  |  |  |  |  | =head1 INCOMPATIBILITIES | 
| 92 |  |  |  |  |  |  |  | 
| 93 |  |  |  |  |  |  | =head1 BUGS AND LIMITATIONS | 
| 94 |  |  |  |  |  |  |  | 
| 95 |  |  |  |  |  |  | There are no known bugs in this module. | 
| 96 |  |  |  |  |  |  |  | 
| 97 |  |  |  |  |  |  | Please report problems to Ivan Wills (ivan.wills@gmail.com). | 
| 98 |  |  |  |  |  |  |  | 
| 99 |  |  |  |  |  |  | Patches are welcome. | 
| 100 |  |  |  |  |  |  |  | 
| 101 |  |  |  |  |  |  | =head1 AUTHOR | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  | Ivan Wills - (ivan.wills@gmail.com) | 
| 104 |  |  |  |  |  |  |  | 
| 105 |  |  |  |  |  |  | =head1 LICENSE AND COPYRIGHT | 
| 106 |  |  |  |  |  |  |  | 
| 107 |  |  |  |  |  |  | Copyright (c) 2014 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). | 
| 108 |  |  |  |  |  |  | All rights reserved. | 
| 109 |  |  |  |  |  |  |  | 
| 110 |  |  |  |  |  |  | This module is free software; you can redistribute it and/or modify it under | 
| 111 |  |  |  |  |  |  | the same terms as Perl itself. See L<perlartistic>.  This program is | 
| 112 |  |  |  |  |  |  | distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | 
| 113 |  |  |  |  |  |  | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | 
| 114 |  |  |  |  |  |  | PARTICULAR PURPOSE. | 
| 115 |  |  |  |  |  |  |  | 
| 116 |  |  |  |  |  |  | =cut |