Top Description Fields Constructors Methods
org.eclipse.jgit.lib

public Class RebaseTodoFile

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Offers methods to read and write files formatted like the git-rebase-todo file
Since
3.2

Field Summary

Modifier and TypeField and Description
private Repository

Constructor Summary

AccessConstructor and Description
public
RebaseTodoFile(Repository repo)

Constructor for RebaseTodoFile.

Method Summary

Modifier and TypeMethod and Description
private static int

Returns:

the token within the range of the given buf that doesn't need to be skipped, -1 if no such token found within the range (i.e. empty line)
nextParsableToken
(byte[]
byte buffer
buf
,
int
index of token begin
tokenBegin
,
int
index of line end
lineEnd
)

Skip leading space, tab, CR and LF characters

private static void
parseComments(byte[] buf, int tokenBegin, List<RebaseTodoLine> r, int lineEnd)

private static RebaseTodoLine
parseLine(byte[] buf, int tokenBegin, int lineEnd)

public List<RebaseTodoLine>

Returns:

the list of steps
readRebaseTodo
(String
path to the file relative to the repository's git-dir. E.g. "rebase-merge/git-rebase-todo" or "rebase-append/done"
path
,
boolean
true if also comments should be reported
includeComments
)

Read a file formatted like the git-rebase-todo file.

public void
writeRebaseTodoFile(String
path to the file relative to the repository's git-dir. E.g. "rebase-merge/git-rebase-todo" or "rebase-append/done"
path
,
List<RebaseTodoLine>
the steps to be written
steps
,
boolean
whether to append to an existing file or to write a new file
append
)

Write a file formatted like a git-rebase-todo file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

repoback to summary
private Repository repo

Constructor Detail

RebaseTodoFileback to summary
public RebaseTodoFile(Repository repo)

Constructor for RebaseTodoFile.

Parameters
repo:Repository

a org.eclipse.jgit.lib.Repository object.

Method Detail

nextParsableTokenback to summary
private static int nextParsableToken(byte[] buf, int tokenBegin, int lineEnd)

Skip leading space, tab, CR and LF characters

Parameters
buf:byte[]

byte buffer

tokenBegin:int

index of token begin

lineEnd:int

index of line end

Returns:int

the token within the range of the given buf that doesn't need to be skipped, -1 if no such token found within the range (i.e. empty line)

parseCommentsback to summary
private static void parseComments(byte[] buf, int tokenBegin, List<RebaseTodoLine> r, int lineEnd)
parseLineback to summary
private static RebaseTodoLine parseLine(byte[] buf, int tokenBegin, int lineEnd)
readRebaseTodoback to summary
public List<RebaseTodoLine> readRebaseTodo(String path, boolean includeComments) throws IOException

Read a file formatted like the git-rebase-todo file. The "done" file is also formatted like the git-rebase-todo file. These files can be found in .git/rebase-merge/ or .git/rebase-append/ folders.

Parameters
path:String

path to the file relative to the repository's git-dir. E.g. "rebase-merge/git-rebase-todo" or "rebase-append/done"

includeComments:boolean

true if also comments should be reported

Returns:List<RebaseTodoLine>

the list of steps

Exceptions
IOException:
if an IO error occurred
writeRebaseTodoFileback to summary
public void writeRebaseTodoFile(String path, List<RebaseTodoLine> steps, boolean append) throws IOException

Write a file formatted like a git-rebase-todo file.

Parameters
path:String

path to the file relative to the repository's git-dir. E.g. "rebase-merge/git-rebase-todo" or "rebase-append/done"

steps:List<RebaseTodoLine>

the steps to be written

append:boolean

whether to append to an existing file or to write a new file

Exceptions
IOException:
if an IO error occurred