Dist-Zilla-Plugin-Git-2.019000755001750001750 012244203313 14155 5ustar00cjmcjm000000000000README100644001750001750 47412244203313 15103 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019 This archive contains the distribution Dist-Zilla-Plugin-Git, version 2.019: update your git repository after release This software is copyright (c) 2009 by Jerome Quelin. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Changes100644001750001750 3457312244203313 15565 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019Revision history for Dist::Zilla::Plugin::Git 2.019 2013-11-23 20:49:27 Europe/Paris - fix #90537: wide character in print with ::Commit With Dist::Zilla 5, Git::Commit now writes the commit message in UTF-8 (christopher madsen, reported by kent fredric) 2.018 2013-11-02 23:24:33 Europe/Paris TRIAL RELEASE - use the Config::Git plugin for shared configuration (brendan byrd) You don't have to use Dist::Zilla::Plugin::Config::Git unless you want to, but you do have to install it. 2.017 2013-10-26 19:57:59 Europe/Paris - remove use of deprecated Class::MOP function (karen etheridge) - make Git::CommitBuild compatible with Dist::Zilla 5 (kent fredric, karen etheridge, & christopher madsen) 2.016 2013-10-19 18:27:32 Europe/Paris - fix exclude_filename to not match partial paths (karen etheridge) If you really intended to match a partial path, use exclude_match instead. - documentation typo fixed in Git::NextVersion (david steinbrunner) 2.015 2013-07-06 21:14:09 Europe/Paris - bail out of Build.PL unless git 1.5.4 or later is found (christopher madsen) - prevent warnings about chdir(undef) in tests (christopher madsen) 2.014 2013-06-22 17:50:26 Europe/Paris - fix rt#86251 - version-by-branch.t fails with Git 1.8.3 The output of "git rev-list" changed slightly, and this broke Git::NextVersion when using version_by_branch=1. (christopher madsen, reported by zak elep) 2.013 2013-04-13 20:25:39 Europe/Paris - fix rt#84491 - Git::GatherDir does not handle symlinks Symlinks to directories used to make it crash with a cryptic error. It now skips them with a warning, and this is documented. (christopher madsen, reported by karen etheridge) - mention Git::GatherDir in Git (christopher madsen, reported by kevin dawson) 2.012 2013-03-27 00:41:08 Europe/Paris - add commit option to Git::Init (tatsuhiko miyagawa) 2.011 2013-03-23 16:19:52 Europe/Paris - fix compatibility with Git::Wrapper 0.028_96 (Don't pass Path::Class objects to Git::Wrapper) (christopher madsen) 2.010 2013-03-16 16:34:22 Europe/Paris - fix rt#83891 - Git::CommitBuild commits non-build files Git::CommitBuild now writes a fresh copy of the built tree to commit, instead of using one that may have been modified by other plugins (kent fredric & christopher madsen) 2.009 2013-02-08 06:03:33 Europe/Paris - add allow_dirty_match option to Git::Check and Git::Commit (graham knop) - change version-by-branch.t to use HEAD~1 instead of HEAD^ Should fix test failure on Windows. (christopher madsen) - Test::Fatal 0.006 or better has been required since 2.007, but that wasn't explicit (christopher madsen, reported by jonathan leto) 2.008 2013-01-31 04:06:00 Europe/Paris - fix bug introduced in Git::Push 2.007 that broke remotes with additional parameters (christopher madsen) 2.007 2013-01-26 18:51:24 Europe/Paris - fix rt#82873 - Git::Push should check the remote exists New remotes_must_exist option defaults to true. (christopher madsen, suggested by olivier mengué) - switch from Test::Exception to Test::Fatal (christopher madsen) - load some dependencies only when needed (rt#82956) (christopher madsen, suggested by olivier mengué) 2.006 2012-12-29 23:17:39 Europe/Paris - document that the include_untracked option of Git::GatherDir requires Git 1.5.4, but has certain issues before Git 1.6.5.2. Adjust tests to skip when necessary. (christopher madsen) - set push.default matching in test config (christopher madsen) Otherwise Git for Windows 1.8.0 hangs in push-multi.t (thanks to christian walde for reporting the issue) 2.005 2012-12-08 22:03:15 Europe/Paris - avoid creating named type constraints (chris weyl & christopher madsen) 2.004 2012-12-01 19:58:59 Europe/Paris - improve Git::Commit's parsing of the Changes file (christopher madsen) Blank lines following the version line are no longer included in the commit message. It can now find the current version even if followed by a -TRIAL indicator. It now reads the Changes file that was shipped with the dist, not the one currently on disk. - fix include_untracked option of Git::GatherDir to work with Git 1.5.4.3 (christopher madsen) 2.003 2012-11-19 01:30:29 Europe/Paris - add multiple_inheritance option to Git::CommitBuild (yanick champoux) - change version-extraction.t to catch the bug in rt#81061 (christopher madsen with help from matthew horsfall) 2.002 2012-11-09 20:59:37 Europe/Paris - fix rt#81061 - Git::NextVersion parsing all versions as 0 (christopher madsen) - add debug-level logging to Git::NextVersion (christopher madsen) 2.001 2012-10-07 23:03:42 Europe/Paris - fix tests to work on Perl 5.12 and older (christopher madsen) 2.000 2012-10-07 06:33:29 Europe/Paris - Despite the version number, this is *not* a major release, just a new numbering scheme. Git::NextVersion now generates the version number. - fix tests to work on windows (christopher madsen) - add t::Util to consolidate common test functions (christopher madsen) 1.122770 2012-10-03 04:28:36 Europe/Paris - fix rt#76703 - add version_by_branch option to Git::NextVersion (christopher madsen) - Git::NextVersion now aborts release if version is duplicated (christopher madsen) - add include_untracked option to Git::GatherDir (christopher madsen) - add untracked_files option to Git::Check (christopher madsen) - Dist::Zilla::Role::Git::Repo now provides the git method (christopher madsen) 1.122530 2012-09-09 03:56:01 Europe/Paris - Git::CommitBuild requires Path::Class 0.22 to get dir->basename (christopher madsen) - Git::GatherDir requires Dist::Zilla 4.200016 to get exclude_filename and exclude_match in GatherDir (christopher madsen) - fix tests to use "git add -f" instead of "git add --force" for compatibility with older versions of Git (christopher madsen) - add 000-report-git-version.t for debugging (christopher madsen) 1.122460 2012-09-02 02:35:25 Europe/Paris - fix rt#78898 - allow_dirty should not be a regex (christopher madsen) This was an unintended side-effect of the fix for gh#19 in 1.113220 add tests to check.t so it doesn't recur 1.121820 2012-06-30 05:36:52 Europe/Paris - require File::Path 2.07 to get make_path (thanks for failing reports, CPAN Testers!) 1.121811 2012-06-29 17:25:42 Europe/Paris - fix an interpolation error that broke CommitBuild 1.121810 2012-06-29 03:01:01 Europe/Paris - uniq the list of files returned by `git ls-files` 1.121800 2012-06-28 04:03:06 Europe/Paris - Require a newer Git::Wrapper for better portability 1.121770 2012-06-25 16:47:30 Europe/Paris - CommitBuild: add missing module 1.121750 2012-06-23 19:03:47 Europe/Paris - CommitBuild: Add build to git directly, bypassing the index (chris weyl) 1.121010 2012-04-10 16:47:39 Europe/Paris - updated Git::GatherDir plugin to support everything DZ's own GatherDir does 1.120970 2012-04-06 08:56:03 Europe/Paris - new plugin GatherDir (geoffrey broadwell, ricardo signes) 1.120860 2012-03-26 12:18:38 Europe/Paris - fix tag-signed.t test on windows (olivier mengué) 1.120370 2012-02-06 09:32:58 Europe/Paris - split version-tags finding logic into own attribute (chris weyl) 1.113560 2011-12-22 09:47:39 Europe/Paris - make test pass with archive::tar:wrapper (randy stauner) - clean up commit message (randy stauner) 1.113220 2011-11-18 09:12:51 Europe/Paris - fix gh#19 - allow to specify alternate repository root (mike friedman) 1.112510 2011-09-08 13:45:01 Europe/Paris - fix rt#70805 - remove unneeded tmp directory in tarball 1.112500 2011-09-07 08:49:06 Europe/Paris - fix rt#70742 - tests fail if gpg isn't installed (mike doherty) 1.112440 2011-09-01 13:26:02 Europe/Paris - fix gh#16 - unset git env variables for tag_signed.t 1.112380 2011-08-26 10:41:50 Europe/Paris - fix rt##55647 - support signed tags (mike doherty) - moved all test corpus to corpus/ - renamed tests to remove leading number 1.112070 2011-07-26 08:46:42 Europe/Paris - fix gh#13 - supplying default git config 1.112060 2011-07-25 10:25:29 Europe/Paris - fix rt#66705 - localization of HOME in tests - fix rt#69616 & rt#69701 - make dzp-git work with git::wrapper 0.015 1.111590 2011-06-08 09:43:35 Europe/Paris - mocks HOME to avoid test failures (david golden) 1.111460 2011-05-26 14:37:08 Europe/Paris - fix rt#68474 - Git::NextVersion assumes all tags are version-related (rob@hoelz.ro) 1.110500 2011-02-19 12:43:19 Europe/Paris - add 'add_files_in' to Commit so you can commit an entire dir (Apocalypse) If you need the same concept for Check please let us know! 1.110480 2011-02-17 18:03:06 Europe/Paris - CommitBuild support for release_message (nigel metheringham) - Also supports %v & %t format tags, more appropriate for message on commit build of the released package (nigel metheringham) 1.110330 2011-02-02 10:36:33 Europe/Paris - fix rt#62484 - add a link to Git::NextVersion in main documentation 1.103520 2010-12-18 09:45:57 Europe/Paris - fix Commit so %t actually works (christopher madsen) 1.103500 2010-12-16 11:44:32 Europe/Paris - add config & remote options to Init (christopher madsen) 1.103470 2010-12-13 17:32:36 Europe/Paris - add time_zone option to Tag & Commit (christopher madsen) It now defaults to your local time. Previous versions always used UTC. - Tag & Commit accept %t to indicate trial release status (christopher madsen) - NextVersion resets $/ to guard against misbehaving plugins (alan young) 1.102810 2010-10-08 18:01:32 Europe/Paris - add Git::NextVersion adapted from BumpVersionFromGit (dagolden) 1.102430 2010-08-31 17:12:24 Europe/Paris - fix rt#60740 - allow retrieval of applied tag in git (matt follett) 1.102380 2010-08-26 09:39:33 Europe/Paris - fix hang on windows (alexandr ciornii) 1.102090 2010-07-28 14:12:20 Europe/Paris - initialize a working git config in all tests 1.102040 2010-07-23 10:45:23 Europe/Paris - fix rt#59587 - cache buildroot to commit on master, not release branch (yanick champoux) 1.102020 2010-07-21 09:00:46 Europe/Paris - fix rt#59586 - there should be no release branch by default for git::commitbuild warning: this changes behaviour of git::commitbuild 1.102010 2010-07-20 11:00:36 Europe/Paris - fix rt#59505 - support for unstable git versions in push test skips 1.101801 2010-06-29 19:00:13 Europe/Paris - fix rt#56485 - skip push tests for old git versions 1.101800 2010-06-29 18:36:17 Europe/Paris - git::commitbuild - new release_branch option to commit result after a release (yanick champoux) - git::tag - tag can be applied to a different branch (yanick champoux) - fix rt#58876 - pod description out of date 1.101680 2010-06-17 17:17:07 Europe/Paris - fix rt# 58431 - remove git.pm prereq, use git::wrapper (yanick champoux) 1.101650 2010-06-14 16:08:41 Europe/Paris - basic aftermint plugin to git init while dzil new (jesse luehrs) - build commits have their original branch as parent (yanick champoux) 1.101330 2010-05-13 19:27:39 Europe/Paris - git::commit recognizes another changelog format (david golden) 1.101270 2010-05-07 16:56:27 Europe/Paris - fix brian's name in this file (sorry brian!) - make CommitBuild log error when build commit fails (michael schout) 1.101230 2010-05-03 17:10:17 Europe/Paris - support for committing results of build in a separate branch (brian phillips) - fix test error appearing in weird git configs / setups 1.100970 2010-04-07 08:54:46 Europe/Paris - simplify multi-value args for @git (christopher madsen) - Require Dist::Zilla 2 (1.100900 needed DZ2, but didn't say so) 1.100960 2010-04-06 16:59:50 Europe/Paris - allow pushing to a different branch (graham barr) - allow multi-value args for @git (graham barr) - switch to dist-zilla-tester framework for tests (ricardo signes) 1.100900 2010-03-31 10:04:49 Europe/Paris - use a method modifier to set mvp_multivalue_args in Role::Git::DirtyFiles (This is required by Dist::Zilla 2.) (christopher madsen) 1.100760 2010-03-17 10:16:56 Europe/Paris - add a BeforeRelease check in Tag to prevent re-releases (christopher madsen) - Commit and Push now pass Git's output to log_debug (christopher madsen) 1.100750 2010-03-16 16:25:56 Europe/Paris - actually use commit_msg (christopher madsen) - Push now logs before pushing (christopher madsen) 1.100741 2010-03-15 18:48:31 Europe/Paris - documentation fix for new push_to param 1.100740 2010-03-15 17:28:12 Europe/Paris - WARNING: parameter "filename" renamed to "changelog" - let commit message include whitespace to next unindented line (david golden) - set up remote tracking branch during push testing (david golden) - remove unnecessary 'filename' arg from Push (david golden) - add 'push_to' argument to Push for multi-repo pushes (david golden) - give back user possibility to create lightweight tag, default remains annotated tags (christopher madsen) - allow user to change commit message (christopher madsen) - allow user to specify files allowed to be dirty for check & commit (christopher madsen) - refactored allow_dirty in dz:role:git:dirtyfiles (christopher madsen) 1.100690 2010-03-10 13:20:37 Europe/Paris - fix tests to work even when no global git config exists - refactored commit message generation (christopher madsen) 1.100681 2010-03-09 17:26:14 Europe/Paris - bumping minimum dzil version requirement 1.100680 2010-03-09 17:07:45 Europe/Paris - using annotated tags instead of lightweight tags (rt#55352) - minor pod update 1.100660 2010-03-07 13:41:39 Europe/Paris - fix tests to work with git 1.7.0 - fix tests to work with current Dist::Zilla (Ricardo Signes) - provide shorter plugin names to bundle contents (Ricardo Signes) 1.100430 2010-02-12 13:11:39 Europe/Paris - WARNING: no more makefile.pl supplied, only a build.pl - using path::class in the tests 1.093410 2009-12-07 09:13:07 Europe/Paris - require file::path 2.07 for remove_tree 1.093300 2009-11-26 11:02:22 Europe/Paris - new param tag_format for dzp:git:tag (ricardo signes) 1.093260 2009-11-22 11:35:00 Europe/Paris - using internal release command instead of spawning external dzil 1.093250 2009-11-21 18:35:55 Europe/Paris - split plugin in DZP::Git::* (Check, Commit, Tag, Push) - providing a plugin bundle for all git plugins 1.093240 2009-11-20 18:36:28 Europe/Paris - original release - git checks before release: index clean, working copy too, no untracked files - git actions after release: commit changelog, tag, push t000755001750001750 012244203313 14341 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019tag.t100644001750001750 264212244203313 15445 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 4; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } # build fake repository my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/tag')->absolute, }); chdir $zilla->tempdir->subdir('source'); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # do the release $zilla->release; # check if tag has been correctly created my @tags = $git->tag; is( scalar(@tags), 1, 'one tag created' ); is( $tags[0], 'v1.23', 'new tag created after new version' ); is( $tags[0], $zilla->plugin_named('Git::Tag')->tag(), 'new tag matches the tag the plugin claims is the tag.'); # attempting to release again should fail eval { $zilla->release }; like($@, qr/tag v1\.23 already exists/, 'prohibit duplicate tag'); LICENSE100644001750001750 4365612244203313 15301 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019This software is copyright (c) 2009 by Jerome Quelin. 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) 2009 by Jerome Quelin. 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, Suite 500, Boston, MA 02110-1335 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) 2009 by Jerome Quelin. 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 dist.ini100644001750001750 157512244203313 15712 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019; be kind to Emacs users -*-conf-windows-*- name = Dist-Zilla-Plugin-Git author = Jerome Quelin license = Perl_5 copyright_holder = Jerome Quelin copyright_year = 2009 ; -- static meta-information [MetaResources] x_MailingList = http://www.listbox.com/subscribe/?list_id=139292 [MetaNoIndex] directory = corpus directory = t [Bootstrap::lib] [@Filter / JQ] -bundle = @Author::JQUELIN -version = 3.002 ; keep README.mkdn up-to-date -remove = ModuleBuild ; using ModuleBuild::Custom instead AutoPrereqs.:version = 4.300005 ; configure_finder AutoPrereqs.configure_finder[0] = :BuildPL AutoPrereqs.configure_finder[1] = :IncModules Prepender.skip[0] = corpus/dzp-git\. [ModuleBuild::Custom] :version = 4.16 ; get_prereqs(1) that works properly mb_version = 0 ; have AutoPrereqs get this from Build.PL [FileFinder::ByName / :BuildPL] file = Build.PL [ConfirmRelease] Build.PL100644001750001750 1037112244203313 15554 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019# # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Module::Build 0.3601; use version 0.80 (); my %module_build_args = ( 'dist_abstract' => 'update your git repository after release', 'dist_author' => [ 'Jerome Quelin' ], 'dist_name' => 'Dist-Zilla-Plugin-Git', 'dist_version' => '2.019', 'license' => 'perl', 'module_name' => 'Dist::Zilla::Plugin::Git', 'recursive_test_files' => 1, 'build_requires' => { 'Module::Build' => '0' }, 'configure_requires' => { 'Module::Build' => '0.3601', 'version' => '0.80', 'warnings' => '0' }, 'requires' => { 'Cwd' => '0', 'DateTime' => '0', 'Dist::Zilla' => '4', 'Dist::Zilla::Plugin::GatherDir' => '4.200016', 'Dist::Zilla::Role::AfterBuild' => '0', 'Dist::Zilla::Role::AfterMint' => '0', 'Dist::Zilla::Role::AfterRelease' => '0', 'Dist::Zilla::Role::BeforeRelease' => '0', 'Dist::Zilla::Role::FilePruner' => '0', 'Dist::Zilla::Role::GitConfig' => '0', 'Dist::Zilla::Role::PluginBundle' => '0', 'Dist::Zilla::Role::VersionProvider' => '0', 'File::Spec' => '0', 'File::Spec::Functions' => '0', 'File::Temp' => '0', 'File::chdir' => '0', 'Git::Wrapper' => '0.021', 'IPC::Open3' => '0', 'IPC::System::Simple' => '0', 'List::AllUtils' => '0', 'List::Util' => '0', 'Module::Runtime' => '0', 'Moose' => '0', 'Moose::Autobox' => '0', 'Moose::Role' => '0', 'Moose::Util::TypeConstraints' => '0', 'MooseX::AttributeShortcuts' => '0', 'MooseX::Has::Sugar' => '0', 'MooseX::Types::Moose' => '0', 'MooseX::Types::Path::Class' => '0', 'Path::Class' => '0.22', 'Path::Class::Dir' => '0', 'String::Formatter' => '0', 'Try::Tiny' => '0', 'Version::Next' => '0', 'constant' => '0', 'namespace::autoclean' => '0.09', 'perl' => '5.010', 'strict' => '0', 'version' => '0.80', 'warnings' => '0' }, 'test_requires' => { 'Devel::SimpleTrace' => '0', 'Dist::Zilla::File::InMemory' => '0', 'Dist::Zilla::Plugin::Config::Git' => '0', 'Dist::Zilla::Role::Releaser' => '0', 'Dist::Zilla::Tester' => '0', 'Encode' => '0', 'Exporter' => '0', 'File::Copy' => '0', 'File::Copy::Recursive' => '0', 'File::Path' => '2.07', 'File::Spec' => '0', 'File::Which' => '0', 'File::pushd' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Log::Dispatchouli' => '0', 'Test::DZil' => '0', 'Test::Fatal' => '0.006', 'Test::More' => '0.88', 'lib' => '0', 'utf8' => '0' }, get_options => { 'force-install' => undef }, ); unless ( eval { Module::Build->VERSION(0.4004) } ) { my $tr = delete $module_build_args{test_requires}; my $br = $module_build_args{build_requires}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } my $build = Module::Build->new(%module_build_args); # Git 1.5.4 introduced the --exclude-standard option to git ls-files, # which Git::Check needs to work properly. my $need_version = version->parse('1.5.4'); eval { my $git_version = `git --version` or die "Unable to execute git\n"; $git_version =~ /git \s+ version \s* ( \d+ (?: \.\d+ )+ )( [-.]rc\d+)?/x or die "Unable to determine git version\n"; my $rc = $2 || ''; $git_version = version->parse("$1"); die "git $need_version or later required, you have $git_version$rc\n" if $git_version < $need_version or $git_version == $need_version and $rc; 1; } or do { print $@; if ($build->args('force-install')) { print "--force-install specified, attempting to install anyway.\n"; } else { print <<"END MESSAGE"; \nDist::Zilla::Plugin::Git requires git $need_version or later in your PATH, and it wasn't found. If you want to install anyway, run $^X Build.PL --force-install END MESSAGE exit 0; # Indicate missing non-Perl prerequisite } # end else not --force-install }; # end do when Git prerequisite is not met $build->create_build_script; push.t100644001750001750 400712244203313 15646 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Git::Wrapper; use Path::Class; use Test::More 0.88; # done_testing use Test::Fatal qw(exception); use t::Util; # rt#56485 - skip test to avoid failures for old git versions skip_unless_git_version('1.7.0'); plan tests => 7; init_test(corpus => 'push'); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # create a clone, and use it to set up origin my $clone = $base_dir->subdir('clone'); $git->clone( { quiet=>1, 'no-checkout'=>1, bare=>1 }, "$git_dir", "$clone" ); $git->remote('add', 'origin', "$clone"); $git->config('branch.master.remote', 'origin'); $git->config('branch.master.merge', 'refs/heads/master'); # do the release append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); new_zilla_from_repo; $zilla->release; # Check log zilla_log_is('Git::Push', <<''); [Git::Push] pushing to origin # check if everything was pushed $git = Git::Wrapper->new( "$clone" ); my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, 'commit pushed' ); # check if tag has been correctly created my @tags = $git->tag; is( scalar(@tags), 1, 'one tag pushed' ); is( $tags[0], 'v1.23', 'new tag created after new version' ); # try a release with a bogus remote append_to_file('dist.ini', <<'END dist.ini'); push_to = origin push_to = bogus unmodified END dist.ini new_zilla_from_repo; my $exception = exception { $zilla->release }; like($exception, qr/^\Q[Git::Push] These remotes do not exist: bogus\E/, 'Caught bogus remote'); zilla_log_is('Git::Push', <<''); [Git::Push] These remotes do not exist: bogus is_deeply($zilla->plugin_named('Git::Push')->push_to, [ 'origin', 'bogus unmodified' ], "push_to is not modified"); done_testing; META.yml100644001750001750 2212412244203313 15530 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019--- abstract: 'update your git repository after release' author: - 'Jerome Quelin' build_requires: Devel::SimpleTrace: 0 Dist::Zilla::File::InMemory: 0 Dist::Zilla::Plugin::Config::Git: 0 Dist::Zilla::Role::Releaser: 0 Dist::Zilla::Tester: 0 Encode: 0 Exporter: 0 File::Copy: 0 File::Copy::Recursive: 0 File::Path: 2.07 File::Spec: 0 File::Which: 0 File::pushd: 0 IO::Handle: 0 IPC::Open3: 0 Log::Dispatchouli: 0 Module::Build: 0 Test::DZil: 0 Test::Fatal: 0.006 Test::More: 0.88 lib: 0 utf8: 0 configure_requires: Module::Build: 0.3601 version: 0.80 warnings: 0 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Dist-Zilla-Plugin-Git no_index: directory: - corpus - t provides: Dist::Zilla::Plugin::Git: file: lib/Dist/Zilla/Plugin/Git.pm version: 2.019 Dist::Zilla::Plugin::Git::Check: file: lib/Dist/Zilla/Plugin/Git/Check.pm version: 2.019 Dist::Zilla::Plugin::Git::Commit: file: lib/Dist/Zilla/Plugin/Git/Commit.pm version: 2.019 Dist::Zilla::Plugin::Git::CommitBuild: file: lib/Dist/Zilla/Plugin/Git/CommitBuild.pm version: 2.019 Dist::Zilla::Plugin::Git::GatherDir: file: lib/Dist/Zilla/Plugin/Git/GatherDir.pm version: 2.019 Dist::Zilla::Plugin::Git::Init: file: lib/Dist/Zilla/Plugin/Git/Init.pm version: 2.019 Dist::Zilla::Plugin::Git::NextVersion: file: lib/Dist/Zilla/Plugin/Git/NextVersion.pm version: 2.019 Dist::Zilla::Plugin::Git::Push: file: lib/Dist/Zilla/Plugin/Git/Push.pm version: 2.019 Dist::Zilla::Plugin::Git::Tag: file: lib/Dist/Zilla/Plugin/Git/Tag.pm version: 2.019 Dist::Zilla::PluginBundle::Git: file: lib/Dist/Zilla/PluginBundle/Git.pm version: 2.019 Dist::Zilla::Role::Git::DirtyFiles: file: lib/Dist/Zilla/Role/Git/DirtyFiles.pm version: 2.019 Dist::Zilla::Role::Git::Repo: file: lib/Dist/Zilla/Role/Git/Repo.pm version: 2.019 requires: Cwd: 0 DateTime: 0 Dist::Zilla: 4 Dist::Zilla::Plugin::GatherDir: 4.200016 Dist::Zilla::Role::AfterBuild: 0 Dist::Zilla::Role::AfterMint: 0 Dist::Zilla::Role::AfterRelease: 0 Dist::Zilla::Role::BeforeRelease: 0 Dist::Zilla::Role::FilePruner: 0 Dist::Zilla::Role::GitConfig: 0 Dist::Zilla::Role::PluginBundle: 0 Dist::Zilla::Role::VersionProvider: 0 File::Spec: 0 File::Spec::Functions: 0 File::Temp: 0 File::chdir: 0 Git::Wrapper: 0.021 IPC::Open3: 0 IPC::System::Simple: 0 List::AllUtils: 0 List::Util: 0 Module::Runtime: 0 Moose: 0 Moose::Autobox: 0 Moose::Role: 0 Moose::Util::TypeConstraints: 0 MooseX::AttributeShortcuts: 0 MooseX::Has::Sugar: 0 MooseX::Types::Moose: 0 MooseX::Types::Path::Class: 0 Path::Class: 0.22 Path::Class::Dir: 0 String::Formatter: 0 Try::Tiny: 0 Version::Next: 0 constant: 0 namespace::autoclean: 0.09 perl: 5.010 strict: 0 version: 0.80 warnings: 0 resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Git homepage: http://search.cpan.org/dist/Dist-Zilla-Plugin-Git/ repository: git://github.com/madsen/dist-zilla-plugin-git.git x_MailingList: http://www.listbox.com/subscribe/?list_id=139292 version: 2.019 x_Dist_Zilla: perl: version: 5.018001 plugins: - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: 5.006 - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex version: 5.006 - class: Dist::Zilla::Plugin::Bootstrap::lib config: Dist::Zilla::Role::Bootstrap: distname: Dist-Zilla-Plugin-Git fallback: 1 try_built: ~ try_built_method: mtime name: Bootstrap::lib version: 0.04000001 - class: Dist::Zilla::Plugin::Git::NextVersion name: JQ/Git::NextVersion version: ~ - class: Dist::Zilla::Plugin::GatherDir name: JQ/GatherDir version: 5.006 - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: filename: t/00-compile.t module_finder: - ':InstallModules' script_finder: - ':ExecFiles' name: JQ/Test::Compile version: 2.037 - class: Dist::Zilla::Plugin::PodCoverageTests name: JQ/PodCoverageTests version: 5.006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: JQ/PodSyntaxTests version: 5.006 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: JQ/ReportVersions::Tiny version: 1.10 - class: Dist::Zilla::Plugin::PruneCruft name: JQ/PruneCruft version: 5.006 - class: Dist::Zilla::Plugin::PruneFiles name: JQ/PruneFiles version: 5.006 - class: Dist::Zilla::Plugin::ManifestSkip name: JQ/ManifestSkip version: 5.006 - class: Dist::Zilla::Plugin::AutoPrereqs name: JQ/AutoPrereqs version: 5.006 - class: Dist::Zilla::Plugin::ExtraTests name: JQ/ExtraTests version: 5.006 - class: Dist::Zilla::Plugin::NextRelease name: JQ/NextRelease version: 5.006 - class: Dist::Zilla::Plugin::PkgVersion name: JQ/PkgVersion version: 5.006 - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' name: JQ/PodWeaver version: 3.102000 - class: Dist::Zilla::Plugin::Prepender name: JQ/Prepender version: 1.112280 - class: Dist::Zilla::Plugin::ExecDir name: JQ/ExecDir version: 5.006 - class: Dist::Zilla::Plugin::ShareDir name: JQ/ShareDir version: 5.006 - class: Dist::Zilla::Plugin::Bugtracker name: JQ/Bugtracker version: 1.111080 - class: Dist::Zilla::Plugin::Homepage name: JQ/Homepage version: 1.101420 - class: Dist::Zilla::Plugin::Repository name: JQ/Repository version: 0.19 - class: Dist::Zilla::Plugin::FinderCode name: JQ/MetaProvides::Package/AUTOVIV/:InstallModulesPM version: 5.006 - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: {} Dist::Zilla::Role::MetaProvider::Provider: inherit_missing: 1 inherit_version: 1 meta_noindex: 1 name: JQ/MetaProvides::Package version: 1.15000000 - class: Dist::Zilla::Plugin::MetaConfig name: JQ/MetaConfig version: 5.006 - class: Dist::Zilla::Plugin::HelpWanted name: JQ/HelpWanted version: 0.3.1 - class: Dist::Zilla::Plugin::License name: JQ/License version: 5.006 - class: Dist::Zilla::Plugin::Covenant name: JQ/Covenant version: 0.1.0 - class: Dist::Zilla::Plugin::MetaYAML name: JQ/MetaYAML version: 5.006 - class: Dist::Zilla::Plugin::MetaJSON name: JQ/MetaJSON version: 5.006 - class: Dist::Zilla::Plugin::Readme name: JQ/Readme version: 5.006 - class: Dist::Zilla::Plugin::ReadmeAnyFromPod name: JQ/ReadmeAnyFromPod version: 0.131500 - class: Dist::Zilla::Plugin::Manifest name: JQ/Manifest version: 5.006 - class: Dist::Zilla::Plugin::CheckChangeLog name: JQ/CheckChangeLog version: 0.01 - class: Dist::Zilla::Plugin::TestRelease name: JQ/TestRelease version: 5.006 - class: Dist::Zilla::Plugin::Git::Check name: JQ/Git::Check version: ~ - class: Dist::Zilla::Plugin::Git::Commit name: JQ/Git::Commit version: ~ - class: Dist::Zilla::Plugin::Git::Tag name: JQ/Git::Tag version: ~ - class: Dist::Zilla::Plugin::Git::Push name: JQ/Git::Push version: ~ - class: Dist::Zilla::Plugin::UploadToCPAN name: JQ/UploadToCPAN version: 5.006 - class: Dist::Zilla::Plugin::ModuleBuild::Custom name: ModuleBuild::Custom version: 4.16 - class: Dist::Zilla::Plugin::FileFinder::ByName name: ':BuildPL' version: 5.006 - class: Dist::Zilla::Plugin::ConfirmRelease name: ConfirmRelease version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 5.006 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 5.006 x_author_pledge: version: 1 MANIFEST100644001750001750 371712244203313 15377 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019AUTHOR_PLEDGE Build.PL Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml README corpus/check/Changes corpus/check/foobar corpus/commit-build-custom/Changes corpus/commit-build-custom/dist.ini corpus/commit-build-src-as-parent/Changes corpus/commit-build-src-as-parent/dist.ini corpus/commit-build/Changes corpus/commit-build/dist.ini corpus/commit-dirtydir/Changes corpus/commit-dirtydir/dist.ini corpus/commit-ws/Changes corpus/commit-ws/dist.ini corpus/commit/Changes corpus/commit/dist.ini corpus/dzp-git.pub corpus/dzp-git.sec corpus/gatherdir/lib/DZT/Sample.pm corpus/push-gitconfig/Changes corpus/push-gitconfig/dist.ini corpus/push-multi/Changes corpus/push-multi/dist.ini corpus/push/Changes corpus/push/dist.ini corpus/repo-dir/Changes corpus/repo-dir/dist.ini corpus/tag-signed/Changes corpus/tag-signed/dist.ini corpus/tag/Changes corpus/tag/dist.ini corpus/version-default/Changes corpus/version-default/dist.ini corpus/version-default/foobar corpus/version-regexp/Changes corpus/version-regexp/dist.ini corpus/version-regexp/foobar dist.ini lib/Dist/Zilla/Plugin/Git.pm lib/Dist/Zilla/Plugin/Git/Check.pm lib/Dist/Zilla/Plugin/Git/Commit.pm lib/Dist/Zilla/Plugin/Git/CommitBuild.pm lib/Dist/Zilla/Plugin/Git/GatherDir.pm lib/Dist/Zilla/Plugin/Git/Init.pm lib/Dist/Zilla/Plugin/Git/NextVersion.pm lib/Dist/Zilla/Plugin/Git/Push.pm lib/Dist/Zilla/Plugin/Git/Tag.pm lib/Dist/Zilla/PluginBundle/Git.pm lib/Dist/Zilla/Role/Git/DirtyFiles.pm lib/Dist/Zilla/Role/Git/Repo.pm t/00-compile.t t/000-report-git-version.t t/000-report-versions-tiny.t t/Util.pm t/check.t t/commit-build-custom.t t/commit-build-src-as-parent.t t/commit-build.t t/commit-dirtydir.t t/commit-message.t t/commit-utf8.t t/commit-ws.t t/commit.t t/gatherdir.t t/lib/Dist/Zilla/Plugin/MyTestArchiver.pm t/push-gitconfig.t t/push-multi.t t/push.t t/release-pod-coverage.t t/release-pod-syntax.t t/repo-dir.t t/tag-signed.t t/tag.t t/version-by-branch.t t/version-default.t t/version-extraction.t t/version-regexp.t check.t100644001750001750 2472312244203313 15773 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Dist::Zilla 1.093250; use Test::DZil qw{ Builder simple_ini }; use File::Temp qw{ tempdir }; use File::pushd qw{ pushd }; use Git::Wrapper; use Test::More 0.88 tests => 50; # done_testing use Test::Fatal 0.006 qw( lives_ok ); use t::Util qw( throws_ok ); # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my ($zilla, $git, $pushd); sub new_tzil { undef $pushd; # Restore original directory, if necessary # build fake repository $zilla = Builder->from_config( { dist_root => 'corpus/check' }, { add_files => { 'source/dist.ini' => simple_ini( [ 'Git::Check' => { @_ } ], 'FakeRelease', ), 'source/.gitignore' => "DZT-Sample-*\n", }, }, ); $pushd = pushd($zilla->tempdir->subdir('source')); print "# "; # Comment output of git init system "git init"; $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); # create initial commit # Don't use --force, because only -f works before git 1.5.6 $git->add( -f => '.gitignore'); $git->commit( { message=>'ignore file for git' } ); } # end new_tzil #--------------------------------------------------------------------- # Test with default config: new_tzil(); # untracked files throws_ok { $zilla->release } qr/untracked files/, 'untracked files'; our_messages_are(<<'', 'lists untracked files'); [Git::Check] branch master has some untracked files: [Git::Check] Changes [Git::Check] dist.ini [Git::Check] foobar # index not clean $git->add( qw{ dist.ini Changes foobar } ); throws_ok { $zilla->release } qr/some changes staged/, 'index not clean'; our_messages_are(<<'', 'lists staged files'); [Git::Check] branch master has some changes staged for commit: [Git::Check] A Changes [Git::Check] A dist.ini [Git::Check] A foobar $git->commit( { message => 'initial commit' } ); # modified files append_to_file('foobar', 'Foo-*'); throws_ok { $zilla->release } qr/uncommitted files/, 'uncommitted files'; our_messages_are(<<'', 'lists uncommitted files'); [Git::Check] branch master has some uncommitted files: [Git::Check] foobar $git->checkout( 'foobar' ); # changelog and dist.ini can be modified append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); lives_ok { $zilla->release } 'Changes and dist.ini can be modified'; our_messages_are(<<'', 'reports master in clean state'); [Git::Check] branch master is in a clean state # ensure dist.ini does not match dist_ini append_to_file('dist_ini', 'Hello'); $git->add( qw{ dist_ini } ); $git->commit( { message => 'add dist_ini' } ); append_to_file('dist_ini', 'World'); throws_ok { $zilla->release } qr/uncommitted files/, 'dist_ini must not be modified'; our_messages_are(<<'', 'lists uncommitted dist_ini'); [Git::Check] branch master has some uncommitted files: [Git::Check] dist_ini #--------------------------------------------------------------------- # Test with no dirty files allowed at all: new_tzil(allow_dirty => ''); # untracked files throws_ok { $zilla->release } qr/untracked files/, 'untracked files with allow_dirty = ""'; our_messages_are(<<'', 'lists untracked files'); [Git::Check] branch master has some untracked files: [Git::Check] Changes [Git::Check] dist.ini [Git::Check] foobar # index not clean $git->add( qw{ dist.ini Changes foobar } ); throws_ok { $zilla->release } qr/some changes staged/, 'index not clean with allow_dirty = ""'; our_messages_are(<<'', 'lists staged files'); [Git::Check] branch master has some changes staged for commit: [Git::Check] A Changes [Git::Check] A dist.ini [Git::Check] A foobar $git->commit( { message => 'initial commit' } ); # modified files append_to_file('foobar', 'Foo-*'); throws_ok { $zilla->release } qr/uncommitted files/, 'uncommitted files with allow_dirty = ""'; our_messages_are(<<'', 'lists uncommitted files'); [Git::Check] branch master has some uncommitted files: [Git::Check] foobar $git->checkout( 'foobar' ); # changelog cannot be modified append_to_file('Changes', "\n"); throws_ok { $zilla->release } qr/uncommitted files/, 'Changes must not be modified'; our_messages_are(<<'', 'lists uncommitted Changes file'); [Git::Check] branch master has some uncommitted files: [Git::Check] Changes $git->checkout( 'Changes' ); # dist.ini cannot be modified append_to_file('dist.ini', "\n"); throws_ok { $zilla->release } qr/uncommitted files/, 'dist.ini must not be modified'; our_messages_are(<<'', 'lists uncommitted dist.ini'); [Git::Check] branch master has some uncommitted files: [Git::Check] dist.ini $git->checkout( 'dist.ini' ); lives_ok { $zilla->release } 'Changes and dist.ini are unmodified'; our_messages_are(<<'', 'reports master in clean state'); [Git::Check] branch master is in a clean state #--------------------------------------------------------------------- # Test with some files allowed by regex: new_tzil(allow_dirty => '', allow_dirty_match => 'a'); # untracked files throws_ok { $zilla->release } qr/untracked files/, 'untracked files with allow_dirty_match = "a"'; our_messages_are(<<'', 'lists untracked files'); [Git::Check] branch master has some untracked files: [Git::Check] Changes [Git::Check] dist.ini [Git::Check] foobar # index not clean $git->add( qw{ dist.ini Changes foobar } ); throws_ok { $zilla->release } qr/some changes staged/, 'index not clean with allow_dirty_match = "a"'; our_messages_are(<<'', 'lists staged files'); [Git::Check] branch master has some changes staged for commit: [Git::Check] A Changes [Git::Check] A dist.ini [Git::Check] A foobar $git->commit( { message => 'initial commit' } ); # modified files append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); append_to_file('foobar', "\n"); throws_ok { $zilla->release } qr/uncommitted files/, 'uncommitted files with allow_dirty_match = "a"'; our_messages_are(<<'', 'lists uncommitted files'); [Git::Check] branch master has some uncommitted files: [Git::Check] dist.ini $git->checkout( 'dist.ini' ); # files matching /a/ can be modified lives_ok { $zilla->release } 'Changes foobar can be modified'; our_messages_are(<<'', 'reports master in clean state'); [Git::Check] branch master is in a clean state #--------------------------------------------------------------------- # Test with untracked_files = warn: new_tzil(untracked_files => 'warn'); # untracked files lives_ok { $zilla->release } 'untracked files are ok'; our_messages_are(<<'', 'warns about untracked files'); [Git::Check] branch master has some untracked files: [Git::Check] Changes [Git::Check] dist.ini [Git::Check] foobar [Git::Check] branch master has 3 untracked files # index not clean $git->add( qw{ dist.ini Changes foobar } ); throws_ok { $zilla->release } qr/some changes staged/, 'index not clean'; our_messages_are(<<'', 'lists staged files'); [Git::Check] branch master has some changes staged for commit: [Git::Check] A Changes [Git::Check] A dist.ini [Git::Check] A foobar $git->commit( { message => 'initial commit' } ); # modified files append_to_file('foobar', 'Foo-*'); throws_ok { $zilla->release } qr/uncommitted files/, 'uncommitted files'; our_messages_are(<<'', 'lists uncommitted files'); [Git::Check] branch master has some uncommitted files: [Git::Check] foobar $git->checkout( 'foobar' ); # changelog and dist.ini can be modified append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); lives_ok { $zilla->release } 'Changes and dist.ini can be modified'; our_messages_are(<<'', 'reports master in clean state'); [Git::Check] branch master is in a clean state # ensure dist.ini does not match dist_ini append_to_file('dist_ini', 'Hello'); $git->add( qw{ dist_ini } ); $git->commit( { message => 'add dist_ini' } ); append_to_file('dist_ini', 'World'); throws_ok { $zilla->release } qr/uncommitted files/, 'dist_ini must not be modified'; our_messages_are(<<'', 'lists dist_ini as uncommitted'); [Git::Check] branch master has some uncommitted files: [Git::Check] dist_ini #--------------------------------------------------------------------- # Test with untracked_files = ignore: new_tzil(untracked_files => 'ignore'); # untracked files lives_ok { $zilla->release } 'untracked files are ok'; our_messages_are(<<'', 'counts untracked files'); [Git::Check] branch master has 3 untracked files # index not clean $git->add( qw{ dist.ini Changes foobar } ); throws_ok { $zilla->release } qr/some changes staged/, 'index not clean'; our_messages_are(<<'', 'lists staged files'); [Git::Check] branch master has some changes staged for commit: [Git::Check] A Changes [Git::Check] A dist.ini [Git::Check] A foobar $git->commit( { message => 'initial commit' } ); # modified files append_to_file('foobar', 'Foo-*'); throws_ok { $zilla->release } qr/uncommitted files/, 'uncommitted files'; our_messages_are(<<'', 'lists foobar as uncommitted'); [Git::Check] branch master has some uncommitted files: [Git::Check] foobar $git->checkout( 'foobar' ); # changelog and dist.ini can be modified append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); lives_ok { $zilla->release } 'Changes and dist.ini can be modified'; our_messages_are(<<'', 'reports master in clean state'); [Git::Check] branch master is in a clean state # ensure dist.ini does not match dist_ini append_to_file('dist_ini', 'Hello'); $git->add( qw{ dist_ini } ); $git->commit( { message => 'add dist_ini' } ); append_to_file('dist_ini', 'World'); throws_ok { $zilla->release } qr/uncommitted files/, 'dist_ini must not be modified'; our_messages_are(<<'', 'lists dist_ini as uncommitted'); [Git::Check] branch master has some uncommitted files: [Git::Check] dist_ini #--------------------------------------------------------------------- sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } #--------------------------------------------------------------------- sub our_messages_are { my ($expected, $name) = @_; my $got = join("\n", grep { /^\Q[Git::Check]\E/ } @{ $zilla->log_messages }); $got =~ s/\s*\z/\n/; local $Test::Builder::Level = $Test::Builder::Level + 1; is( $got, $expected, $name); $zilla->clear_log_events; } done_testing; Util.pm100644001750001750 1435612244203313 16005 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t# # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # #--------------------------------------------------------------------- package t::Util; # # Copyright 2012 Christopher J. Madsen # # Author: Christopher J. Madsen # Created: 6 Oct 2012 # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # # 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 either the # GNU General Public License or the Artistic License for more details. # # ABSTRACT: Utilities for testing Dist-Zilla-Plugin-Git #--------------------------------------------------------------------- use 5.010; use strict; use warnings; use Cwd qw(cwd); use File::Copy::Recursive qw(dircopy); use File::pushd qw(pushd tempd); use Git::Wrapper (); use Path::Class; use Test::DZil qw(Builder); use Test::More; use version 0.80 (); our ($base_dir, $base_dir_pushed, $dist_dir, $git_dir, $git, $zilla); use Exporter (); our @ISA = qw(Exporter); our @EXPORT = qw($base_dir $git_dir $git $zilla append_and_add append_to_file init_test keep_tempdir new_zilla_from_repo skip_unless_git_version slurp_text_file zilla_log_is); our @EXPORT_OK = qw($dist_dir throws_ok zilla_version); my $original_cwd; BEGIN { # Change back to the original directory when shutting down, # to avoid problems with cleaning up tmpdirs. $original_cwd = cwd(); # we chdir around so make @INC absolute @INC = map {; ref($_) ? $_ : dir($_)->absolute->stringify } @INC; } END { chdir $original_cwd if $original_cwd } #===================================================================== sub append_and_add { my $fn = $_[0]; &append_to_file; $git->add("$fn"); } # end append_and_add #--------------------------------------------------------------------- sub append_to_file { my $file = shift; my $fh = $git_dir->file($file)->open('>>:raw:utf8') or die "can't open $file: $!"; print $fh @_; close $fh; } #--------------------------------------------------------------------- sub init_test { my %opt = @_; $dist_dir = dir('.')->absolute; # root of the distribution # Make a new directory so we don't affect the source repo: $base_dir_pushed = tempd; $base_dir = dir($base_dir_pushed)->absolute; # Mock HOME to keep user's global Git config from causing problems: mkdir($ENV{HOME} = $base_dir->subdir('home')->stringify) or die "Failed to create $ENV{HOME}: $!"; delete $ENV{V}; # In case we're being released with a manual version # Create the test repo: $git_dir = $base_dir->subdir('repo'); $git_dir->mkpath; dircopy($dist_dir->subdir(corpus => $opt{corpus}), $git_dir) if defined $opt{corpus}; if (my $files = $opt{add_files}) { while (my ($name, $content) = each %$files) { my $fn = $git_dir->file($name); $fn->dir->mkpath; open my $fh, '>:raw:utf8', $fn or die "Can't open $fn: $!"; print { $fh } $content; close $fh; } } # end if add_files my $pushd = pushd($git_dir); system "git init --quiet" and die "Can't initialize repo"; $git = Git::Wrapper->new("$git_dir"); $git->config( 'push.default' => 'matching' ); # compatibility with Git 1.8 $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); } # end init_test #--------------------------------------------------------------------- sub keep_tempdir { $base_dir_pushed->preserve; print "Git files are in $git_dir\n"; } # end keep_tempdir #--------------------------------------------------------------------- sub new_zilla_from_repo { $zilla = Builder->from_config({dist_root => $git_dir}, @_); } # end zilla_from_repo #--------------------------------------------------------------------- our $git_version; sub skip_unless_git_version { my $need_version = shift; $git_version = version->parse( Git::Wrapper->new('.')->version =~ m[^( \d+ \. \d[.\d]+ )]x ) unless defined $git_version; if ( $git_version < version->parse($need_version) ) { my $why = "git $need_version or later required, you have $git_version"; if (my $tests = shift) { skip $why, $tests } # skip some else { plan skip_all => $why } # skip all } # end if we don't have the required version } # end skip_unless_git_version #--------------------------------------------------------------------- sub slurp_text_file { my ($filename) = @_; return scalar do { local $/; if (open my $fh, '<:utf8', $zilla->tempdir->file($filename)) { <$fh>; } else { diag("Unable to open $filename: $!"); undef; } }; } # end slurp_text_file #--------------------------------------------------------------------- # DON'T USE THIS FUNCTION # # It's a limited clone of Test::Exception's throws_ok I wrote to make # it easier to port the tests from Test::Exception to Test::Fatal. # Use Test::Fatal directly instead. sub throws_ok (&$;$) { my ($coderef, $expected, $name) = @_; # The test program must load Test::Fatal my $exception = &Test::Fatal::exception($coderef); local $Test::Builder::Level = $Test::Builder::Level + 1; like( $exception, $expected, $name); } # end throws_ok #--------------------------------------------------------------------- sub zilla_log_is { my ($matching, $expected, $name) = @_; $name //= "log messages for $matching"; $matching = qr /^\Q[$matching]\E/ unless ref $matching; my $got = join("\n", grep { /$matching/ } @{ $zilla->log_messages }); $got =~ s/\s*\z/\n/; local $Test::Builder::Level = $Test::Builder::Level + 1; is( $got, $expected, $name); $zilla->clear_log_events; } #--------------------------------------------------------------------- sub zilla_version { my $pushd = pushd($zilla->root); # Must be in the correct directory my $version = $zilla->version; return $version; } # end zilla_version #===================================================================== # Package Return Value: 1; __END__ META.json100644001750001750 3512712244203313 15707 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019{ "abstract" : "update your git repository after release", "author" : [ "Jerome Quelin" ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Dist-Zilla-Plugin-Git", "no_index" : { "directory" : [ "corpus", "t" ] }, "prereqs" : { "build" : { "requires" : { "Module::Build" : "0" } }, "configure" : { "requires" : { "Module::Build" : "0.3601", "version" : "0.80", "warnings" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "version" : "0.9901" } }, "runtime" : { "requires" : { "Cwd" : "0", "DateTime" : "0", "Dist::Zilla" : "4", "Dist::Zilla::Plugin::GatherDir" : "4.200016", "Dist::Zilla::Role::AfterBuild" : "0", "Dist::Zilla::Role::AfterMint" : "0", "Dist::Zilla::Role::AfterRelease" : "0", "Dist::Zilla::Role::BeforeRelease" : "0", "Dist::Zilla::Role::FilePruner" : "0", "Dist::Zilla::Role::GitConfig" : "0", "Dist::Zilla::Role::PluginBundle" : "0", "Dist::Zilla::Role::VersionProvider" : "0", "File::Spec" : "0", "File::Spec::Functions" : "0", "File::Temp" : "0", "File::chdir" : "0", "Git::Wrapper" : "0.021", "IPC::Open3" : "0", "IPC::System::Simple" : "0", "List::AllUtils" : "0", "List::Util" : "0", "Module::Runtime" : "0", "Moose" : "0", "Moose::Autobox" : "0", "Moose::Role" : "0", "Moose::Util::TypeConstraints" : "0", "MooseX::AttributeShortcuts" : "0", "MooseX::Has::Sugar" : "0", "MooseX::Types::Moose" : "0", "MooseX::Types::Path::Class" : "0", "Path::Class" : "0.22", "Path::Class::Dir" : "0", "String::Formatter" : "0", "Try::Tiny" : "0", "Version::Next" : "0", "constant" : "0", "namespace::autoclean" : "0.09", "perl" : "5.010", "strict" : "0", "version" : "0.80", "warnings" : "0" } }, "test" : { "requires" : { "Devel::SimpleTrace" : "0", "Dist::Zilla::File::InMemory" : "0", "Dist::Zilla::Plugin::Config::Git" : "0", "Dist::Zilla::Role::Releaser" : "0", "Dist::Zilla::Tester" : "0", "Encode" : "0", "Exporter" : "0", "File::Copy" : "0", "File::Copy::Recursive" : "0", "File::Path" : "2.07", "File::Spec" : "0", "File::Which" : "0", "File::pushd" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Log::Dispatchouli" : "0", "Test::DZil" : "0", "Test::Fatal" : "0.006", "Test::More" : "0.88", "lib" : "0", "utf8" : "0" } } }, "provides" : { "Dist::Zilla::Plugin::Git" : { "file" : "lib/Dist/Zilla/Plugin/Git.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::Check" : { "file" : "lib/Dist/Zilla/Plugin/Git/Check.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::Commit" : { "file" : "lib/Dist/Zilla/Plugin/Git/Commit.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::CommitBuild" : { "file" : "lib/Dist/Zilla/Plugin/Git/CommitBuild.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::GatherDir" : { "file" : "lib/Dist/Zilla/Plugin/Git/GatherDir.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::Init" : { "file" : "lib/Dist/Zilla/Plugin/Git/Init.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::NextVersion" : { "file" : "lib/Dist/Zilla/Plugin/Git/NextVersion.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::Push" : { "file" : "lib/Dist/Zilla/Plugin/Git/Push.pm", "version" : "2.019" }, "Dist::Zilla::Plugin::Git::Tag" : { "file" : "lib/Dist/Zilla/Plugin/Git/Tag.pm", "version" : "2.019" }, "Dist::Zilla::PluginBundle::Git" : { "file" : "lib/Dist/Zilla/PluginBundle/Git.pm", "version" : "2.019" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "file" : "lib/Dist/Zilla/Role/Git/DirtyFiles.pm", "version" : "2.019" }, "Dist::Zilla::Role::Git::Repo" : { "file" : "lib/Dist/Zilla/Role/Git/Repo.pm", "version" : "2.019" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-dist-zilla-plugin-git at rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Git" }, "homepage" : "http://search.cpan.org/dist/Dist-Zilla-Plugin-Git/", "repository" : { "type" : "git", "url" : "git://github.com/madsen/dist-zilla-plugin-git.git", "web" : "https://github.com/madsen/dist-zilla-plugin-git" }, "x_MailingList" : "http://www.listbox.com/subscribe/?list_id=139292" }, "version" : "2.019", "x_Dist_Zilla" : { "perl" : { "version" : "5.018001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Bootstrap::lib", "config" : { "Dist::Zilla::Role::Bootstrap" : { "distname" : "Dist-Zilla-Plugin-Git", "fallback" : "1", "try_built" : null, "try_built_method" : "mtime" } }, "name" : "Bootstrap::lib", "version" : "0.04000001" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "JQ/Git::NextVersion", "version" : null }, { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "JQ/GatherDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "script_finder" : [ ":ExecFiles" ] } }, "name" : "JQ/Test::Compile", "version" : "2.037" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "JQ/PodCoverageTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "JQ/PodSyntaxTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "JQ/ReportVersions::Tiny", "version" : "1.10" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "JQ/PruneCruft", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "JQ/PruneFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "JQ/ManifestSkip", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "JQ/AutoPrereqs", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "JQ/ExtraTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "JQ/NextRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "JQ/PkgVersion", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ] } }, "name" : "JQ/PodWeaver", "version" : "3.102000" }, { "class" : "Dist::Zilla::Plugin::Prepender", "name" : "JQ/Prepender", "version" : "1.112280" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "JQ/ExecDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "JQ/ShareDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Bugtracker", "name" : "JQ/Bugtracker", "version" : "1.111080" }, { "class" : "Dist::Zilla::Plugin::Homepage", "name" : "JQ/Homepage", "version" : "1.101420" }, { "class" : "Dist::Zilla::Plugin::Repository", "name" : "JQ/Repository", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "JQ/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : {}, "Dist::Zilla::Role::MetaProvider::Provider" : { "inherit_missing" : "1", "inherit_version" : "1", "meta_noindex" : "1" } }, "name" : "JQ/MetaProvides::Package", "version" : "1.15000000" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "JQ/MetaConfig", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::HelpWanted", "name" : "JQ/HelpWanted", "version" : "0.3.1" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "JQ/License", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Covenant", "name" : "JQ/Covenant", "version" : "0.1.0" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "JQ/MetaYAML", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "JQ/MetaJSON", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "JQ/Readme", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "name" : "JQ/ReadmeAnyFromPod", "version" : "0.131500" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "JQ/Manifest", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::CheckChangeLog", "name" : "JQ/CheckChangeLog", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "JQ/TestRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "JQ/Git::Check", "version" : null }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "JQ/Git::Commit", "version" : null }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "JQ/Git::Tag", "version" : null }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "JQ/Git::Push", "version" : null }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "JQ/UploadToCPAN", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ModuleBuild::Custom", "name" : "ModuleBuild::Custom", "version" : "4.16" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : ":BuildPL", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "ConfirmRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.006" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.006" } }, "x_author_pledge" : { "version" : 1 } } commit.t100644001750001750 267412244203313 16167 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 1; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } # build fake repository my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit')->absolute, }); chdir $zilla->tempdir->subdir('source'); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # do a release, with changes and dist.ini updated append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); $zilla->release; # check if dist.ini and changelog have been committed my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, 'commit message taken from changelog' ); sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } repo-dir.t100644001750001750 341412244203313 16411 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use File::Copy 'move'; use Test::More tests => 1; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } # build fake repository my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/repo-dir')->absolute, }); chdir $zilla->tempdir->subdir( 'source' ); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); mkdir 'dist'; # move corpus files to subdir of git repo move 'dist.ini', 'dist/dist.ini'; move 'Changes', 'dist/Changes'; # do a release in a subdir; the git repo is one level up chdir 'dist'; $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); # create a new zilla with dist root in the right place my $zilla2 = Dist::Zilla::Dist::Builder->from_config( { chrome => Dist::Zilla::Chrome::Test->new } ); $zilla2->release; # check if dist.ini and changelog have been committed my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, 'commit message taken from changelog' ); sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } MANIFEST.SKIP100644001750001750 14412244203313 16113 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019~$ \$$ ^\# ^blib/ \bcjm_ ^pm_to_blib$ ^Dist-Zilla-Plugin-Git-\d ^_build\b ^Build$ ^Build.bat$ ^tmp/ gatherdir.t100644001750001750 624612244203313 16647 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Dist::Zilla 1.093250; use Test::DZil; use File::pushd; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 5; use t::Util; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); for my $test ( { name => 'default', config => simple_ini('Git::GatherDir'), files => [ qw(lib/DZT/Sample.pm share/tracked tracked) ], }, { name => 'include_dotfiles', config => simple_ini([ 'Git::GatherDir', { include_dotfiles => 1 } ]), files => [ qw(.gitignore .tracked lib/DZT/Sample.pm share/tracked tracked) ], }, { name => 'include_untracked', min_git=> '1.5.4', config => simple_ini([ 'Git::GatherDir', { include_untracked => 1 } ]), files => [ qw(dist.ini lib/DZT/Sample.pm share/tracked tracked untracked) ], }, { name => 'include both', min_git=> '1.6.5.2', config => simple_ini([ 'Git::GatherDir', { include_dotfiles => 1, include_untracked => 1 } ]), files => [ qw(.gitignore .tracked .untracked dist.ini lib/DZT/Sample.pm share/tracked tracked untracked) ], }, { name => 'exclude_filename', config => simple_ini([ 'Git::GatherDir', { exclude_filename => 'tracked' } ]), files => [ qw(lib/DZT/Sample.pm share/tracked) ], }, ) { SKIP: { skip_unless_git_version($test->{min_git}, 1) if $test->{min_git}; my $tzil = Builder->from_config( { dist_root => dir('corpus/gatherdir')->absolute }, { add_files => { 'source/ignored' => "This is ignored.\n", 'source/untracked' => "This is not tracked.\n", 'source/tracked' => "This is tracked.\n", 'source/share/tracked' => "This is tracked, in a subdir.\n", 'source/.tracked' => "This is a tracked dotfile.\n", 'source/.ignored' => "This is an ignored dotfile.\n", 'source/.untracked' => "This is an untracked dotfile.\n", 'source/.gitignore' => "*ignore*\n", 'source/dist.ini' => $test->{config}, }, }, ); for my $token (pushd( $tzil->tempdir->subdir('source') )) { system "git init" and die "error initializing git repo"; } my $git = Git::Wrapper->new( $tzil->tempdir->subdir('source')->stringify ); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); # check in tracked files # we cannot ship it in the dist, since PruneCruft plugin would trim it # Don't use --force, because only -f works before git 1.5.6 $git->add( -f => qw(lib share tracked .tracked .gitignore) ); $git->commit( { message=>'files known to git' } ); $tzil->build; is_deeply( [ sort map {; $_->name } @{ $tzil->files } ], $test->{files}, "the right files were gathered with $test->{name}", ); } # end SKIP } # end for my $test commit-ws.t100644001750001750 270112244203313 16605 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 1; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-ws')->absolute, }); # build fake repository chdir $zilla->tempdir->subdir('source'); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # do a release, with changes and dist.ini updated append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); $zilla->release; # check if dist.ini and changelog have been committed my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, 'commit message taken from changelog' ); sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } AUTHOR_PLEDGE100644001750001750 105112244203313 16200 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019 # CPAN Covenant for Dist-Zilla-Plugin-Git I, Jerome Quelin, hereby give modules@perl.org permission to grant co-maintainership to Dist-Zilla-Plugin-Git, if all the following conditions are met: (1) I haven't released the module for a year or more (2) There are outstanding issues in the module's public bug tracker (3) Email to my CPAN email address hasn't been answered after a month (4) The requester wants to make worthwhile changes that will benefit CPAN In the event of my death, then the time-limits in (1) and (3) do not apply. push-multi.t100644001750001750 344612244203313 17004 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Git::Wrapper; use Path::Class 0.22; # dir->basename use Test::More 0.88; # done_testing use t::Util; # rt#56485 - skip test to avoid failures for old git versions skip_unless_git_version('1.7.0'); plan tests => 7; init_test(corpus => 'push-multi'); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # create a clone, and use it to set up origin my $clone1 = $base_dir->subdir('clone1'); my $clone2 = $base_dir->subdir('clone2'); $git->clone( { quiet=>1, 'no-checkout'=>1, bare=>1 }, "$git_dir", "$clone1" ); $git->clone( { quiet=>1, 'no-checkout'=>1, bare=>1 }, "$git_dir", "$clone2" ); $git->remote('add', 'origin', "$clone1"); $git->remote('add', 'another', "$clone2"); $git->config('branch.master.remote', 'origin'); $git->config('branch.master.merge', 'refs/heads/master'); # do the release append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); new_zilla_from_repo; $zilla->release; # Check log zilla_log_is('Git::Push', <<''); [Git::Push] pushing to origin [Git::Push] pushing to another for my $c ( $clone1, $clone2 ) { # check if everything was pushed my $git = Git::Wrapper->new( "$c" ); my $cName = $c->basename; my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, "commit pushed to $cName" ); # check if tag has been correctly created my @tags = $git->tag; is( scalar(@tags), 1, "one tag pushed to $cName" ); is( $tags[0], 'v1.23', "found v1.23 tag in $cName" ); } done_testing; tag-signed.t100644001750001750 424312244203313 16713 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Copy qw{ cp }; use File::Temp qw{ tempdir }; use File::Path 2.07 qw{ make_path }; # 2.07 required for make_path use Git::Wrapper; use Path::Class; use File::Which qw{ which }; use Test::More; which('gpg') ? plan tests => 7 : plan skip_all => q{gpg couldn't be located in $PATH; required for GPG-signed tags}; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = $ENV{GNUPGHOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } delete $ENV{GIT_COMMITTER_NAME}; delete $ENV{GIT_COMMITTER_EMAIL}; cp 'corpus/dzp-git.pub', "$ENV{GNUPGHOME}/pubring.gpg"; cp 'corpus/dzp-git.sec', "$ENV{GNUPGHOME}/secring.gpg"; # build fake repository my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/tag-signed')->absolute, }); chdir $zilla->tempdir->subdir('source'); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->config( 'user.signingkey' => '7D85ED44'); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # do the release $zilla->release; # check if tag has been correctly created my @tags = $git->tag; is( scalar(@tags), 1, 'one tag created' ); is( $tags[0], 'v1.23', 'new tag created after new version' ); is( $tags[0], $zilla->plugin_named('Git::Tag')->tag(), 'new tag matches the tag the plugin claims is the tag.'); # Check that it is a signed tag my @lines = $git->show('v1.23'); my $tag = join "\n", @lines; like( $tag, qr/^tag v1.23/m, 'Is it a real tag?' ); like( $tag, qr/^Tagger: dzp-git test /m, 'Is it a real tag?' ); like( $tag, qr/PGP SIGNATURE/m, 'Is it GPG-signed?' ); # attempting to release again should fail eval { $zilla->release }; like($@, qr/tag v1\.23 already exists/, 'prohibit duplicate tag'); 00-compile.t100644001750001750 260212244203313 16533 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/tuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.037 use Test::More tests => 12 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Dist/Zilla/Plugin/Git.pm', 'Dist/Zilla/Plugin/Git/Check.pm', 'Dist/Zilla/Plugin/Git/Commit.pm', 'Dist/Zilla/Plugin/Git/CommitBuild.pm', 'Dist/Zilla/Plugin/Git/GatherDir.pm', 'Dist/Zilla/Plugin/Git/Init.pm', 'Dist/Zilla/Plugin/Git/NextVersion.pm', 'Dist/Zilla/Plugin/Git/Push.pm', 'Dist/Zilla/Plugin/Git/Tag.pm', 'Dist/Zilla/PluginBundle/Git.pm', 'Dist/Zilla/Role/Git/DirtyFiles.pm', 'Dist/Zilla/Role/Git/Repo.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; my @warnings; for my $lib (@module_files) { # see L open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; commit-utf8.t100644001750001750 360112244203313 17042 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use utf8; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use Encode qw( decode ); use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More; plan skip_all => "Dist::Zilla 5 required" if Dist::Zilla->VERSION < 5; plan tests => 1; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } # UTF-8 encoded strings: my $changes1 = 'Ævar Arnfjörð Bjarmason'; my $changes2 = 'ブログの情報'; my $changes3 = 'plain ASCII'; # build fake repository my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit')->absolute, },{ add_files => { 'source/Changes' => <<"END CHANGES", Changes 1.23 2012-11-10 19:15:45 CET - $changes1 - $changes2 - $changes3 END CHANGES }, }); chdir $zilla->tempdir->subdir('source'); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # do a release, with changes and dist.ini updated append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); $zilla->release; # check if dist.ini and changelog have been committed my ($log) = $git->log( 'HEAD' ); like( decode('UTF-8', $log->message), qr/v1.23\n[^a-z]*\Q$changes1\E[^a-z]*\Q$changes2\E[^a-z]*\Q$changes3\E/, 'commit message taken from changelog' ); sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } commit-build.t100644001750001750 611212244203313 17253 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 6; use Cwd qw(cwd); # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-build')->absolute, }); # build fake repository chdir $zilla->tempdir->subdir('source'); system "git init -q"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); $zilla->build; ok( $git->rev_parse('-q', '--verify', 'refs/heads/build/master'), 'source repo has the "build/master" branch') or diag $git->branch; is( scalar $git->log('build/master'), 1, 'one commit on the build/master branch') or diag $git->branch; is( scalar $git->ls_tree('build/master'), 2, 'two files in latest commit on the build/master branch') or diag $git->branch; chdir $cwd; my $zilla2 = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-build')->absolute, }); # build fake repository chdir $zilla2->tempdir->subdir('source'); system "git init -q"; my $git2 = Git::Wrapper->new('.'); $git2->config( 'user.name' => 'dzp-git test' ); $git2->config( 'user.email' => 'dzp-git@test' ); $git2->remote('add','origin', $zilla->tempdir->subdir('source')->stringify); $git2->fetch; $git2->reset('--hard','origin/master'); $git2->checkout('-b', 'topic/1'); append_to_file('dist.ini', "\n"); $git2->commit('-a', '-m', 'commit on topic branch'); $zilla2->build; ok( $git2->rev_parse('-q', '--verify', 'refs/heads/build/topic/1'), 'source repo has the "build/topic/1" branch') or diag $git2->branch; chdir $cwd; my $zilla3 = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-build')->absolute, }); # build fake repository chdir $zilla3->tempdir->subdir('source'); system "git init -q"; my $git3 = Git::Wrapper->new('.'); $git3->config( 'user.name' => 'dzp-git test' ); $git3->config( 'user.email' => 'dzp-git@test' ); $git3->remote('add','origin', $zilla->tempdir->subdir('source')->stringify); $git3->fetch; $git3->branch('build/master', 'origin/build/master'); $git3->reset('--hard','origin/master'); append_to_file('dist.ini', "\n\n"); $git3->commit('-a', '-m', 'commit on master'); $zilla3->build; is( scalar $git3->log('build/master'), 2, 'two commits on the build/master branch') or diag $git3->branch; is( scalar $git->ls_tree('build/master'), 2, 'two files in latest commit on the build/master branch') or diag $git->branch; sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } corpus000755001750001750 012244203313 15411 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019dzp-git.sec100644001750001750 245612244203313 17632 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusNViH0x?>T㉶pS^]?IMgԧͰa`i|9Nv@ip}:sP f /p "NV   !p}D,UGJx (AcrYo BbO3n %c0b+xܐSѣrˆQJ%3^G*snn,X rx2$^yʱNVλjh <+pKDOW8 QCO gFf%X2orCZKdjZ:xEهAo7iP9)j5 я>.C|нJZfbVA]`K;eKsūT(1~&ZT @G5s#b &Da.jS *vj" Sm2#s D٤\+ڮ.-sw/1ۗZ kC'j߉j}{Z`Og S-<|,/,$xS8PI5"[Ko u=Fbiܸz%LpK7m.KU}if1l^Mf NV !p}DAju4vr}q{L|)"ZDz{#?dzW0:FǩX GB9n)V"S?7o?1dـo SѼvaH{n6U|Rdzp-git.pub100644001750001750 122612244203313 17640 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusNViH0x?>T㉶pS^]?IMgԧͰa`i|9Nv@ip}:sP f /p "NV   !p}D,UGJx (AcrYo BbO3n %c0b+xܐSѣrˆQJ%3^G*snn,X rx2$^yʱNVλjh <+pKDOW8 QCO gFf%X2orCZKdjZ:xEهAo7iP9)j5 я>.C|нJZfb 'Dist::Zilla::Plugin::Config::Git not installed' if $@ and $@ !~ /^Can't locate /; # rt#56485 - skip test to avoid failures for old git versions skip_unless_git_version('1.7.0'); plan tests => 7; init_test(corpus => 'push-gitconfig'); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # create a clone, and use it to set up 'genesis' my $clone = $base_dir->subdir('clone'); $git->clone( { quiet=>1, 'no-checkout'=>1, bare=>1 }, "$git_dir", "$clone" ); $git->remote('add', 'genesis', "$clone"); $git->config('branch.master.remote', 'genesis'); $git->config('branch.master.merge', 'refs/heads/master'); # do the release append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); new_zilla_from_repo; $zilla->release; # Check log zilla_log_is('Git::Push', <<''); [Git::Push] pushing to genesis master:master # check if everything was pushed $git = Git::Wrapper->new( "$clone" ); my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, 'commit pushed' ); # check if tag has been correctly created my @tags = $git->tag; is( scalar(@tags), 1, 'one tag pushed' ); is( $tags[0], 'v1.23', 'new tag created after new version' ); # try a release with a bogus remote append_to_file('dist.ini', <<'END dist.ini'); push_to = bogus unmodified END dist.ini new_zilla_from_repo; my $exception = exception { $zilla->release }; like($exception, qr/^\Q[Git::Push] These remotes do not exist: bogus\E/, 'Caught bogus remote'); zilla_log_is('Git::Push', <<''); [Git::Push] These remotes do not exist: bogus is_deeply($zilla->plugin_named('Git::Push')->push_to, [ 'bogus unmodified' ], "git_config->push_to is overridden"); done_testing; version-regexp.t100644001750001750 165112244203313 17646 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/tuse strict; use warnings; use Path::Class; use Test::More 0.88 tests => 6; use t::Util qw(:DEFAULT zilla_version); init_test(corpus => 'version-regexp'); ## shortcut for new tester object sub new_zilla_version { new_zilla_from_repo; zilla_version; } ## Tests start here $git->add("."); $git->commit({ message => 'import' }); # with no tags and no initialization, should get default is( new_zilla_version, "0.01", "default is 0.01" ); # set in dist.ini # initialize it { local $ENV{V} = "1.23"; is( new_zilla_version, "1.23", "initialized with \$ENV{V}" ); } # tag it $git->tag("release-v1.2.3"); ok( (grep { /release-v1\.2\.3/ } $git->tag), "wrote v1.2.3 tag" ); { is( new_zilla_version, "v1.2.4", "initialized from last tag" ); } # tag it $git->tag("release-1.23"); ok( (grep { /release-1\.23/ } $git->tag), "wrote v1.23 tag" ); { is( new_zilla_version, "1.24", "initialized from last tag" ); } done_testing; commit-message.t100644001750001750 1233312244203313 17622 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#! /usr/bin/perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # #--------------------------------------------------------------------- # Test the get_commit_message method in Git::Commit use 5.008; use strict; use warnings; use Test::More 0.88; # want done_testing plan tests => 20; use Dist::Zilla::File::InMemory (); use Dist::Zilla::Plugin::Git::Commit (); use Log::Dispatchouli (); #===================================================================== { package Mock_Zilla; use Moose; has version => qw(is ro); has files => qw(is ro), default => sub { [] }; sub isa { 1 } # just cheat and claim we're anything __PACKAGE__->meta->make_immutable; }; #===================================================================== # Utility functions #--------------------------------------------------------------------- sub is_log { my ($plugin, $expected) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; is_deeply([ map {; $_->{message} } @{ $plugin->logger->events } ], $expected); } # end is_log #--------------------------------------------------------------------- my $zilla; # must be global, because $plugin->zilla is a weakref sub new_plugin { my $version = shift; my $changes = pop @_; $zilla = Mock_Zilla->new(version => $version); if (defined $changes) { push @{ $zilla->files }, Dist::Zilla::File::InMemory->new( name => 'Changes', content => $changes, ); } Dist::Zilla::Plugin::Git::Commit->new( plugin_name => 'Git::Commit', zilla => $zilla, logger => Log::Dispatchouli->new_tester, @_ ); } # end new_plugin #===================================================================== { my $plugin = new_plugin('1.00'); is($plugin->get_commit_message, "v1.00\n\n", '1.00 without Changes file'); is_log($plugin, ['WARNING: Unable to find Changes']); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.00', <<'EOT'); This is the changelog for Foobar 1.00 2012-12-01 Some unspecified changes EOT is($plugin->get_commit_message, <<'EOM', '1.00 with blank line'); v1.00 Some unspecified changes EOM is_log($plugin, []); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.00', <<'EOT'); This is the changelog for Foobar 1.00 2012-12-01 Some unspecified changes EOT is($plugin->get_commit_message, <<'EOM', '1.00 without blank line'); v1.00 Some unspecified changes EOM is_log($plugin, []); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.01', <<'EOT'); This is the changelog for Foobar 1.01 2012-12-01 Some unspecified changes 1.00 2012-11-30 Some previous changes EOT is($plugin->get_commit_message, <<'EOM', '1.01 with changes'); v1.01 Some unspecified changes EOM is_log($plugin, []); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.01', <<'EOT'); This is the changelog for Foobar 1.00 2012-12-01 Some unspecified changes EOT is($plugin->get_commit_message, "v1.01\n\n", '1.01 not in Changes'); is_log($plugin, ['WARNING: Unable to find 1.01 in Changes']); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.00', <<'EOT'); This is the changelog for Foobar 1.00-TRIAL 2012-12-01 Some unspecified changes EOT is($plugin->get_commit_message, <<'EOM', '1.00-TRIAL'); v1.00 Some unspecified changes EOM is_log($plugin, []); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.00', <<'EOT'); This is the changelog for Foobar 1.00_TRIAL 2012-12-01 Some unspecified changes EOT is($plugin->get_commit_message, <<'EOM', '1.00_TRIAL'); v1.00 Some unspecified changes EOM is_log($plugin, []); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.01', <<'EOT'); This is the changelog for Foobar 1.01 2012-12-01 1.00 2012-11-30 Some previous changes EOT is($plugin->get_commit_message, "v1.01\n\n", '1.01 with no changes'); is_log($plugin, ['WARNING: No changes listed under 1.01 in Changes']); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.01', <<'EOT'); This is the changelog for Foobar 1.01 2012-12-01 Some unspecified changes with extra blank line 1.00 2012-11-30 Some previous changes EOT is($plugin->get_commit_message, <<'EOM', '1.01 with extra blank line'); v1.01 Some unspecified changes with extra blank line EOM is_log($plugin, []); } #--------------------------------------------------------------------- { my $plugin = new_plugin('1.00', <<'EOT'); 1.00 2012-11-30 Some unspecified changes EOT is($plugin->get_commit_message, <<'EOM', '1.00 at BOF'); v1.00 Some unspecified changes EOM is_log($plugin, []); } #--------------------------------------------------------------------- done_testing; dist.ini100644001750001750 24312244203313 17747 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/tagname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [FakeRelease] [Git::Tag] push000755001750001750 012244203313 16370 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7412244203313 17764 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/pushChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz check000755001750001750 012244203313 16466 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusfoobar100644001750001750 4112244203313 17754 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/checkthis file is meant for testing...version-default.t100644001750001750 231212244203313 17773 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/tuse strict; use warnings; use Path::Class; use Test::More 0.88 tests => 9; use t::Util qw(:DEFAULT zilla_version); init_test(corpus => 'version-default'); ## shortcut for new tester object sub new_zilla_version { new_zilla_from_repo; zilla_version; } ## Tests start here # with no tags and no initialization, should get default is( new_zilla_version, "0.001", "works with no commits" ); $git->add("."); $git->commit({ message => 'import' }); # with no tags and no initialization, should get default is( new_zilla_version, "0.001", "default is 0.001" ); # initialize it { local $ENV{V} = "1.23"; is( new_zilla_version, "1.23", "initialized with \$ENV{V}" ); } # add a tag that doesn't match the regex $git->tag("revert-me-later"); ok( (grep { /revert-me-later/ } $git->tag), "wrote revert-me-later tag" ); { is( new_zilla_version, "0.001", "default is 0.001" ); } # tag it $git->tag("v1.2.3"); ok( (grep { /v1\.2\.3/ } $git->tag), "wrote v1.2.3 tag" ); { is( new_zilla_version, "1.2.4", "initialized from last tag" ); } # tag it $git->tag("v1.23"); ok( (grep { /v1\.23/ } $git->tag), "wrote v1.23 tag" ); { is( new_zilla_version, "1.24", "initialized from last tag" ); } done_testing; commit-dirtydir.t100644001750001750 350112244203313 20005 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Cwd qw( cwd ); use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use Git::Wrapper; use Path::Class; use File::Temp qw/tempdir/; use lib 't/lib'; use Test::More tests => 3; # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } # build fake repository my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-dirtydir')->absolute, }); chdir $zilla->tempdir->subdir('source'); system "git init"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); # do a release, with changes and dist.ini updated append_to_file('Changes', "\n"); append_to_file('dist.ini', "\n"); $zilla->release; # check if dist.ini and changelog have been committed my ($log) = $git->log( 'HEAD' ); like( $log->message, qr/v1.23\n[^a-z]*foo[^a-z]*bar[^a-z]*baz/, 'commit message taken from changelog' ); # check if we committed our tarball my @files = $git->ls_files( { cached => 1 } ); ok( ( grep { $_ =~ /releases/ } @files ), "We committed the tarball" ); # We should have no dirty files uncommitted # ignore the "DZP-git.9y5u" temp file, ha! @files = $git->ls_files( { others => 1, modified => 1, unmerged => 1 } ); ok( @files == 1, "No untracked files left" ); sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } dist.ini100644001750001750 31212244203313 20150 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/pushname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [FakeRelease] [Git::Commit] [Git::Tag] [Git::Push] Changes100644001750001750 7312244203313 20061 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/checkChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz commit000755001750001750 012244203313 16701 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7312244203313 20274 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commitChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz version-by-branch.t100644001750001750 1056512244203313 20245 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/tuse strict; use warnings; use Test::DZil qw(dist_ini); use Path::Class; use File::pushd qw(pushd); use Test::More 0.88; # done_testing use Test::Fatal 0.006 qw( lives_ok ); use t::Util qw(:DEFAULT throws_ok zilla_version); skip_unless_git_version('1.6.1'); # need --simplify-by-decoration plan tests => 31; init_test( add_files => { Changes => "Just getting started\n", 'dist.ini' => dist_ini( {qw( name Foo author foobar license Perl_5 abstract Test-Library copyright_holder foobar copyright_year 2009 )}, [ 'Git::NextVersion', { version_by_branch => 1 } ], 'FakeRelease', ), }, # end add_files ); #--------------------------------------------------------------------- ## shortcut for new tester object my $cache = '.gitnxtver_cache'; sub _new_zilla { my ($rev, $tag) = @_; my %test_config; if ($rev) { my ($sha) = $git->rev_parse($rev); $test_config{add_files}{"source/$cache"} = "$sha $tag\n"; } new_zilla_from_repo(\%test_config); } sub _zilla_version { _new_zilla(@_); zilla_version; } # Check the contents (or absence) of .gitnxtver_cache: sub head_last_ver { my ($last_ver) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; if (defined $last_ver) { my ($head) = $git->rev_parse('HEAD'); is(slurp_text_file("source/$cache"), "$head $last_ver\n", "cache file contains $last_ver"); } else { ok( !-f $zilla->root->file($cache), "no cache file created"); } } # end head_last_ver # with no tags and no initialization, should get default is( _zilla_version, "0.001", "works with no commits" ); head_last_ver(undef); $git->add("."); $git->commit({ message => 'import' }); # with no tags and no initialization, should get default is( _zilla_version, "0.001", "default is 0.001" ); head_last_ver(undef); # initialize it using V= { local $ENV{V} = "1.23"; is( _zilla_version, "1.23", "initialized with \$ENV{V}" ); head_last_ver(undef); } # add a tag that doesn't match the regex $git->tag("revert-me-later"); ok( (grep { /revert-me-later/ } $git->tag), "wrote revert-me-later tag" ); is( _zilla_version, "0.001", "default is 0.001" ); head_last_ver(undef); # tag 1.2.3 append_and_add(Changes => "1.2.3 now\n"); $git->commit({ message => 'committing 1.2.3'}); $git->tag("v1.2.3"); ok( (grep { /v1\.2\.3/ } $git->tag), "wrote v1.2.3 tag" ); is( _zilla_version, "1.2.4", "initialized from last tag" ); head_last_ver("1.2.3"); # make a dev branch $git->checkout(qw(-b dev)); # tag first dev release 1.3.0 append_and_add(Changes => "1.3.0 dev release\n"); $git->commit({ message => 'committing 1.3.0'}); $git->tag("v1.3.0"); ok( (grep { /v1\.3\.0/ } $git->tag), "wrote v1.3.0 tag" ); is( _zilla_version, "1.3.1", "initialized from 1.3.0 tag" ); head_last_ver("1.3.0"); # go back to master branch $git->checkout(qw(master)); is( _zilla_version, "1.2.4", "initialized from 1.2.3 tag on master" ); head_last_ver("1.2.3"); # tag stable 1.2.4 append_and_add(Changes => "1.2.4 stable release\n"); $git->commit({ message => 'committing 1.2.4 on master'}); $git->tag("v1.2.4"); ok( (grep { /v1\.2\.4/ } $git->tag), "wrote v1.2.4 tag" ); is( _zilla_version, "1.2.5", "initialized from 1.2.4 tag" ); head_last_ver("1.2.4"); # go back to dev branch $git->checkout(qw(dev)); append_and_add(Changes => "1.3.1 in progress\n"); $git->commit({ message => 'committing 1.3.1 change'}); is( _zilla_version, "1.3.1", "using dev branch 1.3.0 tag" ); head_last_ver("1.3.0"); # go back to master branch $git->checkout(qw(master)); append_and_add(Changes => "1.2.5 still in progress\n"); $git->commit({ message => 'committing 1.2.5 change'}); is( _zilla_version, "1.2.5", "using master branch 1.2.4 tag" ); head_last_ver("1.2.4"); # see if it reads the cache is( _zilla_version(qw(HEAD 1.2.6)), "1.2.7", "using (fake) cached 1.2.6 tag" ); head_last_ver("1.2.6"); # see if it ignores a stale cache is( _zilla_version(qw(HEAD~1 1.2.6)), "1.2.5", "ignoring stale cached 1.2.6 tag" ); head_last_ver("1.2.4"); # see if it catches a duplicate version _new_zilla(qw(HEAD 1.2.3)); lives_ok { $zilla->build } "builds with duplicate version"; is( $zilla->version, "1.2.4", "version is duplicate" ); throws_ok { $zilla->release } qr/version 1\.2\.4 has already been tagged/, "don't release duplicate version"; #keep_tempdir; done_testing; dist.ini100644001750001750 26212244203313 20465 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commitname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [FakeRelease] [Git::Commit] version-extraction.t100644001750001750 345412244203313 20537 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#! /usr/bin/perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # # # Test the _max_version_from_tags function of Git::NextVersion #--------------------------------------------------------------------- use strict; use warnings; use Test::More 0.88 tests => 10; # done_testing use Dist::Zilla::Plugin::Git::NextVersion (); #--------------------------------------------------------------------- sub t { my $name = "@_"; my $regexp = shift; my $expect = shift; undef $expect if $expect eq 'undef'; local $Test::Builder::Level = $Test::Builder::Level + 1; # This prevents RT#81061 from recurring (thanks, Matthew Horsfall): local $1; # ensure version.pm exhibits its buggy behavior with $1 is(Dist::Zilla::Plugin::Git::NextVersion::_max_version( Dist::Zilla::Plugin::Git::NextVersion::_versions_from_tags( $regexp, \@_ )), $expect, $name); } # end t #--------------------------------------------------------------------- t qw{(.+) 1.00 0.1 0.23 0.99 1.00 0.975 }; t qw{v(.+) 1.00 v0.1 v0.23 v0.99 v1.00 v0.975 }; t qw{v(.+) 1.00 invalid versions ok v1.00 v0.1 validate }; t qw{v(.+) undef }; t qw{v(.+) undef validate version verification }; t qw{v(.+) 2.010 validate version v2.010 verification v1.1234 }; # Don't use a regexp that extracts -TRIAL, but it shouldn't crash if you do: t qw{v(.+) 1.00 v1.00 v1.02-TRIAL v0.99 }; t qw{v([\d._]+) 1.02 v1.00 v1.02-TRIAL v0.99 }; # better regexp # Try versions with underscore: t qw{(.+) 1.00_01 0.1 0.23 0.99 1.00 0.975 1.00001 1.00_01 0.900_01 }; t qw{v(.+) 1.00_01 v0.1 v0.23 v1.00 v1.00001 v1.00_01 v0.900_01 }; done_testing; release-pod-syntax.t100644001750001750 104012244203313 20405 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); repo-dir000755001750001750 012244203313 17132 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7312244203313 20525 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/repo-dirChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz commit-build-custom.t100644001750001750 320712244203313 20565 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 5; use Cwd qw(cwd); # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $cwd = cwd(); END { chdir $cwd if $cwd } my $zilla = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-build-custom')->absolute, }); # build fake repository chdir $zilla->tempdir->subdir('source'); system "git init -q"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); $git->branch(-m => 'dev'); $zilla->build; ok( eval { $git->rev_parse('-q', '--verify', 'refs/heads/build-dev') }, 'source repo has the "build-dev" branch') or diag explain $@, $git->branch; is( scalar $git->log('build-dev'), 1, 'one commit on the build-dev branch') or diag $git->branch; $zilla->release; ok( eval { $git->rev_parse('-q', '--verify', 'refs/heads/release') }, 'source repo has the "release" branch') or diag explain $@, $git->branch; my @logs = $git->log('release'); is( scalar(@logs), 1, 'one commit on the release branch') or diag $git->branch; like( $logs[0]->message, qr/^Release of 1\.23\b/, 'correct release commit log message generated'); commit-ws000755001750001750 012244203313 17330 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 16412244203313 20744 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commit-wsChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz 1.22 2009-11-15 12:13:14 CET - biff - boff dist.ini100644001750001750 30212244203313 20711 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/repo-dirname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [FakeRelease] [Git::Commit] repo_root = .. release-pod-coverage.t100644001750001750 135512244203313 20663 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); push-multi000755001750001750 012244203313 17520 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7612244203313 21116 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/push-multiChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz dist.ini100644001750001750 27112244203313 21114 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commit-wsname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [FakeRelease] [Git::Commit] tag-signed000755001750001750 012244203313 17433 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7312244203313 21026 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/tag-signedChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz dist.ini100644001750001750 35612244203313 21310 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/push-multiname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [FakeRelease] [Git::Commit] [Git::Tag] [Git::Push] push_to = origin push_to = another dist.ini100644001750001750 25612244203313 21222 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/tag-signedname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [FakeRelease] [Git::Tag] signed = 1 000-report-git-version.t100644001750001750 64612244203313 20730 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#! /usr/bin/perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # #--------------------------------------------------------------------- use strict; use warnings; use Test::More tests => 1; diag(`git --version`); ok(1); commit-build000755001750001750 012244203313 17776 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7312244203313 21371 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commit-buildChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz version-regexp000755001750001750 012244203313 20366 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusfoobar100644001750001750 4112244203313 21654 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/version-regexpthis file is meant for testing...dist.ini100644001750001750 30412244203313 21557 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commit-buildname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [PruneCruft] [FakeRelease] [Git::CommitBuild] Plugin000755001750001750 012244203313 20060 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/ZillaGit.pm100644001750001750 446612244203313 21313 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/Zilla/Plugin# # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use 5.008; use strict; use warnings; package Dist::Zilla::Plugin::Git; { $Dist::Zilla::Plugin::Git::VERSION = '2.019'; } # ABSTRACT: update your git repository after release use Dist::Zilla 2.100880; # Need mvp_multivalue_args in Plugin role 1; __END__ =pod =head1 NAME Dist::Zilla::Plugin::Git - update your git repository after release =head1 VERSION version 2.019 =head1 DESCRIPTION This set of plugins for L can do interesting things for module authors using Git (L) to track their work. The following plugins are provided in this distribution: =over 4 =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back A L bundle is also provided for your convenience, check its documentation to see which plugins it will load. You need Git 1.5.4 or later to use these plugins. Some plugins require a more recent version of Git for certain features. =head1 SEE ALSO You can look for information on this module at: =over 4 =item * Search CPAN L =item * See open / report bugs L =item * Mailing-list (same as L) L =item * Git repository L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =back =head1 AUTHOR Jerome Quelin =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Jerome Quelin. 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 000-report-versions-tiny.t100644001750001750 1206712244203313 21353 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/tuse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n"; eval { # no excuses! # report our Perl details my $want = '5.010'; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('Cwd','any version') }; eval { $v .= pmver('DateTime','any version') }; eval { $v .= pmver('Devel::SimpleTrace','any version') }; eval { $v .= pmver('Dist::Zilla','4') }; eval { $v .= pmver('Dist::Zilla::File::InMemory','any version') }; eval { $v .= pmver('Dist::Zilla::Plugin::Config::Git','any version') }; eval { $v .= pmver('Dist::Zilla::Plugin::GatherDir','4.200016') }; eval { $v .= pmver('Dist::Zilla::Role::AfterBuild','any version') }; eval { $v .= pmver('Dist::Zilla::Role::AfterMint','any version') }; eval { $v .= pmver('Dist::Zilla::Role::AfterRelease','any version') }; eval { $v .= pmver('Dist::Zilla::Role::BeforeRelease','any version') }; eval { $v .= pmver('Dist::Zilla::Role::FilePruner','any version') }; eval { $v .= pmver('Dist::Zilla::Role::GitConfig','any version') }; eval { $v .= pmver('Dist::Zilla::Role::PluginBundle','any version') }; eval { $v .= pmver('Dist::Zilla::Role::Releaser','any version') }; eval { $v .= pmver('Dist::Zilla::Role::VersionProvider','any version') }; eval { $v .= pmver('Dist::Zilla::Tester','any version') }; eval { $v .= pmver('Encode','any version') }; eval { $v .= pmver('Exporter','any version') }; eval { $v .= pmver('File::Copy','any version') }; eval { $v .= pmver('File::Copy::Recursive','any version') }; eval { $v .= pmver('File::Path','2.07') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('File::Spec::Functions','any version') }; eval { $v .= pmver('File::Temp','any version') }; eval { $v .= pmver('File::Which','any version') }; eval { $v .= pmver('File::chdir','any version') }; eval { $v .= pmver('File::pushd','any version') }; eval { $v .= pmver('Git::Wrapper','0.021') }; eval { $v .= pmver('IO::Handle','any version') }; eval { $v .= pmver('IPC::Open3','any version') }; eval { $v .= pmver('IPC::System::Simple','any version') }; eval { $v .= pmver('List::AllUtils','any version') }; eval { $v .= pmver('List::Util','any version') }; eval { $v .= pmver('Log::Dispatchouli','any version') }; eval { $v .= pmver('Module::Build','0.3601') }; eval { $v .= pmver('Module::Runtime','any version') }; eval { $v .= pmver('Moose','any version') }; eval { $v .= pmver('Moose::Autobox','any version') }; eval { $v .= pmver('Moose::Role','any version') }; eval { $v .= pmver('Moose::Util::TypeConstraints','any version') }; eval { $v .= pmver('MooseX::AttributeShortcuts','any version') }; eval { $v .= pmver('MooseX::Has::Sugar','any version') }; eval { $v .= pmver('MooseX::Types::Moose','any version') }; eval { $v .= pmver('MooseX::Types::Path::Class','any version') }; eval { $v .= pmver('Path::Class','0.22') }; eval { $v .= pmver('Path::Class::Dir','any version') }; eval { $v .= pmver('String::Formatter','any version') }; eval { $v .= pmver('Test::DZil','any version') }; eval { $v .= pmver('Test::Fatal','0.006') }; eval { $v .= pmver('Test::More','0.88') }; eval { $v .= pmver('Try::Tiny','any version') }; eval { $v .= pmver('Version::Next','any version') }; eval { $v .= pmver('constant','any version') }; eval { $v .= pmver('lib','any version') }; eval { $v .= pmver('namespace::autoclean','0.09') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('utf8','any version') }; eval { $v .= pmver('version','0.80') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; Changes100644001750001750 7312244203313 21761 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/version-regexpChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz version-default000755001750001750 012244203313 20520 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusfoobar100644001750001750 4112244203313 22006 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/version-defaultthis file is meant for testing...push-gitconfig000755001750001750 012244203313 20337 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7412244203313 21733 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/push-gitconfigChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz dist.ini100644001750001750 32112244203313 22146 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/version-regexpname = Foo author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [Git::NextVersion] version_regexp = ^release-(.+)$ first_version = 0.01 [FakeRelease] Changes100644001750001750 7312244203313 22113 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/version-defaultChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz commit-dirtydir000755001750001750 012244203313 20531 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpusChanges100644001750001750 7312244203313 22124 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commit-dirtydirChanges 1.23 2009-11-16 19:15:45 CET - foo - bar - baz dist.ini100644001750001750 64212244203313 22125 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/push-gitconfigname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [Config::Git / Git-main] remote = genesis local_branch = master remote_branch = master allow_dirty = dist.ini allow_dirty = Changes allow_dirty = qr{weird thing} [GatherDir] [FakeRelease] [Git::Commit] git_config = Git-main [Git::Tag] [Git::Push] git_config = Git-main commit-build-src-as-parent.t100644001750001750 652612244203313 21741 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/t#!perl # # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; use Dist::Zilla 1.093250; use Dist::Zilla::Tester; use File::Temp qw{ tempdir }; use Git::Wrapper; use Path::Class; use Test::More tests => 8; use Try::Tiny qw(try); use Cwd qw(cwd); # Mock HOME to avoid ~/.gitexcludes from causing problems $ENV{HOME} = tempdir( CLEANUP => 1 ); my $corpus_dir = dir('corpus/commit-build-src-as-parent')->absolute; my $cwd = cwd(); END { chdir $cwd if $cwd }; my $zilla = Dist::Zilla::Tester->from_config({ dist_root => $corpus_dir, }); # build fake repository chdir $zilla->tempdir->subdir('source'); system "git init -q"; my $git = Git::Wrapper->new('.'); $git->config( 'user.name' => 'dzp-git test' ); $git->config( 'user.email' => 'dzp-git@test' ); $git->add( qw{ dist.ini Changes } ); $git->commit( { message => 'initial commit' } ); $zilla->build; ok( $git->rev_parse('-q', '--verify', 'refs/heads/build/master'), 'source repo has the "build/master" branch') or diag $git->branch; is( scalar $git->log('build/master'), 2, 'two commit on the build/master branch') or diag $git->branch; is( scalar $git->ls_tree('build/master'), 2, 'two files in latest commit on the build/master branch') or diag $git->branch; my @log = $git->log('build/master'); like try {$log[1]->message} => qr/initial commit/, 'master is a parent'; like try {$log[0]->message} => qr/Build results of \w+ \(on master\)/, 'build commit'; chdir $cwd; my $zilla2 = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-build')->absolute, }); # build fake repository chdir $zilla2->tempdir->subdir('source'); system "git init -q"; my $git2 = Git::Wrapper->new('.'); $git2->config( 'user.name' => 'dzp-git test' ); $git2->config( 'user.email' => 'dzp-git@test' ); $git2->remote('add','origin', $zilla->tempdir->subdir('source')->stringify); $git2->fetch; $git2->reset('--hard','origin/master'); $git2->checkout('-b', 'topic/1'); append_to_file('dist.ini', "\n"); $git2->commit('-a', '-m', 'commit on topic branch'); $zilla2->build; ok( $git2->rev_parse('-q', '--verify', 'refs/heads/build/topic/1'), 'source repo has the "build/topic/1" branch') or diag $git2->branch; chdir $cwd; my $zilla3 = Dist::Zilla::Tester->from_config({ dist_root => dir('corpus/commit-build')->absolute, }); # build fake repository chdir $zilla3->tempdir->subdir('source'); system "git init -q"; my $git3 = Git::Wrapper->new('.'); $git3->config( 'user.name' => 'dzp-git test' ); $git3->config( 'user.email' => 'dzp-git@test' ); $git3->remote('add','origin', $zilla->tempdir->subdir('source')->stringify); $git3->fetch; $git3->branch('build/master', 'origin/build/master'); $git3->reset('--hard','origin/master'); append_to_file('dist.ini', "\n\n"); $git3->commit('-a', '-m', 'commit on master'); $zilla3->build; is( scalar $git3->log('build/master'), 3, 'three commits on the build/master branch') or diag $git3->branch; is( scalar $git->ls_tree('build/master'), 2, 'two files in latest commit on the build/master branch') or diag $git->branch; sub append_to_file { my ($file, @lines) = @_; open my $fh, '>>', $file or die "can't open $file: $!"; print $fh @lines; close $fh; } dist.ini100644001750001750 23412244203313 22303 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/version-defaultname = Foo author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [Git::NextVersion] [FakeRelease] dist.ini100644001750001750 33312244203313 22314 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/corpus/commit-dirtydirname = Foo version = 1.23 author = foobar license = Perl_5 abstract = Test Library copyright_holder = foobar copyright_year = 2009 [GatherDir] [FakeRelease] [MyTestArchiver] [Git::Commit] add_files_in = releases Git000755001750001750 012244203313 20246 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/Zilla/RoleRepo.pm100644001750001750 307612244203313 21657 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/Zilla/Role/Git# # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # package Dist::Zilla::Role::Git::Repo; { $Dist::Zilla::Role::Git::Repo::VERSION = '2.019'; } # ABSTRACT: Provide repository information for Git plugins use Moose::Role; has 'repo_root' => ( is => 'ro', isa => 'Str', default => '.' ); my %cached_wrapper; sub git { my $root = shift->repo_root; $cached_wrapper{$root} ||= do { require Git::Wrapper; Git::Wrapper->new( $root ); }; } 1; __END__ =pod =head1 NAME Dist::Zilla::Role::Git::Repo - Provide repository information for Git plugins =head1 VERSION version 2.019 =head1 DESCRIPTION This role is used within the Git plugins to get information about the repository structure, and to create a Git::Wrapper object. =head1 ATTRIBUTES =head2 repo_root The repository root, either as a full path or relative to the distribution root. Default is C<.>. =head1 METHODS =head2 git $git = $plugin->git; This method returns a Git::Wrapper object for the C directory, constructing one if necessary. The object is shared between all plugins that consume this role (if they have the same C). =head1 AUTHOR Jerome Quelin =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Jerome Quelin. 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 Git000755001750001750 012244203313 20603 5ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/Zilla/PluginTag.pm100644001750001750 1132412244203313 22035 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/Zilla/Plugin/Git# # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use 5.008; use strict; use warnings; package Dist::Zilla::Plugin::Git::Tag; { $Dist::Zilla::Plugin::Git::Tag::VERSION = '2.019'; } # ABSTRACT: tag the new version use Moose; use MooseX::Has::Sugar; use MooseX::Types::Moose qw{ Str }; use String::Formatter method_stringf => { -as => '_format_tag', codes => { d => sub { require DateTime; DateTime->now(time_zone => $_[0]->time_zone) ->format_cldr($_[1] || 'dd-MMM-yyyy') }, n => sub { "\n" }, N => sub { $_[0]->zilla->name }, t => sub { $_[0]->zilla->is_trial ? (defined $_[1] ? $_[1] : '-TRIAL') : '' }, v => sub { $_[0]->zilla->version }, }, }; with 'Dist::Zilla::Role::BeforeRelease'; with 'Dist::Zilla::Role::AfterRelease'; with 'Dist::Zilla::Role::Git::Repo'; # -- attributes has tag_format => ( ro, isa=>Str, default => 'v%v' ); has tag_message => ( ro, isa=>Str, default => 'v%v' ); has time_zone => ( ro, isa=>Str, default => 'local' ); has branch => ( ro, isa=>Str, predicate=>'has_branch' ); has signed => ( ro, isa=>'Bool', default=>0 ); has tag => ( ro, isa => Str, lazy_build => 1, ); sub _build_tag { my $self = shift; return _format_tag($self->tag_format, $self); } # -- role implementation sub before_release { my $self = shift; # Make sure a tag with the new version doesn't exist yet: my $tag = $self->tag; $self->log_fatal("tag $tag already exists") if $self->git->tag('-l', $tag ); } sub after_release { my $self = shift; my @opts; push @opts, ( '-m' => _format_tag($self->tag_message, $self) ) if $self->tag_message; # Make an annotated tag if tag_message, lightweight tag otherwise: push @opts, '-s' if $self->signed; # make a GPG-signed tag my @branch = $self->has_branch ? ( $self->branch ) : (); # create a tag with the new version my $tag = $self->tag; $self->git->tag( @opts, $tag, @branch ); $self->log("Tagged $tag"); } 1; __END__ =pod =head1 NAME Dist::Zilla::Plugin::Git::Tag - tag the new version =head1 VERSION version 2.019 =head1 SYNOPSIS In your F: [Git::Tag] tag_format = v%v ; this is the default tag_message = v%v ; this is the default =head1 DESCRIPTION Once the release is done, this plugin will record this fact in git by creating a tag. By default, it makes an annotated tag. You can set the C attribute to change the message. If you set C to the empty string, it makes a lightweight tag. It also checks before the release to ensure the tag to be created doesn't already exist. (You would have to manually delete the existing tag before you could release the same version again, but that is almost never a good idea.) =head2 Plugin options The plugin accepts the following options: =over 4 =item * tag_format - format of the tag to apply. Defaults to C, see C below. =item * tag_message - format of the tag annotation. Defaults to C, see C below. Use C to create a lightweight tag. =item * time_zone - the time zone to use with C<%d>. Can be any time zone name accepted by DateTime. Defaults to C. =item * branch - which branch to tag. Defaults to current branch. =item * signed - whether to make a GPG-signed tag, using the default e-mail address' key. Consider setting C if C can't find the correct key: $ git config user.signingkey 450F89EC =back =head2 Formatting options Some plugin options allow you to customize the tag content. You can use the following codes at your convenience: =over 4 =item C<%{dd-MMM-yyyy}d> The current date. You can use any CLDR format supported by L. A bare C<%d> means C<%{dd-MMM-yyyy}d>. =item C<%n> A newline =item C<%N> The distribution name =item C<%{-TRIAL}t> Expands to -TRIAL (or any other supplied string) if this is a trial release, or the empty string if not. A bare C<%t> means C<%{-TRIAL}t>. =item C<%v> The distribution version =back =head1 METHODS =head2 tag my $tag = $plugin->tag; Return the tag that will be / has been applied by the plugin. That is, returns C as completed with the real values. =for Pod::Coverage after_release before_release =head1 AUTHOR Jerome Quelin =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Jerome Quelin. 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 Init.pm100644001750001750 767612244203313 22224 0ustar00cjmcjm000000000000Dist-Zilla-Plugin-Git-2.019/lib/Dist/Zilla/Plugin/Git# # This file is part of Dist-Zilla-Plugin-Git # # This software is copyright (c) 2009 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use 5.010; use strict; use warnings; package Dist::Zilla::Plugin::Git::Init; { $Dist::Zilla::Plugin::Git::Init::VERSION = '2.019'; } # ABSTRACT: initialize git repository on dzil new our %transform = ( lc => sub { lc shift }, uc => sub { uc shift }, '' => sub { shift }, ); use Moose; use Git::Wrapper; use String::Formatter method_stringf => { -as => '_format_string', codes => { n => sub { "\n" }, N => sub { $transform{$_[1] || ''}->( $_[0]->zilla->name ) }, }, }; with 'Dist::Zilla::Role::AfterMint'; has commit_message => ( is => 'ro', isa => 'Str', default => 'initial commit', ); has commit => ( is => 'ro', isa => 'Bool', default => 1, ); has remotes => ( is => 'ro', isa => 'ArrayRef[Str]', default => sub { [] }, ); has config_entries => ( is => 'ro', isa => 'ArrayRef[Str]', default => sub { [] }, ); sub mvp_multivalue_args { qw(config_entries remotes) } sub mvp_aliases { return { config => 'config_entries', remote => 'remotes' } } sub after_mint { my $self = shift; my ($opts) = @_; my $git = Git::Wrapper->new("$opts->{mint_root}"); $self->log("Initializing a new git repository in " . $opts->{mint_root}); $git->init; foreach my $configSpec (@{ $self->config_entries }) { my ($option, $value) = split ' ', _format_string($configSpec, $self), 2; $self->log_debug("Configuring $option $value"); $git->config($option, $value); } $git->add("$opts->{mint_root}"); $git->commit({message => _format_string($self->commit_message, $self)}) if $self->commit; foreach my $remoteSpec (@{ $self->remotes }) { my ($remote, $url) = split ' ', _format_string($remoteSpec, $self), 2; $self->log_debug("Adding remote $remote as $url"); $git->remote(add => $remote, $url); } } 1; __END__ =pod =head1 NAME Dist::Zilla::Plugin::Git::Init - initialize git repository on dzil new =head1 VERSION version 2.019 =head1 SYNOPSIS In your F: [Git::Init] commit_message = initial commit ; this is the default commit = 1 ; this is the default remote = origin git@github.com:USERNAME/%{lc}N.git ; no default config = user.email USERID@cpan.org ; there is no default =head1 DESCRIPTION This plugin initializes a git repository when a new distribution is created with C. =head2 Plugin options The plugin accepts the following options: =over 4 =item * commit_message - the commit message to use when checking in the newly-minted dist. Defaults to C. =item * commit - if true (the default), commit the newly-minted dist. If set to a false value, add the files to the Git index but don't actually make a commit. =item * config - a config setting to make in the repository. No config entries are made by default. A setting is specified as C