|
PatchViewer can parse files formatted according to the diff command-line tool's Normal, Context and Unified output formats. (Examples in the table below.)
Most diff output from revision control tools such as Subversion, Git, Mercurial, etc is supported. Please send us a sample if you come across a patch file that isn't parsed correctly.
Output from recursive directory comparisons (diff -r ...) and patch files containing differences for multiple files is also handled by PatchViewer.
Output from binary file comparisons is ignored.
|
Normal
|
diff file1.txt file2.txt
|
2c2
< line2
---
> line2 - modified
|
|
Context
|
diff -c file1.txt file2.txt
|
*** /tmp/file1.txt 2012-11-22 10:27:35.000000000 +1100
--- /tmp/file2.txt 2012-11-22 10:27:53.000000000 +1100
***************
*** 1,3 ****
line1
! line2
line3
--- 1,3 ----
line1
! line2 - modified
line3
|
|
Unified
|
diff -u file1.txt file2.txt
|
--- /tmp/file1.txt 2012-11-22 10:27:35.000000000 +1100
+++ /tmp/file2.txt 2012-11-22 10:27:53.000000000 +1100
@@ -1,3 +1,3 @@
line1
-line2
+line2 - modified
line3
|
|
Github-style patch
|
Append .patch to a Github comparison URL. This link is an example.
|
Github-style patches contain non-patch data between the unified diffs for groups of files.
From cd17ae9 Mon Sep 17 00:00:00 2001
From: Some One
Date: Tue, 12 Jan 2016 08:10:16 -0800
Subject: [PATCH 001/002] Replace OSSpinLock
---
Src/Disposable.m | 39 +++++++++++++++--------
Src/Serial.m | 37 ++++++++++++++-------
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Src/Disposable.m b/Src/Disposable.m
index ee81762..535f6b3 100644
--- a/Src/Disposable.m
+++ b/Src/Disposable.m
@@ -8,7 +8,7 @@
#import "Disposable.h"
#import "DisposableProvider.h"
-#import
+#import
From 0af5fe7 Mon Sep 17 00:00:00 2001
From: Some One
Date: Tue, 12 Jan 2016 08:35:56 -0800
Subject: [PATCH 002/002] Serial: hold mutex
---
Src/Serial.m | 11 ++++++-----
1 file changed, 1 insertions(+), 4 deletions(-)
diff --git a/Src/Serial.m b/Src/Serial.m
index c3369b2..1f28360 100644
--- a/Src/Serial.m
+++ b/Src/Serial.m
@@ -14,14 +14,11 @@ @interface Serial () {
// _mutex is held.
RACDisposable * _disposable;
- // Old comment
+ // New comment
// while _mutex is held.
BOOL _disposed;
// A mutex.
- //
- // It must be used when...
- // is mutated.
pthread_mutex_t _mutex;
}
|
|