File: Rebase.pm

package info (click to toggle)
libgit-raw-perl 0.87%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,464 kB
  • sloc: perl: 5,404; ansic: 182; makefile: 6
file content (144 lines) | stat: -rw-r--r-- 3,828 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package Git::Raw::Rebase;
$Git::Raw::Rebase::VERSION = '0.87';
use strict;
use warnings;

use Git::Raw;
use Git::Raw::Rebase::Operation;

=head1 NAME

Git::Raw::Rebase - Git rebase class

=head1 VERSION

version 0.87

=head1 DESCRIPTION

A L<Git::Raw::Rebase> represents a git rebase.

B<WARNING>: The API of this module is unstable and may change without warning
(any change will be appropriately documented in the changelog).

=head1 METHODS

=head2 abort( )

Abort the current rebase, resetting the repository and working directory to
their state before rebase began.

=head2 commit( $author, $committer )

Commit the current patch. All conflicts that may have been introduced by the
last call to C<next> must have been resolved. Returns a L<Git::Raw::Commit>
object. Both C<$author> and C<$committer> should be L<Git::Raw::Signature>
objects.

=head2 current_operation( )

Get the current operation. Returns a L<Git::Raw::Rebase::Operation> object or
C<undef> is there is no operation.

=head2 finish( $signature )

Finish the current rebase.

=head2 inmemory_index( )

Get the index produced by the last operation which will be committed by the
next call to C<commit>. This is useful for resolving conflicts before committing
them. Returns a L<Git::Raw::Index> object.

=head2 new( $repo, $branch, $upstream, $onto, [\%rebase_opts])

Initialise a new rebase operation, to rebase the changs in C<$branch> relative
to C<$upstream> onto C<$onto>. C<$branch>, C<$upstream> and C<$onto> must be
L<Git::Raw::AnnotatedCommit> objects. Valid fields for the C<%rebase_opts> hash
include:

=over 4

=item * "quiet"

Instruct other clients working on this rebase that a quiet rebase experienced
is required. This is provided for interoperability with other Git tools.

=item * "inmemory"

Perform an in-memory rebase. This allows for stepping through each operation
and committing the rebased changes without rewinding HEAD or putting the
repository in a rebase state. This will not interfere with the working directory.

=item * "rewrite_notes_ref"

Name of the notes reference used to rewrite notes for rebased commits when
finishing the rebase. If not provided, the contents of the configuration option
C<notes.rewriteRef> is examined unless the configuration option C<notes.rewrite.rebase>
is set to a false value. If C<notes.rewriteRef> is also not set, no notes
will be rewritten.

=item * "merge_opts"

See C<Git::Raw::Repository-E<gt>merge()> for valid C<%merge_opts> values.

=item * "checkout_opts"

See C<Git::Raw::Repository-E<gt>checkout()> for valid C<%checkout_opts> values.

=back

=head2 next( )

Perform the next rebase operation. If the operation is one that applies a patch
then the patch will be applied and the index and working directory will be
updated with the changes. If there are conflicts, these need to be resolved
before calling C<commit>. Returns a L<Git::Raw::Rebase::Operation> object, or
C<undef> if there aren't any rebase operations left.

=head2 open( )

Open an existing rebase.

=head2 operation_count( )

Get the number of operations that are to be applied.

=head2 operations( )

Get all operations that are to be applied. Returns a list of
L<Git::Raw::Rebase::Operation> objects.

=head2 orig_head_name( )

Get the original HEAD ref name.

=head2 orig_head_id( )

Get the original HEAD id.

=head2 onto_name( )

Get the onto ref name.

=head2 onto_id( )

Get the onto id.

=head1 AUTHOR

Jacques Germishuys <jacquesg@striata.com>

=head1 LICENSE AND COPYRIGHT

Copyright 2018 Jacques Germishuys.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

=cut

1; # End of Git::Raw::Rebase