|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.lib.Constants
public final class Constants
Misc. constants used throughout JGit.
Field Summary | |
---|---|
static String |
CHARACTER_ENCODING
Native character encoding for commit messages, file names... |
static Charset |
CHARSET
Native character encoding for commit messages, file names... |
static String |
CHERRY_PICK_HEAD
name of the file containing the ID of a cherry pick commit in case of conflicts |
static String |
CONFIG
Default name for the Git repository configuration |
static String |
DEFAULT_REMOTE_NAME
Default remote name used by clone, push and fetch operations |
static String |
DOT_GIT
Default name for the Git repository directory |
static String |
DOT_GIT_EXT
A bare repository typically ends with this string |
static String |
DOT_GIT_IGNORE
Name of the ignore file |
static String |
DOT_GIT_MODULES
Name of the submodules file |
static ObjectId |
EMPTY_BLOB_ID
objectid for the empty blob |
static String |
FETCH_HEAD
Special name for the "FETCH_HEAD" symbolic-ref. |
static String |
GIT_ALTERNATE_OBJECT_DIRECTORIES_KEY
The environment variable that tells us where to look for objects, besides the default objects directory. |
static String |
GIT_AUTHOR_EMAIL_KEY
The environment variable that contains the author's email |
static String |
GIT_AUTHOR_NAME_KEY
The environment variable that contains the author's name |
static String |
GIT_CEILING_DIRECTORIES_KEY
The environment variable that limits how close to the root of the file systems JGit will traverse when looking for a repository root. |
static String |
GIT_COMMITTER_EMAIL_KEY
The environment variable that contains the commiter's email |
static String |
GIT_COMMITTER_NAME_KEY
The environment variable that contains the commiter's name |
static String |
GIT_DIR_KEY
The environment variable that tells us which directory is the ".git" directory |
static String |
GIT_INDEX_FILE_KEY
The environment variable that tells us which file holds the Git index. |
static String |
GIT_OBJECT_DIRECTORY_KEY
The environment variable that tells us where objects are stored |
static String |
GIT_WORK_TREE_KEY
The environment variable that tells us which directory is the working directory. |
static String |
GITIGNORE_FILENAME
A gitignore file name |
static String |
HEAD
Special name for the "HEAD" symbolic-ref. |
static String |
INFO_REFS
Info refs folder |
static String |
LOGS
Logs folder name |
static String |
MASTER
Default main branch name |
static String |
MERGE_HEAD
name of the file containing the IDs of the parents of a merge commit |
static String |
MERGE_MSG
name of the file containing the commit msg for a merge commit |
static int |
OBJ_BAD
An unknown or invalid object type code. |
static int |
OBJ_BLOB
In-pack object type: blob. |
static int |
OBJ_COMMIT
In-pack object type: commit. |
static int |
OBJ_EXT
In-pack object type: extended types. |
static int |
OBJ_OFS_DELTA
In-pack object type: offset delta |
static int |
OBJ_REF_DELTA
In-pack object type: reference delta |
static int |
OBJ_TAG
In-pack object type: annotated tag. |
static int |
OBJ_TREE
In-pack object type: tree. |
static int |
OBJ_TYPE_5
In-pack object type: reserved for future use. |
static int |
OBJECT_ID_LENGTH
A Git object hash is 160 bits, i.e. |
static int |
OBJECT_ID_STRING_LENGTH
A Git object can be expressed as a 40 character string of hexadecimal digits. |
static String |
ORIG_HEAD
name of the ref ORIG_HEAD used by certain commands to store the original value of HEAD |
static String |
OS_USER_NAME_KEY
The environment variable that contains the system user name |
static byte[] |
PACK_SIGNATURE
Pack file signature that occurs at file header - identifies file as Git packfile formatted. |
static String |
PACKED_REFS
Packed refs file |
static String |
R_HEADS
Prefix for branch refs |
static String |
R_NOTES
Prefix for notes refs |
static String |
R_NOTES_COMMITS
Standard notes ref |
static String |
R_REFS
Prefix for any ref |
static String |
R_REMOTES
Prefix for remotes refs |
static String |
R_STASH
Standard stash ref |
static String |
R_TAGS
Prefix for tag refs |
static String |
SIGNED_OFF_BY_TAG
Beginning of the common "Signed-off-by: " commit message line |
static String |
STASH
Default stash branch name |
static String |
TYPE_BLOB
Text string that identifies an object as a blob. |
static String |
TYPE_COMMIT
Text string that identifies an object as a commit. |
static String |
TYPE_TAG
Text string that identifies an object as an annotated tag. |
static String |
TYPE_TREE
Text string that identifies an object as a tree. |
static String |
UNKNOWN_USER_DEFAULT
Default value for the user name if no other information is available |
Method Summary | |
---|---|
static int |
decodeTypeString(AnyObjectId id,
byte[] typeString,
byte endMark,
MutableInteger offset)
Parse an encoded type string into a type constant. |
static byte[] |
encode(String str)
Convert a string to a byte array in the standard character encoding. |
static byte[] |
encodeASCII(long s)
Convert an integer into its decimal representation. |
static byte[] |
encodeASCII(String s)
Convert a string to US-ASCII encoding. |
static byte[] |
encodedTypeString(int typeCode)
Convert an OBJ_* type constant to an ASCII encoded string constant. |
static MessageDigest |
newMessageDigest()
Create a new digest function for objects. |
static String |
typeString(int typeCode)
Convert an OBJ_* type constant to a TYPE_* type constant. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OBJECT_ID_LENGTH
Changing this assumption is not going to be as easy as changing this declaration.
public static final int OBJECT_ID_STRING_LENGTH
OBJECT_ID_LENGTH
,
Constant Field Valuespublic static final String HEAD
public static final String FETCH_HEAD
public static final String TYPE_COMMIT
Commits connect trees into a string of project histories, where each commit is an assertion that the best way to continue is to use this other tree (set of files).
public static final String TYPE_BLOB
Blobs store whole file revisions. They are used for any user file, as well as for symlinks. Blobs form the bulk of any project's storage space.
public static final String TYPE_TREE
Trees attach object ids (hashes) to names and file modes. The normal use for a tree is to store a version of a directory and its contents.
public static final String TYPE_TAG
Annotated tags store a pointer to any other object, and an additional message. It is most commonly used to record a stable release of the project.
public static final int OBJ_BAD
public static final int OBJ_EXT
This header code is reserved for future expansion. It is currently undefined/unsupported.
public static final int OBJ_COMMIT
Indicates the associated object is a commit.
This constant is fixed and is defined by the Git packfile format.
TYPE_COMMIT
,
Constant Field Valuespublic static final int OBJ_TREE
Indicates the associated object is a tree.
This constant is fixed and is defined by the Git packfile format.
TYPE_BLOB
,
Constant Field Valuespublic static final int OBJ_BLOB
Indicates the associated object is a blob.
This constant is fixed and is defined by the Git packfile format.
TYPE_BLOB
,
Constant Field Valuespublic static final int OBJ_TAG
Indicates the associated object is an annotated tag.
This constant is fixed and is defined by the Git packfile format.
TYPE_TAG
,
Constant Field Valuespublic static final int OBJ_TYPE_5
public static final int OBJ_OFS_DELTA
Objects stored with this type actually have a different type which must be obtained from their delta base object. Delta objects store only the changes needed to apply to the base object in order to recover the original object.
An offset delta uses a negative offset from the start of this object to refer to its delta base. The base object must exist in this packfile (even in the case of a thin pack).
This constant is fixed and is defined by the Git packfile format.
public static final int OBJ_REF_DELTA
Objects stored with this type actually have a different type which must be obtained from their delta base object. Delta objects store only the changes needed to apply to the base object in order to recover the original object.
A reference delta uses a full object id (hash) to reference the delta base. The base object is allowed to be omitted from the packfile, but only in the case of a thin pack being transferred over the network.
This constant is fixed and is defined by the Git packfile format.
public static final byte[] PACK_SIGNATURE
This constant is fixed and is defined by the Git packfile format.
public static final String CHARACTER_ENCODING
public static final Charset CHARSET
public static final String MASTER
public static final String STASH
public static final String R_HEADS
public static final String R_REMOTES
public static final String R_TAGS
public static final String R_NOTES
public static final String R_NOTES_COMMITS
public static final String R_REFS
public static final String R_STASH
public static final String LOGS
public static final String INFO_REFS
public static final String PACKED_REFS
public static final String OS_USER_NAME_KEY
public static final String GIT_AUTHOR_NAME_KEY
public static final String GIT_AUTHOR_EMAIL_KEY
public static final String GIT_COMMITTER_NAME_KEY
public static final String GIT_COMMITTER_EMAIL_KEY
public static final String GIT_CEILING_DIRECTORIES_KEY
public static final String GIT_DIR_KEY
public static final String GIT_WORK_TREE_KEY
public static final String GIT_INDEX_FILE_KEY
public static final String GIT_OBJECT_DIRECTORY_KEY
public static final String GIT_ALTERNATE_OBJECT_DIRECTORIES_KEY
public static final String UNKNOWN_USER_DEFAULT
public static final String SIGNED_OFF_BY_TAG
public static final String GITIGNORE_FILENAME
public static final String DEFAULT_REMOTE_NAME
public static final String DOT_GIT
public static final String CONFIG
public static final String DOT_GIT_EXT
public static final String DOT_GIT_IGNORE
public static final String DOT_GIT_MODULES
public static final String MERGE_MSG
public static final String MERGE_HEAD
public static final String CHERRY_PICK_HEAD
public static final String ORIG_HEAD
public static final ObjectId EMPTY_BLOB_ID
Method Detail |
---|
public static MessageDigest newMessageDigest()
RuntimeException
- this Java virtual machine does not support the required hash
function. Very unlikely given that JGit uses a hash function
that is in the Java reference specification.public static String typeString(int typeCode)
typeCode
- the type code, from a pack representation.
public static byte[] encodedTypeString(int typeCode)
The ASCII encoded string is often the canonical representation of the type within a loose object header, or within a tag header.
typeCode
- the type code, from a pack representation.
public static int decodeTypeString(AnyObjectId id, byte[] typeString, byte endMark, MutableInteger offset) throws CorruptObjectException
id
- object id this type string came from; may be null if that is
not known at the time the parse is occurring.typeString
- string version of the type code.endMark
- character immediately following the type string. Usually ' '
(space) or '\n' (line feed).offset
- position within typeString
where the parse
should start. Updated with the new position (just past
endMark
when the parse is successful.
OBJ_BLOB
,
OBJ_COMMIT
, OBJ_TAG
, OBJ_TREE
.
CorruptObjectException
- there is no valid type identified by typeString
.public static byte[] encodeASCII(long s)
s
- the integer to convert.
public static byte[] encodeASCII(String s)
s
- the string to convert. Must not contain any characters over
127 (outside of 7-bit ASCII).
IllegalArgumentException
- the input string contains one or more characters outside of
the 7-bit ASCII character space.public static byte[] encode(String str)
str
- the string to convert. May contain any Unicode characters.
CHARACTER_ENCODING
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |