Git-Wrapper-0.045/000755 000765 000024 00000000000 12552752121 014575 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/Changes000644 000765 000024 00000017474 12552752121 016105 0ustar00genehackstaff000000 000000 Revision history for Git-Wrapper 0.045 2015-07-19 09:46:07-07:00 America/Los_Angeles And this time let's actually use a non-trial release, dummy... 0.044_92 2015-07-19 09:45:11-07:00 America/Los_Angeles (TRIAL RELEASE) No changes since last development release 0.044_91 2015-07-13 18:12:05-07:00 America/Los_Angeles (TRIAL RELEASE) Uncoditionally set no_abbrev option to improve raw log parsing [#67] (John Anderson) 0.044_90 2015-05-06 15:08:17-07:00 America/Los_Angeles (TRIAL RELEASE) Document 'modifications' method on G::W::Log (John Anderson) Parse raw logs correctly (John Anderson) Set modifications properly in constructor (John Anderson) 0.044 2015-04-07 21:10:31-07:00 America/Los_Angeles No changes from the (borked) v0.043-TRIAL 0.043-effup 2015-03-31 11:54:27-04:00 America/New_York (TRIAL RELEASE) Handle SKIP affecting number of commits in test (Gianni Ceccarelli) 0.043 2015-03-28 20:07:33-07:00 America/Los_Angeles No changes from 0.042-TRIAL (see also changes for 0.041-TRIAL) 0.042 2015-03-23 21:54:11-07:00 America/Los_Angeles (TRIAL RELEASE) Using "--format" with the log method now throws a Git::Wrapper::Exception (B. Estrade) 0.041 2015-03-18 22:14:08-07:00 America/Los_Angeles (TRIAL RELEASE) Switch from File::pushd to File::chdir (John Anderson) 0.040 2015-03-13 16:11:14-07:00 America/Los_Angeles No changes from 0.039-TRIAL 0.039 2015-02-23 19:27:47-08:00 America/Los_Angeles (TRIAL RELEASE) Various POD updates (B. Estrade) Exclude failing test on Mac OS with older Git (#41) (John Anderson) POD and typo fixes (Doug Bell) 0.038 2014-10-29 10:35:40-07:00 America/Los_Angeles 0.037 2014-08-13 12:43:00-05:00 America/Chicago Fix 'git config' during install stuff (Graham Knop) 0.036 2014-08-12 23:50:30-05:00 America/Chicago Run 'git config' during install (Karen Etheridge) 0.035 2014-07-30 07:25:21-07:00 America/Los_Angeles Attempted fix for Win32 test fails 0.034 2014-07-24 18:30:14-07:00 America/Los_Angeles Fix typo in minimum version required of File::pushd (Russell Jenkins) 0.033 2014-07-24 14:45:05-07:00 America/Los_Angeles require File::pushd 1.05 at a minimum 0.032 2014-04-22 18:29:06-07:00 America/Los_Angeles bail out early in Makefile.PL if git not installed, instead of failing tests (Karen Etheridge) 0.031 2014-03-17 08:10:42-07:00 America/Los_Angeles Only load IPC::Cmd if needed (Graham Knop) Reduce dependency on Path::Class to test.recommends, fix min version (Kent Fredric) Increment minimum version in eval check to match stated dist.ini version typo fix (dsteinbrunner) 0.030 2013-07-29 09:23:13 America/Los_Angeles Add explicit version dep on Path::Class (#40) (John SJ Anderson) Fixes typos. (Olaf Alders) 0.029 2013-05-07 10:21:26 America/Los_Angeles Included missed Changes update from last release... 0.028_97 2013-04-23 06:17:12 America/Los_Angeles Rework argument passing to deal with stringifying arguments (#29) (John SJ Anderson) 0.028_96 2013-02-24 16:19:15 America/Los_Angeles Support specifying the git binary location on new (Todd Rinaldo) Rework argument passing (#29) (John SJ Anderson, Mark Price) 0.028 2012-10-19 06:55:15 America/Los_Angeles Fix $git->branch compatibility with git < 1.7.1 by tweaking color calling convention (Vyacheslav Matyukhin) 0.027 2012-09-19 22:32:52 America/New_York Disable --no-abbrev-commit when git doesn't support it 0.026 2012-09-17 20:52:45 America/Los_Angeles Disable ANSI output for the branch command (John SJ Anderson) Force --no-abbrev-commit in git-log wrapper (Rob Hoelz) Add ABSTRACT for G::W::Statuses (John SJ Anderson) Fix the environment in a more sane way, to resolve issues on 5.8.x (introduced in v0.022) (Karen Etheridge) 0.025 2012-07-18 12:38:05 America/New_York Add 'fatal' option for RequiresExternal dzil plugin 0.024 2012-07-18 12:32:17 America/New_York make sure no line ending munging is done to get consistent hashing in test (Graham Knop) 0.023 2012-06-28 09:22:13 America/New_York Skip hash test on git versions before 1.6.1 (Eduardo AriƱo de la Rubia) Add explicit external dep on 'git' in $PATH; remove test code that bailed when 'git' wasn't in $PATH (JSJA) Remove t/pod* in favor of dzil plugin POD coverage/syntax tests (JSJA) 0.022 2012-06-27 17:00:46 America/New_York Unset GIT_PAGER_IN_USE env var to stop any ANSI colorization (Karen Etheridge) 0.021 2012-06-27 16:48:42 America/New_York Splitted up classes inside Git::Wrapper to individual package files (Torsten Raudssus) Added the handling of ->log({ raw => 1 }) to get the file modifications (Torsten Raudssus) add -STDIN option for passing content via STDIN (Graham Knop) 0.020 2012-04-28 11:21:55 America/New_York dist.ini tweaking: * Exclude archived releases and dist.ini from dist * Don't ship README; only README.mkdn * Set homepage and bugtracker URLs in META.yml 0.019 2012-04-25 08:14:54 America/New_York Skip 'git log --oneline' test on older gits without support for that option 0.018 2012-04-22 15:30:43 America/New_York Misc doc clean ups and tweaks (John SJ Anderson) Add ERR and OUT methods to provide direct access to STDERR and STDOUT, respectively (attempt to address RT#71632, John SJ Anderson) Generate proper calls for single letter options that take values (RT#75955, Fitz Elliott) Update documentation to demonstrate how to pass '0' to an option (RT#58787, John SJ Anderson) Make git-wrapper a bit friendlier on old gits (Ricardo Signes) 0.017 2011-09-27 14:35:19 America/New_York Remove usage of '//' operator (again) (John SJ Anderson) 0.016 2011-09-05 20:24:49 America/New_York Lots of tweaks to tests that will (hopefully) reduce some testing noise (John SJ Anderson) Fix for multi-line commit messages on Win32 (Christian Walde) 0.015 2011-07-16 10:15:15 America/New_York Added a fix that allows the 'clone' command to work (John SJ Anderson) Change 'log' indentation stripping behavior (RT#56427, Mark Grimes) 0.014 2010-11-12 Added empty commit message handling (Robert Bohne) Fixed failed tests on slow smokers. (Robert Bohne) Convert to Dist::Zilla (John SJ Anderson) Add 'is_dirty' helper to Statuses (John SJ Anderson) 0.013 2010-09-06 Added missing dependency for Test::Deep 0.012 2010-09-05 Rewrote // operator into pre-5.10 perl Debugging mode (Alexandr Ciornii) 0.011 2010-07-14 Doc Patch (Gabrielle Roth) Git Status Support (Murray) Remove the Stupid basic.t test (Jonathan Scott Duff) 0.010 2010-06-14 Win32 Support -- Docs and Tests (Christian Walde) 0.009 2010-06-05 stop failing tests on git 1.7 or newer (Aristotle Pagaltzis) do not rely on default value of log --pretty (Aristotle Pagaltzis) 0.008 2010-03-17 fix the tests for git >= 1.7 (Michael Schout) 0.007 2009-08-26 fix tests even more firmly (perigrin) 0.006 2009-06-01 fix tests more firmly 0.005 2009-05-28 change tests to pass on git 1.6 0.004 2008-06-19 add links to other git-related things inflate Git::Wrapper::Log objects 0.003 2008-06-05 improve error handling make documentation clearer 0.002 2008-06-04 properly depend on git binary 0.001 2008-06-04 First version, released on an unsuspecting world. Git-Wrapper-0.045/inc/000755 000765 000024 00000000000 12552752121 015346 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/INSTALL000644 000765 000024 00000001662 12552752121 015633 0ustar00genehackstaff000000 000000 This is the Perl distribution Git-Wrapper. Installing Git-Wrapper is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Git::Wrapper If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Git::Wrapper ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Git::Wrapper ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation Git-Wrapper documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc Git::Wrapper Git-Wrapper-0.045/lib/000755 000765 000024 00000000000 12552752121 015343 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/LICENSE000644 000765 000024 00000043702 12552752121 015610 0ustar00genehackstaff000000 000000 This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2014 by Hans Dieter Pearcey. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2014 by Hans Dieter Pearcey. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Git-Wrapper-0.045/Makefile.PL000644 000765 000024 00000004257 12552752121 016557 0ustar00genehackstaff000000 000000 # This Makefile.PL for Git-Wrapper was generated by # inc::CheckGitConfig # and Dist::Zilla::Plugin::MakeMaker::Awesome 0.34. # Don't edit it but the dist.ini and plugins used to construct it. use strict; use warnings; # inserted by Dist::Zilla::Plugin::CheckBin 0.007 use Devel::CheckBin; check_bin('git'); require File::Spec; die 'git seems broken; maybe check your HOME environment variable?' if system('git config --list >'.File::Spec->devnull); use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Wrap git(7) command-line interface", "AUTHOR" => "Hans Dieter Pearcey , Chris Prather , John SJ Anderson ", "CONFIGURE_REQUIRES" => { "Devel::CheckBin" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0 }, "DISTNAME" => "Git-Wrapper", "LICENSE" => "perl", "NAME" => "Git::Wrapper", "PREREQ_PM" => { "File::Temp" => 0, "File::chdir" => 0, "IPC::Cmd" => 0, "IPC::Open3" => 0, "Scalar::Util" => 0, "Sort::Versions" => 0, "Symbol" => 0, "overload" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Path" => 0, "File::Spec" => 0, "File::Temp" => 0, "IO::File" => 0, "POSIX" => 0, "Sort::Versions" => 0, "Test::Deep" => 0, "Test::Exception" => 0, "Test::More" => 0 }, "VERSION" => "0.045", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Devel::CheckBin" => 0, "ExtUtils::MakeMaker" => 0, "File::Path" => 0, "File::Spec" => 0, "File::Temp" => 0, "File::chdir" => 0, "IO::File" => 0, "IPC::Cmd" => 0, "IPC::Open3" => 0, "POSIX" => 0, "Scalar::Util" => 0, "Sort::Versions" => 0, "Symbol" => 0, "Test::Deep" => 0, "Test::Exception" => 0, "Test::More" => 0, "overload" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Git-Wrapper-0.045/MANIFEST000644 000765 000024 00000000730 12552752121 015726 0ustar00genehackstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.037. Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README.md inc/CheckGitConfig.pm lib/Git/Wrapper.pm lib/Git/Wrapper/Exception.pm lib/Git/Wrapper/File/RawModification.pm lib/Git/Wrapper/Log.pm lib/Git/Wrapper/Status.pm lib/Git/Wrapper/Statuses.pm t/00-load.t t/author-err.t t/basic.t t/git_binary.t t/parse_args.t t/path_class.t t/release-pod-coverage.t t/release-pod-syntax.t Git-Wrapper-0.045/META.json000644 000765 000024 00000040405 12552752121 016221 0ustar00genehackstaff000000 000000 { "abstract" : "Wrap git(7) command-line interface", "author" : [ "Hans Dieter Pearcey ", "Chris Prather ", "John SJ Anderson " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.037, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Git-Wrapper", "prereqs" : { "configure" : { "requires" : { "Devel::CheckBin" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0" } }, "develop" : { "requires" : { "Dist::Zilla::Plugin::MakeMaker::Awesome" : "0", "Pod::Coverage::TrustPod" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "requires" : { "File::Temp" : "0", "File::chdir" : "0", "IPC::Cmd" : "0", "IPC::Open3" : "0", "Scalar::Util" : "0", "Sort::Versions" : "0", "Symbol" : "0", "overload" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "Path::Class" : "0.26" }, "requires" : { "File::Path" : "0", "File::Spec" : "0", "File::Temp" : "0", "IO::File" : "0", "POSIX" : "0", "Sort::Versions" : "0", "Test::Deep" : "0", "Test::Exception" : "0", "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/genehack/Git-Wrapper/issues" }, "homepage" : "http://genehack.github.com/Git-Wrapper/", "repository" : { "type" : "git", "url" : "https://github.com/genehack/Git-Wrapper.git", "web" : "https://github.com/genehack/Git-Wrapper" } }, "version" : "0.045", "x_Dist_Zilla" : { "perl" : { "version" : "5.022000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "dist.ini", "INSTALL" ], "exclude_match" : [ "^release.*" ], "follow_symlinks" : "0", "include_dotfiles" : "0", "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "GatherDir", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Filter/PruneCruft", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Filter/ManifestSkip", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Filter/MetaYAML", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Filter/License", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@Filter/ExtraTests", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Filter/ExecDir", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Filter/ShareDir", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Filter/Manifest", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Filter/TestRelease", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Filter/ConfirmRelease", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Filter/UploadToCPAN", "version" : "5.037" }, { "class" : "inc::CheckGitConfig", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "=inc::CheckGitConfig", "version" : null }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.018", "version_by_branch" : 0, "version_regexp" : "(?^:^v(.+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "Git::NextVersion", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::CheckBin", "config" : { "Dist::Zilla::Plugin::CheckBin" : { "command" : [ "git" ] } }, "name" : "CheckBin", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "AutoPrereqs", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "recommends" } }, "name" : "TestRecommends", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "InstallGuide", "version" : "1.200006" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "MetaConfig", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "MetaJSON", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "NextRelease", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "PkgVersion", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "PodSyntaxTests", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "PodCoverageTests", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Default/SingleEncoding", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Default/Name", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Default/Version", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/prelude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Default/Leftovers", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/postlude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Default/Authors", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Default/Legal", "version" : "4.012" } ] } }, "name" : "PodWeaver", "version" : "4.006" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild", "name" : "CopyFilesFromBuild", "version" : "0.151680" }, { "class" : "Dist::Zilla::Plugin::Run::BeforeBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "rm -f Makefile.PL" ] } }, "name" : "Run::BeforeBuild", "version" : "0.039" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "cp %d/Makefile.PL ./", "git status --porcelain | grep \"M Makefile.PL\" && git commit -m \"auto-committed by dist.ini\" Makefile.PL || echo Makefile.PL up to date" ] } }, "name" : "Run::AfterBuild", "version" : "0.039" }, { "class" : "Dist::Zilla::Plugin::Run::Release", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "mv %a ./releases/" ] } }, "name" : "Run::Release", "version" : "0.039" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [ "releases" ], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "Git::Commit", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v0.045", "tag_format" : "v%v", "tag_message" : "v%v" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "Git::Tag", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Twitter", "name" : "Twitter", "version" : "0.026" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.037" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.037" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.037" } } } Git-Wrapper-0.045/META.yml000644 000765 000024 00000024031 12552752121 016046 0ustar00genehackstaff000000 000000 --- abstract: 'Wrap git(7) command-line interface' author: - 'Hans Dieter Pearcey ' - 'Chris Prather ' - 'John SJ Anderson ' build_requires: File::Path: '0' File::Spec: '0' File::Temp: '0' IO::File: '0' POSIX: '0' Sort::Versions: '0' Test::Deep: '0' Test::Exception: '0' Test::More: '0' configure_requires: Devel::CheckBin: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.037, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Git-Wrapper requires: File::Temp: '0' File::chdir: '0' IPC::Cmd: '0' IPC::Open3: '0' Scalar::Util: '0' Sort::Versions: '0' Symbol: '0' overload: '0' perl: '5.006' strict: '0' warnings: '0' resources: bugtracker: https://github.com/genehack/Git-Wrapper/issues homepage: http://genehack.github.com/Git-Wrapper/ repository: https://github.com/genehack/Git-Wrapper.git version: '0.045' x_Dist_Zilla: perl: version: '5.022000' plugins: - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - dist.ini - INSTALL exclude_match: - ^release.* follow_symlinks: '0' include_dotfiles: '0' prefix: '' prune_directory: [] root: . name: GatherDir version: '5.037' - class: Dist::Zilla::Plugin::PruneCruft name: '@Filter/PruneCruft' version: '5.037' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Filter/ManifestSkip' version: '5.037' - class: Dist::Zilla::Plugin::MetaYAML name: '@Filter/MetaYAML' version: '5.037' - class: Dist::Zilla::Plugin::License name: '@Filter/License' version: '5.037' - class: Dist::Zilla::Plugin::ExtraTests name: '@Filter/ExtraTests' version: '5.037' - class: Dist::Zilla::Plugin::ExecDir name: '@Filter/ExecDir' version: '5.037' - class: Dist::Zilla::Plugin::ShareDir name: '@Filter/ShareDir' version: '5.037' - class: Dist::Zilla::Plugin::Manifest name: '@Filter/Manifest' version: '5.037' - class: Dist::Zilla::Plugin::TestRelease name: '@Filter/TestRelease' version: '5.037' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Filter/ConfirmRelease' version: '5.037' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Filter/UploadToCPAN' version: '5.037' - class: inc::CheckGitConfig config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: =inc::CheckGitConfig version: ~ - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.018' version_by_branch: 0 version_regexp: (?^:^v(.+)$) Dist::Zilla::Role::Git::Repo: repo_root: . name: Git::NextVersion version: '2.036' - class: Dist::Zilla::Plugin::CheckBin config: Dist::Zilla::Plugin::CheckBin: command: - git name: CheckBin version: '0.007' - class: Dist::Zilla::Plugin::AutoPrereqs name: AutoPrereqs version: '5.037' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '5.037' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: recommends name: TestRecommends version: '5.037' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: '5.037' - class: Dist::Zilla::Plugin::GithubMeta name: GithubMeta version: '0.54' - class: Dist::Zilla::Plugin::InstallGuide name: InstallGuide version: '1.200006' - class: Dist::Zilla::Plugin::MetaConfig name: MetaConfig version: '5.037' - class: Dist::Zilla::Plugin::MetaJSON name: MetaJSON version: '5.037' - class: Dist::Zilla::Plugin::NextRelease name: NextRelease version: '5.037' - class: Dist::Zilla::Plugin::PkgVersion name: PkgVersion version: '5.037' - class: Dist::Zilla::Plugin::PodSyntaxTests name: PodSyntaxTests version: '5.037' - class: Dist::Zilla::Plugin::PodCoverageTests name: PodCoverageTests version: '5.037' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.012' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.012' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Default/SingleEncoding' version: '4.012' - class: Pod::Weaver::Section::Name name: '@Default/Name' version: '4.012' - class: Pod::Weaver::Section::Version name: '@Default/Version' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Default/prelude' version: '4.012' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.012' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.012' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.012' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.012' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.012' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.012' - class: Pod::Weaver::Section::Leftovers name: '@Default/Leftovers' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Default/postlude' version: '4.012' - class: Pod::Weaver::Section::Authors name: '@Default/Authors' version: '4.012' - class: Pod::Weaver::Section::Legal name: '@Default/Legal' version: '4.012' name: PodWeaver version: '4.006' - class: Dist::Zilla::Plugin::CopyFilesFromBuild name: CopyFilesFromBuild version: '0.151680' - class: Dist::Zilla::Plugin::Run::BeforeBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 0 run: - 'rm -f Makefile.PL' name: Run::BeforeBuild version: '0.039' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 0 run: - 'cp %d/Makefile.PL ./' - 'git status --porcelain | grep "M Makefile.PL" && git commit -m "auto-committed by dist.ini" Makefile.PL || echo Makefile.PL up to date' name: Run::AfterBuild version: '0.039' - class: Dist::Zilla::Plugin::Run::Release config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 0 run: - 'mv %a ./releases/' name: Run::Release version: '0.039' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: - releases commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: Git::Commit version: '2.036' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v0.045 tag_format: v%v tag_message: v%v Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: Git::Tag version: '2.036' - class: Dist::Zilla::Plugin::Twitter name: Twitter version: '0.026' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '5.037' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '5.037' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '5.037' Git-Wrapper-0.045/README.md000644 000765 000024 00000001023 12552752121 016050 0ustar00genehackstaff000000 000000 # Git::Wrapper Wrap git(7) command-line interface ## VERSION [![CPAN version](https://badge.fury.io/pl/Git-Wrapper.svg)](http://badge.fury.io/pl/Git-Wrapper) ## BUILD INFO [![Build Status](https://travis-ci.org/genehack/Git-Wrapper.svg?branch=master)](https://travis-ci.org/genehack/Git-Wrapper) [![Coverage Status](https://coveralls.io/repos/genehack/Git-Wrapper/badge.svg?branch=master)](https://coveralls.io/r/genehack/Git-Wrapper?branch=master) ## USAGE See [documentation on CPAN](https://metacpan.org/pod/Git::Wrapper) Git-Wrapper-0.045/t/000755 000765 000024 00000000000 12552752121 015040 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/t/00-load.t000644 000765 000024 00000000463 12552752121 016364 0ustar00genehackstaff000000 000000 use Test::More tests => 6; BEGIN { use_ok('Git::Wrapper::Status'); use_ok('Git::Wrapper::Statuses'); use_ok('Git::Wrapper::Exception'); use_ok('Git::Wrapper::File::RawModification'); use_ok('Git::Wrapper::Log'); use_ok('Git::Wrapper'); } diag( "Testing Git::Wrapper $Git::Wrapper::VERSION" ); Git-Wrapper-0.045/t/author-err.t000644 000765 000024 00000002425 12552752121 017320 0ustar00genehackstaff000000 000000 BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; use File::Temp qw(tempdir); use Git::Wrapper; my $dir = tempdir(CLEANUP => 1); my $git = Git::Wrapper->new($dir); $git->init; $git->config( 'user.name' , 'Test User' ); $git->config( 'user.email' , 'test@example.com' ); ## test ->ERR, ->OUT # this is an author test because I don't think github would appreciate # everybody pulling this remote every time this module gets installed. Plus I # don't think people want to wait for it happen. So, author test. Hopefully # that's sufficient, it's a fairly simple bit of code. { my @out = $git->remote( 'add' , 'test' , 'https://genehack@github.com/genehack/Git-Wrapper.git' ); my $err = $git->ERR; is( ref $err , 'ARRAY' , 'get arrayref' ); is_deeply( $err , [] , 'nothing on err' ); is_deeply( \@out , [] , 'nothing on out' ); } { my @out = $git->remote({ 'verbose' => 1 } , 'update' ); my $err = $git->ERR; is( ref $err , 'ARRAY' , 'get arrayref' ); like( $err->[0] , qr/POST git-upload-pack/ , 'expected content' ); my $alt_out = $git->OUT; is_deeply( \@out , $alt_out , 'outputs are the same' ); } done_testing(); Git-Wrapper-0.045/t/basic.t000644 000765 000024 00000013226 12552752121 016312 0ustar00genehackstaff000000 000000 use strict; use warnings; use Test::More; use File::Temp qw(tempdir); use IO::File; use Git::Wrapper; use File::Spec; use File::Path qw(mkpath); use POSIX qw(strftime); use Sort::Versions; use Test::Deep; use Test::Exception; my $dir = tempdir(CLEANUP => 1); my $git = Git::Wrapper->new($dir); my $version = $git->version; if ( versioncmp( $git->version , '1.5.0') eq -1 ) { plan skip_all => "Git prior to v1.5.0 doesn't support 'config' subcmd which we need for this test." } diag( "Testing git version: " . $version ); $git->init; # 'git init' also added in v1.5.0 so we're safe $git->config( 'user.name' , 'Test User' ); $git->config( 'user.email' , 'test@example.com' ); # make sure git isn't munging our content so we have consistent hashes $git->config( 'core.autocrlf' , 'false' ); $git->config( 'core.safecrlf' , 'false' ); mkpath(File::Spec->catfile($dir, 'foo')); IO::File->new(File::Spec->catfile($dir, qw(foo bar)), '>:raw')->print("hello\n"); is_deeply( [ $git->ls_files({ o => 1 }) ], [ 'foo/bar' ], ); $git->add('.'); is_deeply( [ $git->ls_files ], [ 'foo/bar' ], ); SKIP: { skip 'testing old git without porcelain' , 1 unless $git->supports_status_porcelain; is( $git->status->is_dirty , 1 , 'repo is dirty' ); } my $time = time; $git->commit({ message => "FIRST\n\n\tBODY\n" }); SKIP: { skip 'testing old git without porcelain' , 1 unless $git->supports_status_porcelain; is( $git->status->is_dirty , 0 , 'repo is clean' ); } my @rev_list = $git->rev_list({ all => 1, pretty => 'oneline' }); is(@rev_list, 1); like($rev_list[0], qr/^[a-f\d]{40} FIRST$/); my $args = $git->supports_log_raw_dates ? { date => 'raw' } : {}; my @log = $git->log( $args ); is(@log, 1, 'one log entry'); my $log = $log[0]; is($log->id, (split /\s/, $rev_list[0])[0], 'id'); is($log->message, "FIRST\n\n\tBODY\n", "message"); throws_ok { $git->log( "--format=%H" ) } q{Git::Wrapper::Exception}; SKIP: { skip 'testing old git without raw date support' , 1 unless $git->supports_log_raw_dates; my $log_date = $log->date; $log_date =~ s/ [+-]\d+$//; cmp_ok(( $log_date - $time ), '<=', 5, 'date'); } SKIP: { skip 'testing old git without no abbrev commit support' , 1 unless $git->supports_log_no_abbrev_commit; $git->config( 'log.abbrevCommit', 'true' ); @log = $git->log( $args ); $log = $log[0]; is($log->id, (split /\s/, $rev_list[0])[0], 'id'); } SKIP: { if ( versioncmp( $git->version , '1.6.3') eq -1 ) { skip 'testing old git without log --oneline support' , 3; } throws_ok { $git->log('--oneline') } qr/^unhandled/ , 'log(--oneline) dies'; my @lines; lives_ok { @lines = $git->RUN('log' , '--oneline' ) } 'RUN(log --oneline) lives'; is( @lines , 1 , 'one log entry' ); } my @raw_log = $git->log({ raw => 1 }); is(@raw_log, 1, 'one raw log entry'); SKIP: { if ( $^O eq "MSWin32" ) { skip 'testing file permissions on Windows is unreliable; see also core.filemode', 1; } my $raw_log = $raw_log[0]; my $excepted_mod = Git::Wrapper::File::RawModification->new( "foo/bar","A",'000000','100644','0000000000000000000000000000000000000000','ce013625030ba8dba906f756967f9e9ca394464a' ); is_deeply($raw_log->modifications, $excepted_mod); } sub _timeout (&) { my ($code) = @_; my $timeout = 0; eval { local $SIG{ALRM} = sub { $timeout = 1; die "TIMEOUT\n" }; # 5 seconds should be more than enough time to fail properly alarm 5; $code->(); alarm 0; }; return $timeout; } my $commit_count = 1; SKIP: { if ( versioncmp( $git->version , '1.7.0.5') eq -1 ) { skip 'testing old git without commit --allow-empty-message support' , 1; } # Test empty commit message IO::File->new(">" . File::Spec->catfile($dir, qw(second_commit)))->print("second_commit\n"); $git->add('second_commit'); # If this fails there's a distinct danger it will hang indefinitely my $timeout = _timeout { $git->commit }; ok !$timeout && $@, 'Attempt to commit interactively fails quickly' or diag "Timed out!"; $timeout = _timeout { $git->commit({ message => "", 'allow-empty-message' => 1 }); }; if ( $@ && !$timeout ) { my $msg = substr($@,0,50); skip $msg, 1; } @log = $git->log(); is(@log, 2, 'two log entries, one with empty commit message'); $commit_count++; }; my @out = $git->RUN('log','--format=%H'); ok scalar @out == $commit_count, q{using RUN('log','--format=%H') to get all 2 commit SHAs}; # test --message vs. -m my @arg_tests = ( ['message', 'long_arg_no_spaces', 'long arg, no spaces in val', ], ['message', 'long arg with spaces', 'long arg, spaces in val', ], ['m', 'short_arg_no_spaces', 'short arg, no spaces in val', ], ['m', 'short arg w spaces', 'short arg, spaces in val', ], ); my $arg_file = IO::File->new('>' . File::Spec->catfile($dir, qw(argument_testfile))); for my $arg_test (@arg_tests) { my ($flag, $msg, $descr) = @$arg_test; $arg_file->print("$msg\n"); $git->add('argument_testfile'); $git->commit({ $flag => $msg }); my ($arg_log) = $git->log('-n 1'); is $arg_log->message, "$msg\n", "argument test: $descr"; } $git->checkout({b => 'new_branch'}); my ($new_branch) = grep {m/^\*/} $git->branch; $new_branch =~ s/^\*\s+|\s+$//g; is $new_branch, 'new_branch', 'new branch name is correct'; SKIP: { skip 'testing old git without no-filters' , 1 unless $git->supports_hash_object_filters; my ($hash) = $git->hash_object({ no_filters => 1, stdin => 1, -STDIN => 'content to hash', }); is $hash, '4b06c1f876b16951b37f4d6755010f901100f04e', 'passing content with -STDIN option'; } done_testing(); Git-Wrapper-0.045/t/git_binary.t000755 000765 000024 00000001632 12552752121 017361 0ustar00genehackstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More; use Test::Exception; use File::Temp qw(tempdir); use Git::Wrapper; my $dir = tempdir(CLEANUP => 1); { my $git = Git::Wrapper->new({ dir => $dir , git_binary => 'echo' }); my @got = $git->RUN('marco'); # apparently some versions of windows include extra bonus whitespace, so the # simple way of testing this fails sometimes. so... is( scalar @got , 1 , 'only get one line' ); like( $got[0] , qr/^marco\s*$/ , 'Wrapper runs what ever binary we tell it to' ); } { dies_ok { my $git = Git::Wrapper->new() } 'need a dir'; dies_ok { my $git = Git::Wrapper->new(['foo']) } 'need to call properly'; dies_ok { my $git = Git::Wrapper->new([dir => 'foo']) } 'no, really, need to call properly'; dies_ok { my $git = Git::Wrapper->new({ git_binary => "$dir/echo" }) } 'just git_binary fails'; } done_testing(); Git-Wrapper-0.045/t/parse_args.t000644 000765 000024 00000004107 12552752121 017355 0ustar00genehackstaff000000 000000 use strict; use warnings; use Test::More; use Git::Wrapper; my @data = ( # input , #output [ [ 'status' ] , 'git status' ] , [ [ 'status' , { init => 1 } ] , 'git status --init' ] , [ [ 'status' , { init => 1 , -STDIN => 'foo bar baz' } ] , 'git status --init' , 'foo bar baz' ] , [ [ 'status' , { init => 1 , -pre => 'bar' } ] , 'git --pre=bar status --init' ] , [ [ 'status' , { init => 1 } , 'file' , { -pre => 'bar' } ] , 'git --pre=bar status --init file' ] , [ [ 'status' , { init => 1 } , 'file' , { -pre => 'bar' , -STDIN => 'foo bar baz' } ] , 'git --pre=bar status --init file' , 'foo bar baz' ] , [ [ 'status' , { init => 1 } , 'file' , { -pre => 'bar' , post => 1 } ] , 'git --pre=bar status --init file --post' ] , [ [ 'status' , { arg => 'barg' , -pre => 'bar' } , 'file' , { post => 1 } ] , 'git --pre=bar status --arg=barg file --post' ] , [ [ 'status' , { init => 1 , -pre => 'bar' } , qw/ file1 file2 file3 / , { post => 1 } ] , 'git --pre=bar status --init file1 file2 file3 --post' ] , [ [ 'status' , { -a => 1, -b => 'foo', -cd => 1, -ef => 'foo', g => 1, h => 'bar', ij => 1, jk => 'baz' } ] , 'git -a -b foo --cd --ef=foo status -g -h bar --ij --jk=baz', ] , [ [ 'rev-list' , qw/ --all --not master / , { remotes => '*trunk*' } , qw/ -- filename / ] , 'git rev-list --all --not master --remotes=*trunk* -- filename' ], [ [ 'submodule' , 'update' , { init => 1 } ] , 'git submodule update --init' ], [ [ 'submodule' , { -STDIN => 'foo bar baz' } , 'update' , { init => 1 } ] , 'git submodule update --init', 'foo bar baz' ], ); my $test_case = 1; foreach ( @data ) { my( $input , $expected_cli , $expected_stdin ) = @$_; my( $parts , $stdin ) = Git::Wrapper::_parse_args( @$input ); my $output = join ' ' , ( 'git' , @$parts ); is( $output , $expected_cli , "Expected for '$expected_cli' (CASE:$test_case)" ); is( $stdin , $expected_stdin , "Expected STDIN (CASE:$test_case)" ); $test_case++; } done_testing(); Git-Wrapper-0.045/t/path_class.t000644 000765 000024 00000002764 12552752121 017357 0ustar00genehackstaff000000 000000 use strict; use warnings; use Test::More; use File::Temp qw(tempdir); use Git::Wrapper; use POSIX qw(strftime); use Sort::Versions; use Test::Deep; use Test::Exception; eval "use Path::Class 0.26; 1" or plan skip_all => "Path::Class 0.26 is required for this test."; my $tempdir = tempdir(CLEANUP => 1); my $dir = Path::Class::dir($tempdir); my $git = Git::Wrapper->new($dir); my $version = $git->version; if ( versioncmp( $git->version , '1.5.0') eq -1 ) { plan skip_all => "Git prior to v1.5.0 doesn't support 'config' subcmd which we need for this test." } diag( "Testing git version: " . $version ); $git->init; # 'git init' also added in v1.5.0 so we're safe $git->config( 'user.name' , 'Test User' ); $git->config( 'user.email' , 'test@example.com' ); # make sure git isn't munging our content so we have consistent hashes $git->config( 'core.autocrlf' , 'false' ); $git->config( 'core.safecrlf' , 'false' ); my $foo = $dir->subdir('foo'); $foo->mkpath; $foo->file('bar')->spew(iomode => '>:raw', "hello\n"); is_deeply( [ $git->ls_files({ o => 1 }) ], [ 'foo/bar' ], ); $git->add(Path::Class::dir('.')); is_deeply( [ $git->ls_files ], [ 'foo/bar' ], ); SKIP: { skip "Fails on Mac OS X with Git version < 1.7.5 for unknown reasons." , 1 if (($^O eq 'darwin') and ( versioncmp( $git->version , '1.7.5') eq -1 )); $git->commit({ message => "FIRST\n\n\tBODY\n" }); my $baz = $dir->file('baz'); $baz->spew("world\n"); $git->add($baz); ok(1); } done_testing(); Git-Wrapper-0.045/t/release-pod-coverage.t000644 000765 000024 00000000572 12552752121 021222 0ustar00genehackstaff000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Git-Wrapper-0.045/t/release-pod-syntax.t000644 000765 000024 00000000456 12552752121 020756 0ustar00genehackstaff000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Git-Wrapper-0.045/lib/Git/000755 000765 000024 00000000000 12552752121 016066 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/lib/Git/Wrapper/000755 000765 000024 00000000000 12552752121 017506 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/lib/Git/Wrapper.pm000644 000765 000024 00000060254 12552752121 020053 0ustar00genehackstaff000000 000000 use 5.006; use strict; use warnings; package Git::Wrapper; #ABSTRACT: Wrap git(7) command-line interface $Git::Wrapper::VERSION = '0.045'; our $DEBUG=0; # Prevent ANSI color with extreme prejudice # https://github.com/genehack/Git-Wrapper/issues/13 delete $ENV{GIT_PAGER_IN_USE}; use File::chdir; use File::Temp; use IPC::Open3 qw(); use Scalar::Util qw(blessed); use Sort::Versions; use Symbol; use Git::Wrapper::Exception; use Git::Wrapper::File::RawModification; use Git::Wrapper::Log; use Git::Wrapper::Statuses; sub new { my $class = shift; # three calling conventions # 1: my $gw = Git::Wrapper->new( $dir ) # 2: my $gw = Git::Wrapper->new( $dir , %options ) # 3: my $gw = Git::Wrapper->new({ dir => $dir , %options }); my $args; if ( scalar @_ == 1 ) { my $arg = shift; if ( ref $arg eq 'HASH' ) { $args = $arg } elsif ( blessed $arg ) { $args = { dir => "$arg" } } # my objects, let me # show you them. elsif ( ! ref $arg ) { $args = { dir => $arg } } else { die "Single arg must be hashref, scalar, or stringify-able object" } } else { my( $dir , %opts ) = @_; $dir = "$dir" if blessed $dir; # we can stringify it for you wholesale $args = { dir => $dir , %opts } } my $self = bless $args => $class; die "usage: $class->new(\$dir)" unless $self->dir; return $self; } sub AUTOLOAD { my $self = shift; (my $meth = our $AUTOLOAD) =~ s/.+:://; return if $meth eq 'DESTROY'; $meth =~ tr/_/-/; return $self->RUN($meth, @_); } sub ERR { shift->{err} } sub OUT { shift->{out} } sub RUN { my $self = shift; delete $self->{err}; delete $self->{out}; my $cmd = shift; my( $parts , $stdin ) = _parse_args( $cmd , @_ ); my @cmd = ( $self->git , @$parts ); my( @out , @err ); { local $CWD = $self->dir unless $cmd eq 'clone'; my ($wtr, $rdr, $err); local *TEMP; if ($^O eq 'MSWin32' && defined $stdin) { my $file = File::Temp->new; $file->autoflush(1); $file->print($stdin); $file->seek(0,0); open TEMP, '<&=', $file; $wtr = '<&TEMP'; undef $stdin; } $err = Symbol::gensym; print STDERR join(' ',@cmd),"\n" if $DEBUG; # Prevent commands from running interactively local $ENV{GIT_EDITOR} = ' '; my $pid = IPC::Open3::open3($wtr, $rdr, $err, @cmd); print $wtr $stdin if defined $stdin; close $wtr; chomp(@out = <$rdr>); chomp(@err = <$err>); waitpid $pid, 0; }; print "status: $?\n" if $DEBUG; # In earlier gits (1.5, 1.6, I'm not sure when it changed), "git status" # would exit 1 if there was nothing to commit, or in other cases. This is # basically insane, and has been fixed, but if we don't require git 1.7, we # should cope with it. -- rjbs, 2012-03-31 my $stupid_status = $cmd eq 'status' && @out && ! @err; if ($? && ! $stupid_status) { die Git::Wrapper::Exception->new( output => \@out, error => \@err, status => $? >> 8, ); } chomp(@err); $self->{err} = \@err; chomp(@out); $self->{out} = \@out; return @out; } sub branch { my $self = shift; my $opt = ref $_[0] eq 'HASH' ? shift : {}; $opt->{no_color} = 1; return $self->RUN(branch => $opt,@_); } sub dir { shift->{dir} } sub git { my $self = shift; return $self->{git_binary} if defined $self->{git_binary}; return ( defined $ENV{GIT_WRAPPER_GIT} ) ? $ENV{GIT_WRAPPER_GIT} : 'git'; } sub has_git_in_path { require IPC::Cmd; IPC::Cmd::can_run('git'); } sub log { my $self = shift; if ( grep /format=/, @_ ) { die Git::Wrapper::Exception->new( error => [qw/--format not allowed. Use the RUN() method if you with to use a custom log format./], output => undef, status => 255 , ); } my $opt = ref $_[0] eq 'HASH' ? shift : {}; $opt->{no_color} = 1; $opt->{pretty} = 'medium'; $opt->{no_abbrev} = 1; # https://github.com/genehack/Git-Wrapper/issues/67 $opt->{no_abbrev_commit} = 1 if $self->supports_log_no_abbrev_commit; my $raw = defined $opt->{raw} && $opt->{raw}; my @out = $self->RUN(log => $opt, @_); my @logs; while (my $line = shift @out) { die "unhandled: $line" unless $line =~ /^commit (\S+)/; my $current = Git::Wrapper::Log->new($1); $line = shift @out; # next line; while ($line =~ /^(\S+):\s+(.+)$/) { $current->attr->{lc $1} = $2; $line = shift @out; # next line; } die "no blank line separating head from message" if $line; my ( $initial_indent ) = $out[0] =~ /^(\s*)/ if @out; my $message = ''; while ( @out and $out[0] !~ /^commit (\S+)/ and length($line = shift @out) ) { $line =~ s/^$initial_indent//; # strip just the indenting added by git $message .= "$line\n"; } $current->message($message); if ($raw) { my @modifications; # example output: # :000000 100644 0000000000000000000000000000000000000000 ce013625030ba8dba906f756967f9e9ca394464a A foo/bar while(@out and $out[0] =~ m/^\:(\d{6}) (\d{6}) (\w{40}) (\w{40}) (\w{1})\t(.*)$/) { push @modifications, Git::Wrapper::File::RawModification->new($6,$5,$1,$2,$3,$4); shift @out; } $current->modifications(@modifications) if @modifications; } push @logs, $current; last unless @out; # handle running out of log shift @out unless $out[0] =~ /^commit/; # blank line at end of entry, except merge commits; } return @logs; } my %STATUS_CONFLICTS = map { $_ => 1 } qw
; sub status { my $self = shift; return $self->RUN('status' , @_ ) unless $self->supports_status_porcelain; my $opt = ref $_[0] eq 'HASH' ? shift : {}; $opt->{$_} = 1 for qw; my @out = $self->RUN(status => $opt, @_); my $statuses = Git::Wrapper::Statuses->new; return $statuses if !@out; for (@out) { my ($x, $y, $from, $to) = $_ =~ /\A(.)(.) (.*?)(?: -> (.*))?\z/; if ($STATUS_CONFLICTS{"$x$y"}) { $statuses->add('conflict', "$x$y", $from, $to); } elsif ($x eq '?' && $y eq '?') { $statuses->add('unknown', '?', $from, $to); } else { $statuses->add('changed', $y, $from, $to) if $y ne ' '; $statuses->add('indexed', $x, $from, $to) if $x ne ' '; } } return $statuses; } sub supports_hash_object_filters { my $self = shift; # The '--no-filters' option to 'git-hash-object' was added in version 1.6.1 return 0 if ( versioncmp( $self->version , '1.6.1' ) eq -1 ); return 1; } sub supports_log_no_abbrev_commit { my $self = shift; # The '--no-abbrev-commit' option to 'git log' was added in version 1.7.6 return ( versioncmp( $self->version , '1.7.6' ) eq -1 ) ? 0 : 1; } sub supports_log_raw_dates { my $self = shift; # The '--date=raw' option to 'git log' was added in version 1.6.2 return 0 if ( versioncmp( $self->version , '1.6.2' ) eq -1 ); return 1; } sub supports_status_porcelain { my $self = shift; # The '--porcelain' option to git status was added in version 1.7.0 return 0 if ( versioncmp( $self->version , '1.7' ) eq -1 ); return 1; } sub version { my $self = shift; my ($version) = $self->RUN('version'); $version =~ s/^git version //; return $version; } sub _message_tempfile { my ( $message ) = @_; my $tmp = File::Temp->new( UNLINK => 0 ); $tmp->print( $message ); return ( "file", '"'.$tmp->filename.'"' ); } sub _opt_and_val { my( $name , $val ) = @_; $name =~ tr/_/-/; my $opt = length($name) == 1 ? "-$name" : "--$name" ; return $val eq '1' ? ($opt) : length($name) == 1 ? ($opt, $val) : "$opt=$val"; } sub _parse_args { my $cmd = shift; die "initial argument must not be a reference\n" if ref $cmd; my( $stdin , @pre_cmd , @post_cmd ); foreach ( @_ ) { if ( ref $_ eq 'HASH' ) { $stdin = delete $_->{-STDIN} if exists $_->{-STDIN}; for my $name ( sort keys %$_ ) { my $val = delete $_->{$name}; next if $val eq '0'; if ( $name =~ s/^-// ) { push @pre_cmd , _opt_and_val( $name , $val ); } else { ( $name, $val ) = _message_tempfile( $val ) if _win32_multiline_commit_msg( $cmd, $name, $val ); push @post_cmd , _opt_and_val( $name , $val ); } } } elsif ( blessed $_ ) { push @post_cmd , "$_"; # here be anteaters } elsif ( ref $_ ) { die "Git::Wrapper command arguments must be plain scalars, hashrefs, " . "or stringify-able objects.\n"; } else { push @post_cmd , $_; } } return( [ @pre_cmd , $cmd , @post_cmd ] , $stdin ); } sub _win32_multiline_commit_msg { my ( $cmd, $name, $val ) = @_; return 0 if $^O ne "MSWin32"; return 0 if $cmd ne "commit"; return 0 if $name ne "m" and $name ne "message"; return 0 if $val !~ /\n/; return 1; } __END__ =pod =encoding UTF-8 =head1 NAME Git::Wrapper - Wrap git(7) command-line interface =head1 VERSION version 0.045 =head1 SYNOPSIS my $git = Git::Wrapper->new('/var/foo'); $git->commit(...) print $_->message for $git->log; # specify which git binary to use my $git = Git::Wrapper->new({ dir => '/var/foo , git_binary => '/path/to/git/bin/git' , }); =head1 DESCRIPTION Git::Wrapper provides an API for git(7) that uses Perl data structures for argument passing, instead of CLI-style C<--options> as L does. =head1 METHOD INVOCATION Except as documented, every git subcommand is available as a method on a Git::Wrapper object. Replace any hyphens in the git command with underscores (for example, C would become C<< $git->init_db >>). =head2 Method Arguments Methods accept a combination of hashrefs and scalars, which is used to build the command used to invoke git. Arguments passed in hashrefs will be automatically parsed into option pairs, but the ordering of these in the resulting shell command is not guaranteed (with the exception of options with a leading '-'; see below). Options that are passed as plain scalars will retain their order. Some examples may help clarify. This code: $git->commit({ message => "stuff" , all => 1 }); may produce this shell command: git commit --all --message="stuff" This code, however: $git->commit(qw/ --message "stuff" / , { all => 1 }); will always produce this shell command: git commit --message "stuff" --all In most cases, this exact control over argument ordering is not needed and simply passing all options as part of a hashref, and all other options as additional list arguments, will be sufficient. In some cases, however, the ordering of options to particular git sub-commands is significant, resulting in the need for this level of control. I Options that are given with a leading '-' (with the exception of special options noted below) are applied as arguments to the C command itself; options without a leading '-' are applied as arguments to the sub-command. For example: $git->command({ -foo => 1 , bar => 2 }); invokes the command line git --foo=1 command --bar=2 I Because of the way arguments are parsed, should you need to pass an explicit '0' value to an option (for example, to have the same effect as C<--abbrev=0> on the command line), you should pass it with a leading space, like so: $git->describe({ abbrev => ' 0' }; To pass content via STDIN, use the -STDIN option: $git->hash_object({ stdin => 1, -STDIN => 'content to hash' }); Output is available as an array of lines, each chomped. @sha1s_and_titles = $git->rev_list({ all => 1, pretty => 'oneline' }); =head3 Passing stringify-able objects as arguments Objects may be passed in the place of scalars, assuming those objects overload stringification in such a way as to produce a useful value. However, relying on this stringification is discouraged and likely to be officially deprecated in a subsequent release. Instead, if you have an object that stringifies to a meaningful value (I, a L object), you should stringify it yourself before passing it to C methods. =head2 Error handling If a git command exits nonzero, a C object will be thrown (via C) and may be capture via C or L, for example. The error object has three useful methods: =over =item * error Returns the full error message reported by the resulting git command sent to C. This method should not be used as a success/failure check, as C will sometimes produce output on STDERR when a command is successful. =item * output Returns the full output generated by the git command that is sent to C. This method should not be used as a success/failure check, as C will frequently not have any output with a successful command. =item * status Returns the non-zero exit code reported by git on error =back =head3 Using Try::Tiny L is the recommended way to catch exception objects thrown by L. use Try::Tiny my $git = Git::Wrapper->new('/path/to/my/repo'); try { # equivalent to, "git --non-existent-option=1" on the commandline $git->status({ "non-existent-option"=>1 }); } catch { # print STERR from erroneous git command print $_->error; # print STOUT from git command print $_->output; # print non-zero exist status of git processo print $_->status; # quotes are overloaded, so: print "$_"; # equivalent to $_->error }; =head3 Using C If for some reason you are unable to use L, it is also possible to use the C function to catch exception objects. B my $git = Git::Wrapper->new('/path/to/my/repo'); my $ok = eval { # equivalent to, "git --non-existent-option=1" on the commandline $git->status({ "non-existent-option"=>1 }); 1; }; if ($@ and ref $@ eq q{Git::Wrapper::Exception}) { # print STERR from erroneous git command print $@->error; # print STOUT from git command print $@->output; # print non-zero exist status of git processo print $@->status; # quotes are overloaded, so: print "$@"; # equivalent to $@->error } =head1 METHODS =head2 new my $git = Git::Wrapper->new($dir); my $git = Git::Wrapper->new({ dir => $dir , git_binary => '/path/to/git' }); # To force the git binary location my $git = Git::Wrapper->new($dir, 'git_binary' => '/usr/local/bin/git'); =head2 git print $git->git; # /path/to/git/binary/being/used =head2 dir print $git->dir; # /var/foo =head2 version my $version = $git->version; # 1.6.1.4.8.15.16.23.42 =head2 branch my @branches = $git->branch; This command intentionally disables ANSI color highlighting in the output. If you want ANSI color highlighting, you'll need to bypass via the RUN() method (see below). =head2 log my @logs = $git->log; Instead of giving back an arrayref of lines, the C method returns a list of C objects. There are five methods in a C objects: =over =item * id =item * author =item * date =item * message =item * modifications Only populated with when C<< raw => 1 >> option is set; see L below. =back =head3 Raw logs Calling the C method with the C<< raw => 1 >> option set, as below, will do additional parsing to populate the C attribute on each C object. This method returns a list of C objects, with can be used to get filenames, permissions, and other metadata associated with individual files in the given commit. A short example, to loop over all commits in the log and print the filenames that were changed in each commit, one filename per file: my @logs = $git->log({ raw => 1 }); foreach my $log ( @logs ) { say "In commit '" . $log->id . "', the following files changed:"; my @mods = $log->modifications; foreach my $mod ( @mods ) { say "\t" . $mod->filename; } } Note that some commits (e.g., merge commits) will not contain any file changes. The C method will return an empty list in that case. =head3 Custom log formats C will throw an exception if it is passed the C<--format> option. The reason for this has to do with the fact that the parsing of the full log output into C objects assumes the default format provided by `git` itself. Passing C<--format> to the underlying `git log` method affects this assumption and the output is no longer able to be processed as intented. If you wish to specify a custom log format, please use the L method directly. The caller will be supplied with the full log output. From there, the caller may process the output as it wishes. =head2 has_git_in_path This method returns a true or false value indicating if there is a 'git' binary in the current $PATH. =head2 supports_status_porcelain =head2 supports_log_no_abbrev_commit =head2 supports_log_raw_dates =head2 supports_hash_object_filters These methods return a true or false value (1 or 0) indicating whether the git binary being used has support for these options. (The '--porcelain' option on 'git status', the '--no-abbrev-commit' and '--date=raw' options on 'git log', and the '--no-filters' option on 'git hash-object' respectively.) These are primarily for use in this distribution's test suite, but may also be useful when writing code using Git::Wrapper that might be run with different versions of the underlying git binary. =head2 status When running with an underlying git binary that returns false for the L method, this method will act like any other wrapped command: it will return output as an array of chomped lines. When running with an underlying git binary that returns true for the L method, this method instead returns an instance of Git::Wrapper::Statuses: my $statuses = $git->status; Git::Wrapper:Statuses has two public methods. First, C: my $dirty_flag = $statuses->is_dirty; which returns a true/false value depending on whether the repository has any uncommitted changes. Second, C: my @status = $statuses->get($group) which returns an array of Git::Wrapper::Status objects, one per file changed. There are four status groups, each of which may contain zero or more changes. =over =item * indexed : Changed & added to the index (aka, will be committed) =item * changed : Changed but not in the index (aka, won't be committed) =item * unknown : Untracked files =item * conflict : Merge conflicts =back Note that a single file can occur in more than one group. Eg, a modified file that has been added to the index will appear in the 'indexed' list. If it is subsequently further modified it will additionally appear in the 'changed' group. A Git::Wrapper::Status object has three methods you can call: my $from = $status->from; The file path of the changed file, relative to the repo root. For renames, this is the original path. my $to = $status->to; Renames returns the new path/name for the path. In all other cases returns an empty string. my $mode = $status->mode; Indicates what has changed about the file. Within each group (except 'conflict') a file can be in one of a number of modes, although some modes only occur in some groups (eg, 'added' never appears in the 'unknown' group). =over =item * modified =item * added =item * deleted =item * renamed =item * copied =item * conflict =back All files in the 'unknown' group will have a mode of 'unknown' (which is redundant but at least consistent). The 'conflict' group instead has the following modes. =over =item * 'both deleted' : deleted on both branches =item * 'both added' : added on both branches =item * 'both modified' : modified on both branches =item * 'added by us' : added only on our branch =item * 'deleted by us' : deleted only on our branch =item * 'added by them' : added on the branch we are merging in =item * 'deleted by them' : deleted on the branch we are merging in =back See git-status man page for more details. =head3 Example my $git = Git::Wrapper->new('/path/to/git/repo'); my $statuses = $git->status; for my $type (qw) { my @states = $statuses->get($type) or next; print "Files in state $type\n"; for (@states) { print ' ', $_->mode, ' ', $_->from; print ' renamed to ', $_->to if $_->mode eq 'renamed'; print "\n"; } } =head2 RUN This method bypasses the output rearranging performed by some of the wrapped methods described above (i.e., C, C, etc.). This can be useful in various situations, such as when you want to produce a particular log output format that isn't compatible with the way C constructs C, or when you want raw C output that isn't parsed into a object. This method should be called with an initial string argument of the C subcommand you want to run, followed by a hashref containing options and their values, and then a list of any other arguments. =head3 Example my $git = Git::Wrapper->new( '/path/to/git/repo' ); # the 'log' method returns Git::Wrapper::Log objects my @log_objects = $git->log(); # while 'RUN('log')' returns an array of chomped lines my @log_lines = $git->RUN('log'); # getting the full of commit SHAs via `git log` by using the '--format' option my @log_lines = $git->RUN('log', '--format=%H'); =head2 ERR After a command has been run, this method will return anything that was sent to C, in the form of an array of chomped lines. This information will be cleared as soon as a new command is executed. This method should B<*NOT*> be used as a success/failure check, as C will sometimes produce output on STDERR when a command is successful. =head2 OUT After a command has been run, this method will return anything that was sent to C, in the form of an array of chomped lines. It is identical to what is returned from the method call that runs the command, and is provided simply for symmetry with the C method. This method should B<*NOT*> be used as a success/failure check, as C will frequently not have any output with a successful command. =head1 COMPATIBILITY On Win32 Git::Wrapper is incompatible with msysGit installations earlier than Git-1.7.1-preview20100612 due to a bug involving the return value of a git command in cmd/git.cmd. If you use the msysGit version distributed with GitExtensions or an earlier version of msysGit, tests will fail during installation of this module. You can get the latest version of msysGit on the Google Code project page: L =head1 ENVIRONMENT VARIABLES Git::Wrapper normally uses the first 'git' binary in your path. The original override provided to change this was by setting the GIT_WRAPPER_GIT environment variable. Now that object creation accepts an override, you are encouraged to instead pass the binary location (git_binary) to new on object creation. =head1 SEE ALSO L is the git implementation for L, a generic interface to version-control systems. L is a list of other Git interfaces in Perl. If L doesn't scratch your itch, possibly one of the modules listed there will. Git itself is at L. =head1 REPORTING BUGS & OTHER WAYS TO CONTRIBUTE The code for this module is maintained on GitHub, at L. If you have a patch, feel free to fork the repository and submit a pull request. If you find a bug, please open an issue on the project at GitHub. (We also watch the L queue for Git::Wrapper, so feel free to use that bug reporting system if you prefer) =head1 AUTHORS =over 4 =item * Hans Dieter Pearcey =item * Chris Prather =item * John SJ Anderson =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Git-Wrapper-0.045/lib/Git/Wrapper/Exception.pm000644 000765 000024 00000004256 12552752121 022011 0ustar00genehackstaff000000 000000 package Git::Wrapper::Exception; # ABSTRACT: Exception class for Git::Wrapper $Git::Wrapper::Exception::VERSION = '0.045'; use 5.006; use strict; use warnings; sub new { my $class = shift; bless { @_ } => $class } use overload ( q("") => '_stringify', fallback => 1, ); sub _stringify { my ($self) = @_; my $error = $self->error; return $error if $error =~ /\S/; return "git exited non-zero but had no output to stderr"; } sub output { join "", map { "$_\n" } @{ shift->{output} } } sub error { join "", map { "$_\n" } @{ shift->{error} } } sub status { shift->{status} } 1; __END__ =pod =encoding UTF-8 =head1 NAME Git::Wrapper::Exception - Exception class for Git::Wrapper =head1 VERSION version 0.045 =head1 SYNOPSIS A new error object may be generated and thrown as follows: die Git::Wrapper::Exception->new( output => \@out, # STDOUT error => \@err, # STERR status => $? >> 8, # git process exist status ); =head1 METHODS =head2 new The standard constuctor for this class. =head2 error Returns the full error message reported by the resulting git command sent to C. =head2 output Returns the full output generated by the git command that is sent to C. =head2 status Returns the non-zero exit code reported by git on error. =head1 SEE ALSO =head2 L In particular, see the section on Error handling. =head1 REPORTING BUGS & OTHER WAYS TO CONTRIBUTE The code for this module is maintained on GitHub, at L. If you have a patch, feel free to fork the repository and submit a pull request. If you find a bug, please open an issue on the project at GitHub. (We also watch the L queue for Git::Wrapper, so feel free to use that bug reporting system if you prefer) =head1 AUTHORS =over 4 =item * Hans Dieter Pearcey =item * Chris Prather =item * John SJ Anderson =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Git-Wrapper-0.045/lib/Git/Wrapper/File/000755 000765 000024 00000000000 12552752121 020365 5ustar00genehackstaff000000 000000 Git-Wrapper-0.045/lib/Git/Wrapper/Log.pm000644 000765 000024 00000003534 12552752121 020572 0ustar00genehackstaff000000 000000 package Git::Wrapper::Log; # ABSTRACT: Log line of the Git $Git::Wrapper::Log::VERSION = '0.045'; use 5.006; use strict; use warnings; sub new { my ($class, $id, %arg) = @_; my $modifications = defined $arg{modifications} ? delete $arg{modifications} : []; return bless { id => $id, attr => {}, modifications => $modifications, %arg, } => $class; } sub id { shift->{id} } sub attr { shift->{attr} } sub modifications { my $self = shift; if (@_ > 0) { $self->{modifications} = [@_]; return scalar @{$self->{modifications}}; } else { return @{$self->{modifications}} } } sub message { @_ > 1 ? ($_[0]->{message} = $_[1]) : $_[0]->{message} } sub date { shift->attr->{date} } sub author { shift->attr->{author} } 1; __END__ =pod =encoding UTF-8 =head1 NAME Git::Wrapper::Log - Log line of the Git =head1 VERSION version 0.045 =head1 METHODS =head2 new =head2 modifications =head2 attr =head2 author =head2 date =head2 id =head2 message =head1 SEE ALSO =head2 L =head1 REPORTING BUGS & OTHER WAYS TO CONTRIBUTE The code for this module is maintained on GitHub, at L. If you have a patch, feel free to fork the repository and submit a pull request. If you find a bug, please open an issue on the project at GitHub. (We also watch the L queue for Git::Wrapper, so feel free to use that bug reporting system if you prefer) =head1 AUTHORS =over 4 =item * Hans Dieter Pearcey =item * Chris Prather =item * John SJ Anderson =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Git-Wrapper-0.045/lib/Git/Wrapper/Status.pm000644 000765 000024 00000003516 12552752121 021334 0ustar00genehackstaff000000 000000 use 5.006; use strict; use warnings; package Git::Wrapper::Status; # ABSTRACT: A specific status information in the Git $Git::Wrapper::Status::VERSION = '0.045'; my %modes = ( M => 'modified', A => 'added', D => 'deleted', R => 'renamed', C => 'copied', U => 'conflict', '?' => 'unknown', DD => 'both deleted', AA => 'both added', UU => 'both modified', AU => 'added by us', DU => 'deleted by us', UA => 'added by them', UD => 'deleted by them', ); sub new { my ($class, $mode, $from, $to) = @_; return bless { mode => $mode, from => $from, to => $to, } => $class; } sub mode { $modes{ shift->{mode} } } sub from { shift->{from} } sub to { defined( $_[0]->{to} ) ? $_[0]->{to} : '' } 1; __END__ =pod =encoding UTF-8 =head1 NAME Git::Wrapper::Status - A specific status information in the Git =head1 VERSION version 0.045 =head1 METHODS =head2 new =head2 mode =head2 from =head2 to =head1 SEE ALSO =head2 L =head2 L =head1 REPORTING BUGS & OTHER WAYS TO CONTRIBUTE The code for this module is maintained on GitHub, at L. If you have a patch, feel free to fork the repository and submit a pull request. If you find a bug, please open an issue on the project at GitHub. (We also watch the L queue for Git::Wrapper, so feel free to use that bug reporting system if you prefer) =head1 AUTHORS =over 4 =item * Hans Dieter Pearcey =item * Chris Prather =item * John SJ Anderson =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Git-Wrapper-0.045/lib/Git/Wrapper/Statuses.pm000644 000765 000024 00000003135 12552752121 021661 0ustar00genehackstaff000000 000000 package Git::Wrapper::Statuses; # ABSTRACT: Multiple git statuses information $Git::Wrapper::Statuses::VERSION = '0.045'; use 5.006; use strict; use warnings; use Git::Wrapper::Status; sub new { return bless {} => shift } sub add { my ($self, $type, $mode, $from, $to) = @_; my $status = Git::Wrapper::Status->new($mode, $from, $to); push @{ $self->{ $type } }, $status; } sub get { my ($self, $type) = @_; return @{ defined $self->{$type} ? $self->{$type} : [] }; } sub is_dirty { my( $self ) = @_; return keys %$self ? 1 : 0; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Git::Wrapper::Statuses - Multiple git statuses information =head1 VERSION version 0.045 =head1 METHODS =head2 add =head2 get =head2 is_dirty =head2 new =head1 SEE ALSO =head2 L =head1 REPORTING BUGS & OTHER WAYS TO CONTRIBUTE The code for this module is maintained on GitHub, at L. If you have a patch, feel free to fork the repository and submit a pull request. If you find a bug, please open an issue on the project at GitHub. (We also watch the L queue for Git::Wrapper, so feel free to use that bug reporting system if you prefer) =head1 AUTHORS =over 4 =item * Hans Dieter Pearcey =item * Chris Prather =item * John SJ Anderson =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Git-Wrapper-0.045/lib/Git/Wrapper/File/RawModification.pm000644 000765 000024 00000003520 12552752121 024002 0ustar00genehackstaff000000 000000 package Git::Wrapper::File::RawModification; # ABSTRACT: Modification of a file in a commit $Git::Wrapper::File::RawModification::VERSION = '0.045'; use 5.006; use strict; use warnings; sub new { my ($class, $filename, $type, $perms_from, $perms_to, $blob_from, $blob_to) = @_; return bless { filename => $filename, type => $type, perms_from => $perms_from, perms_to => $perms_to, blob_from => $blob_from, blob_to => $blob_to, } => $class; } sub filename { shift->{filename} } sub type { shift->{type} } sub perms_from { shift->{perms_from} } sub perms_to { shift->{perms_to} } sub blob_from { shift->{blob_from} } sub blob_to { shift->{blob_to} } 1; __END__ =pod =encoding UTF-8 =head1 NAME Git::Wrapper::File::RawModification - Modification of a file in a commit =head1 VERSION version 0.045 =head1 METHODS =head2 new Constructor =head2 filename =head2 type =head2 perms_from =head2 perms_to =head2 blob_from =head2 blob_to =head1 SEE ALSO =head2 L =head1 REPORTING BUGS & OTHER WAYS TO CONTRIBUTE The code for this module is maintained on GitHub, at L. If you have a patch, feel free to fork the repository and submit a pull request. If you find a bug, please open an issue on the project at GitHub. (We also watch the L queue for Git::Wrapper, so feel free to use that bug reporting system if you prefer) =head1 AUTHORS =over 4 =item * Hans Dieter Pearcey =item * Chris Prather =item * John SJ Anderson =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Git-Wrapper-0.045/inc/CheckGitConfig.pm000644 000765 000024 00000001426 12552752121 020516 0ustar00genehackstaff000000 000000 package inc::CheckGitConfig; use Moose; extends 'Dist::Zilla::Plugin::MakeMaker::Awesome'; # TODO: in future versions of MakeMaker::Awesome, we can do all this right # from dist.ini, so we don't have to subclass. pester ether. around _build_MakeFile_PL_template => sub { my $orig = shift; my $self = shift; my $git_check = <'.File::Spec->devnull); GIT_CHECK my $template = $self->$orig(@_); $template =~ s/(?<=use warnings;\n\n)/$git_check/m; return $template; }; after register_prereqs => sub { my $self = shift; $self->zilla->register_prereqs( { phase => 'configure' }, 'File::Spec' => 0, ); }; 1;