<commit_before>//
//  GTDiffDelta.h
//  ObjectiveGitFramework
//
//  Created by <NAME> on 30/11/2012.
//  Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import "git2.h"

@class GTDiffFile;
@class GTDiffHunk;

// The type of change that this delta represents.
//
// GTDiffFileDeltaUnmodified - No Change.
// GTDiffFileDeltaAdded      - The file was added to the index.
// GTDiffFileDeltaDeleted    - The file was removed from the working directory.
// GTDiffFileDeltaModified   - The file was modified.
// GTDiffFileDeltaRenamed    - The file has been renamed.
// GTDiffFileDeltaCopied     - The file was duplicated.
// GTDiffFileDeltaIgnored    - The file was ignored by git.
// GTDiffFileDeltaUntracked  - The file has been added to the working directory
//                             and is therefore currently untracked.
// GTDiffFileDeltaTypeChange - LOL NO IDEA
typedef enum : git_delta_t {
	GTDiffFileDeltaUnmodified = GIT_DELTA_UNMODIFIED,
	GTDiffFileDeltaAdded = GIT_DELTA_ADDED,
	GTDiffFileDeltaDeleted = GIT_DELTA_DELETED,
	GTDiffFileDeltaModified = GIT_DELTA_MODIFIED,
	GTDiffFileDeltaRenamed = GIT_DELTA_RENAMED,
	GTDiffFileDeltaCopied = GIT_DELTA_COPIED,
	GTDiffFileDeltaIgnored = GIT_DELTA_IGNORED,
	GTDiffFileDeltaUntracked = GIT_DELTA_UNTRACKED,
	GTDiffFileDeltaTypeChange = GIT_DELTA_TYPECHANGE,
} GTDiffDeltaType;

// A class representing a single change within a diff.
//
// The change may not be simply a change of text within a given file, it could
// be that the file was renamed, or added to the index. See `GTDiffDeltaType`
// for the types of change represented.
@interface GTDiffDelta : NSObject

// A convenience accessor to fetch the `git_diff_delta` represented by the
// object.
@property (nonatomic, readonly) git_diff_delta *git_diff_delta;

// The backing libgit2 `git_diff_patch` object.
@property (nonatomic, readonly) git_diff_patch *git_diff_patch;

// Whether the file(s) are to be treated as binary.
@property (nonatomic, readonly, getter = isBinary) BOOL binary;

// The file to the "left" of the diff.
@property (nonatomic, readonly, strong) GTDiffFile *oldFile;

// The file to the "right" of the diff.
@property (nonatomic, readonly, strong) GTDiffFile *newFile;

// The type of change that this delta represents.
//
// Think "status" as in `git status`.
@property (nonatomic, readonly) GTDiffDeltaType status;

// The number of hunks represented by this delta.
@property (nonatomic, readonly) NSUInteger hunkCount;

// The hunks represented.
//
// Note that you should consider the hunks' lifetime tied to this delta object.
// Once the parent delta object is cleaned up, their behaviour is undefined.
@property (nonatomic, readonly, strong) NSArray *hunks;

- (instancetype)initWithGitPatch:(git_diff_patch *)patch;

@end<commit_msg>Document the designated initialiser.<commit_after>//
//  GTDiffDelta.h
//  ObjectiveGitFramework
//
//  Created by <NAME> on 30/11/2012.
//  Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import "git2.h"

@class GTDiffFile;
@class GTDiffHunk;

// The type of change that this delta represents.
//
// GTDiffFileDeltaUnmodified - No Change.
// GTDiffFileDeltaAdded      - The file was added to the index.
// GTDiffFileDeltaDeleted    - The file was removed from the working directory.
// GTDiffFileDeltaModified   - The file was modified.
// GTDiffFileDeltaRenamed    - The file has been renamed.
// GTDiffFileDeltaCopied     - The file was duplicated.
// GTDiffFileDeltaIgnored    - The file was ignored by git.
// GTDiffFileDeltaUntracked  - The file has been added to the working directory
//                             and is therefore currently untracked.
// GTDiffFileDeltaTypeChange - LOL NO IDEA
typedef enum : git_delta_t {
	GTDiffFileDeltaUnmodified = GIT_DELTA_UNMODIFIED,
	GTDiffFileDeltaAdded = GIT_DELTA_ADDED,
	GTDiffFileDeltaDeleted = GIT_DELTA_DELETED,
	GTDiffFileDeltaModified = GIT_DELTA_MODIFIED,
	GTDiffFileDeltaRenamed = GIT_DELTA_RENAMED,
	GTDiffFileDeltaCopied = GIT_DELTA_COPIED,
	GTDiffFileDeltaIgnored = GIT_DELTA_IGNORED,
	GTDiffFileDeltaUntracked = GIT_DELTA_UNTRACKED,
	GTDiffFileDeltaTypeChange = GIT_DELTA_TYPECHANGE,
} GTDiffDeltaType;

// A class representing a single change within a diff.
//
// The change may not be simply a change of text within a given file, it could
// be that the file was renamed, or added to the index. See `GTDiffDeltaType`
// for the types of change represented.
@interface GTDiffDelta : NSObject

// A convenience accessor to fetch the `git_diff_delta` represented by the
// object.
@property (nonatomic, readonly) git_diff_delta *git_diff_delta;

// The backing libgit2 `git_diff_patch` object.
@property (nonatomic, readonly) git_diff_patch *git_diff_patch;

// Whether the file(s) are to be treated as binary.
@property (nonatomic, readonly, getter = isBinary) BOOL binary;

// The file to the "left" of the diff.
@property (nonatomic, readonly, strong) GTDiffFile *oldFile;

// The file to the "right" of the diff.
@property (nonatomic, readonly, strong) GTDiffFile *newFile;

// The type of change that this delta represents.
//
// Think "status" as in `git status`.
@property (nonatomic, readonly) GTDiffDeltaType status;

// The number of hunks represented by this delta.
@property (nonatomic, readonly) NSUInteger hunkCount;

// The hunks represented.
//
// Note that you should consider the hunks' lifetime tied to this delta object.
// Once the parent delta object is cleaned up, their behaviour is undefined.
@property (nonatomic, readonly, strong) NSArray *hunks;

// Designated initialiser.
- (instancetype)initWithGitPatch:(git_diff_patch *)patch;

@end
{'fraction_non_alphanumeric': 0.08348134991119005, 'fraction_numerical': 0.00497335701598579, 'mean_word_length': 4.050224215246637, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4472245', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1731, 'n_words': 604}