| 1 | package Git::Raw::Rebase; | ||
| 2 | 87 | $Git::Raw::Rebase::VERSION = '0.90'; | |
| 3 | 87 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 87 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 87 | ▶ | use Git::Raw; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 87 | ▶ | use Git::Raw::Rebase::Operation; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | Git::Raw::Rebase - Git rebase class | ||
| 12 | |||
| 13 | =head1 VERSION | ||
| 14 | |||
| 15 | version 0.90 | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | A L<Git::Raw::Rebase> represents a git rebase. | ||
| 20 | |||
| 21 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 22 | (any change will be appropriately documented in the changelog). | ||
| 23 | |||
| 24 | =head1 METHODS | ||
| 25 | |||
| 26 | =head2 abort( ) | ||
| 27 | |||
| 28 | Abort the current rebase, resetting the repository and working directory to | ||
| 29 | their state before rebase began. | ||
| 30 | |||
| 31 | =head2 commit( $author, $committer ) | ||
| 32 | |||
| 33 | Commit the current patch. All conflicts that may have been introduced by the | ||
| 34 | last call to C<next> must have been resolved. Returns a L<Git::Raw::Commit> | ||
| 35 | object. Both C<$author> and C<$committer> should be L<Git::Raw::Signature> | ||
| 36 | objects. | ||
| 37 | |||
| 38 | =head2 current_operation( ) | ||
| 39 | |||
| 40 | Get the current operation. Returns a L<Git::Raw::Rebase::Operation> object or | ||
| 41 | C<undef> is there is no operation. | ||
| 42 | |||
| 43 | =head2 finish( $signature ) | ||
| 44 | |||
| 45 | Finish the current rebase. | ||
| 46 | |||
| 47 | =head2 inmemory_index( ) | ||
| 48 | |||
| 49 | Get the index produced by the last operation which will be committed by the | ||
| 50 | next call to C<commit>. This is useful for resolving conflicts before committing | ||
| 51 | them. Returns a L<Git::Raw::Index> object. | ||
| 52 | |||
| 53 | =head2 new( $repo, $branch, $upstream, $onto, [\%rebase_opts]) | ||
| 54 | |||
| 55 | Initialise a new rebase operation, to rebase the changs in C<$branch> relative | ||
| 56 | to C<$upstream> onto C<$onto>. C<$branch>, C<$upstream> and C<$onto> must be | ||
| 57 | L<Git::Raw::AnnotatedCommit> objects. Valid fields for the C<%rebase_opts> hash | ||
| 58 | include: | ||
| 59 | |||
| 60 | =over 4 | ||
| 61 | |||
| 62 | =item * "quiet" | ||
| 63 | |||
| 64 | Instruct other clients working on this rebase that a quiet rebase experienced | ||
| 65 | is required. This is provided for interoperability with other Git tools. | ||
| 66 | |||
| 67 | =item * "inmemory" | ||
| 68 | |||
| 69 | Perform an in-memory rebase. This allows for stepping through each operation | ||
| 70 | and committing the rebased changes without rewinding HEAD or putting the | ||
| 71 | repository in a rebase state. This will not interfere with the working directory. | ||
| 72 | |||
| 73 | =item * "rewrite_notes_ref" | ||
| 74 | |||
| 75 | Name of the notes reference used to rewrite notes for rebased commits when | ||
| 76 | finishing the rebase. If not provided, the contents of the configuration option | ||
| 77 | C<notes.rewriteRef> is examined unless the configuration option C<notes.rewrite.rebase> | ||
| 78 | is set to a false value. If C<notes.rewriteRef> is also not set, no notes | ||
| 79 | will be rewritten. | ||
| 80 | |||
| 81 | =item * "merge_opts" | ||
| 82 | |||
| 83 | See C<Git::Raw::Repository-E<gt>merge()> for valid C<%merge_opts> values. | ||
| 84 | |||
| 85 | =item * "checkout_opts" | ||
| 86 | |||
| 87 | See C<Git::Raw::Repository-E<gt>checkout()> for valid C<%checkout_opts> values. | ||
| 88 | |||
| 89 | =back | ||
| 90 | |||
| 91 | =head2 next( ) | ||
| 92 | |||
| 93 | Perform the next rebase operation. If the operation is one that applies a patch | ||
| 94 | then the patch will be applied and the index and working directory will be | ||
| 95 | updated with the changes. If there are conflicts, these need to be resolved | ||
| 96 | before calling C<commit>. Returns a L<Git::Raw::Rebase::Operation> object, or | ||
| 97 | C<undef> if there aren't any rebase operations left. | ||
| 98 | |||
| 99 | =head2 open( ) | ||
| 100 | |||
| 101 | Open an existing rebase. | ||
| 102 | |||
| 103 | =head2 operation_count( ) | ||
| 104 | |||
| 105 | Get the number of operations that are to be applied. | ||
| 106 | |||
| 107 | =head2 operations( ) | ||
| 108 | |||
| 109 | Get all operations that are to be applied. Returns a list of | ||
| 110 | L<Git::Raw::Rebase::Operation> objects. | ||
| 111 | |||
| 112 | =head2 orig_head_name( ) | ||
| 113 | |||
| 114 | Get the original HEAD ref name. | ||
| 115 | |||
| 116 | =head2 orig_head_id( ) | ||
| 117 | |||
| 118 | Get the original HEAD id. | ||
| 119 | |||
| 120 | =head2 onto_name( ) | ||
| 121 | |||
| 122 | Get the onto ref name. | ||
| 123 | |||
| 124 | =head2 onto_id( ) | ||
| 125 | |||
| 126 | Get the onto id. | ||
| 127 | |||
| 128 | =head1 AUTHOR | ||
| 129 | |||
| 130 | Jacques Germishuys <jacquesg@cpan.org> | ||
| 131 | |||
| 132 | =head1 LICENSE AND COPYRIGHT | ||
| 133 | |||
| 134 | Copyright 2018 Jacques Germishuys. | ||
| 135 | |||
| 136 | This program is free software; you can redistribute it and/or modify it | ||
| 137 | under the terms of either: the GNU General Public License as published | ||
| 138 | by the Free Software Foundation; or the Artistic License. | ||
| 139 | |||
| 140 | See http://dev.perl.org/licenses/ for more information. | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | 87 | 1; # End of Git::Raw::Rebase | |