Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Diff Line Model Object #112

Merged
merged 8 commits into from Dec 21, 2012

Conversation

Projects
None yet
4 participants
Contributor

dannygreg commented Dec 20, 2012

When using the new diff API it was pretty inconvenient that we didn't actually represent a line as a model object at any point, but rather just passed all of it's components separately into the enumeration block.

This changes that, representing a line as an object.

@ghost ghost assigned joshaber Dec 20, 2012

Contributor

alanjrogers commented Dec 20, 2012

Looks pretty good to me. Could do with some unit tests for the new class though. (yes I'm back 💃)

@jspahrsummers jspahrsummers and 1 other commented on an outdated diff Dec 21, 2012

Classes/GTDiffLine.h
+// A character representing the origin of a given line.
+//
+// See diff.h for individual documentation.
+typedef enum : git_diff_line_t {
+ GTDiffLineOriginContext = GIT_DIFF_LINE_CONTEXT,
+ GTDiffLineOriginAddition = GIT_DIFF_LINE_ADDITION,
+ GTDiffLineOriginDeletion = GIT_DIFF_LINE_DELETION,
+ GTDiffLineOriginAddEOFNewLine = GIT_DIFF_LINE_ADD_EOFNL,
+ GTDiffLineOriginDeleteEOFNewLine = GIT_DIFF_LINE_DEL_EOFNL,
+} GTDiffLineOrigin;
+
+// Represents an individual line in a diff hunk.
+@interface GTDiffLine : NSObject
+
+// The content string of the line.
+@property (nonatomic, readonly) NSString *content;
Contributor

dannygreg commented Dec 21, 2012

@alanjrogers it isn't split out, but this is unit tested in the diff unit tests. Although the more the merrier I guess :p

Contributor

dannygreg commented Dec 21, 2012

🈺

Contributor

jspahrsummers commented Dec 21, 2012

Looks good to me.

@alanjrogers?

Contributor

dannygreg commented Dec 21, 2012

I presumed he was a 👍 with his above comment.

Contributor

jspahrsummers commented Dec 21, 2012

I'd like to give him the opportunity to reply about the tests.

Contributor

dannygreg commented Dec 21, 2012

I feel the need for :shipit:

Contributor

jspahrsummers commented Dec 21, 2012

You can just pin to this branch from your other work. :P

Contributor

dannygreg commented Dec 21, 2012

Yeah I already am but it's not quite like a PR getting merged man. It's my crack. :p

@alanjrogers alanjrogers added a commit that referenced this pull request Dec 21, 2012

@alanjrogers alanjrogers Merge pull request #112 from libgit2/diff-line
Diff Line Model Object
0bbc548

@alanjrogers alanjrogers merged commit 0bbc548 into master Dec 21, 2012

@alanjrogers alanjrogers deleted the diff-line branch Dec 21, 2012

Contributor

alanjrogers commented Dec 21, 2012

Crack administered 😀

@phatblat phatblat pushed a commit to phatblat/objective-git that referenced this pull request May 29, 2014

@alanjrogers alanjrogers Merge pull request #112 from libgit2/diff-line
Diff Line Model Object
5fb711e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment