Skip to content

Commit ddd66e4

Browse files
committed
Merge master into unified-diff-parser
Conflicts: README.md pom.xml
2 parents 4700647 + 30875cf commit ddd66e4

File tree

7 files changed

+198
-92
lines changed

7 files changed

+198
-92
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
/target/
2-
/nbproject/
1+
.idea/
2+
build/
3+
nbproject/
4+
target/

CHANGELOG.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
This project uses a custom versioning scheme (and not [Semantic Versioning](https://semver.org/spec/v2.0.0.html)).
7+
8+
## [Unreleased]
9+
10+
### Changed
11+
12+
* Exchange `0 += 1` for `0 = 1` in UnifiedDiffUtils
13+
* preview of new Unified Diff Reader / Writer. This is not yet feature complete but passes the tests of the old version.
14+
15+
## [4.0] – 2019-01-09
16+
17+
### Changed
18+
19+
* moved to organisation **java-diff-utils**
20+
* changed groupid to **io.github.java-diff-utils** and artifact id to **java-diff-utils**
21+
22+
## [3.0] – 2018-10-18
23+
24+
### Added
25+
26+
* Introduced a process listener to diff algorithms. For long running
27+
diffs one could implement some progress information.
28+
* automatic module name for JDK 9 and higher usage
29+
30+
### Changed
31+
32+
* changed generation of inline diffes, if there are different linefeeds within one diff, then these are excluded from the diff block.
33+
34+
### Removed
35+
36+
* Due to licensing issues Delta.java and DiffAlgorithm.java were removed.
37+
38+
## [2.2] – 2017-11-09
39+
40+
### Added
41+
42+
* released at maven central
43+
* included checkstyle source code conventions
44+
* allow configurable splitting of lines to define the blocks to compare (words, characters, phrases).
45+
46+
### Changed
47+
48+
* groupid changed to **com.github.wumpz**, due to maven central releasing
49+
50+
## [2.0] – 2017-08-14
51+
52+
### Added
53+
54+
* support for inline merge
55+
* integrated JGit (Eclipse Licensed) to provide HistogramDiff to gain speed for large datasets
56+
57+
### Changed
58+
59+
* switch to maven and removed other artifacts
60+
* changed groupid to **com.github.java-diff-utils** due to different forks at github
61+
* updated maven plugins
62+
* JDK 1.8 compatibility, sorry if you have to stick with older versions
63+
* restructured packages heavily
64+
* changed API
65+
* changed Algorithm to provide only cursor positions
66+
67+
### Removed
68+
69+
* removed all kinds of helper classes in favour of new JDK 8 function classes like Predicate
70+
71+
## 1.2
72+
73+
### Added
74+
75+
* JDK 1.5 compatibility
76+
* Ant build script
77+
* Generate output in unified diff format (thanks for Bill James)
78+
79+
[Unreleased]: https://github.com/java-diff-utils/java-diff-utils/compare/java-diff-utils-4.0...HEAD
80+
[4.0]: https://github.com/java-diff-utils/java-diff-utils/compare/diff-utils-3.0...java-diff-utils-4.0
81+
[3.0]: https://github.com/java-diff-utils/java-diff-utils/compare/diff-utils-2.2...diff-utils-3.0
82+
[2.2]: https://github.com/java-diff-utils/java-diff-utils/compare/diff-utils-2.0...diff-utils-2.2
83+

README.md

Lines changed: 32 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# java-diff-utils
22

3-
## Status ##
3+
## Status
4+
45
[![Build Status](https://travis-ci.org/java-diff-utils/java-diff-utils.svg?branch=master)](https://travis-ci.org/java-diff-utils/java-diff-utils)
56
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7eba77f10bed4c2a8d08ac8dc8da4a86)](https://www.codacy.com/app/wumpz/java-diff-utils?utm_source=github.com&utm_medium=referral&utm_content=java-diff-utils/java-diff-utils&utm_campaign=Badge_Grade)
67
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.java-diff-utils/java-diff-utils/badge.svg)](http://maven-badges.herokuapp.com/maven-central/io.github.java-diff-utils/java-diff-utils)
78

9+
## Intro
810

9-
## Intro ##
1011
Diff Utils library is an OpenSource library for performing the comparison operations between texts: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.
1112

1213
Main reason to build this library was the lack of easy-to-use libraries with all the usual stuff you need while working with diff files. Originally it was inspired by JRCS library and it's nice design of diff module.
1314

1415
**This is originally a fork of java-diff-utils from Google Code Archive.**
1516

16-
## Examples ##
17+
## Examples
1718

18-
Look [here](https://github.com/wumpz/java-diff-utils/wiki) to find more helpful informations and examples.
19+
Look [here](https://github.com/wumpz/java-diff-utils/wiki) to find more helpful informations and examples.
1920

2021
These two outputs are generated using this java-diff-utils. The source code can also be found at the *Examples* page:
2122

2223
**Producing a one liner including all difference information.**
2324

2425
This is a test ~senctence~**for diffutils**.
2526

26-
2727
**Producing a side by side view of computed differences.**
2828

2929
|original|new|
@@ -32,86 +32,51 @@ This is a test ~senctence~**for diffutils**.
3232
|This is the second line.|This is the second line.|
3333
|~And here is the finish.~||
3434

35+
## Main Features
3536

36-
## Main Features ##
37-
38-
* computing the difference between two texts.
39-
* capable to hand more than plain ascci. Arrays or List of any type that implements hashCode() and equals() correctly can be subject to differencing using this library
40-
* patch and unpatch the text with the given patch
41-
* parsing the unified diff format
42-
* producing human-readable differences
43-
* inline difference construction
44-
* Algorithms:
45-
* Myer
46-
* HistogramDiff using JGit Library
37+
* computing the difference between two texts.
38+
* capable to hand more than plain ascii. Arrays or List of any type that implements hashCode() and equals() correctly can be subject to differencing using this library
39+
* patch and unpatch the text with the given patch
40+
* parsing the unified diff format
41+
* producing human-readable differences
42+
* inline difference construction
43+
* Algorithms:
44+
* Myer
45+
* HistogramDiff using JGit Library
4746

48-
### Algoritms ###
47+
### Algorithms
4948

5049
* Myer's diff
51-
* HistogramDiff
50+
* HistogramDiff
5251

5352
But it can easily replaced by any other which is better for handing your texts. I have plan to add implementation of some in future.
5453

55-
### Changelog ###
56-
* Version 4.1-SNAPSHOT
57-
* preview of new Unified Diff Reader / Writer. This is not yet feature complete but passes the
58-
tests of the old version.
59-
* Version 4.0-SNAPSHOT
60-
* moved to organisation **java-diff-utils**
61-
* changed groupid to **io.github.java-diff-utils** and artifact id to **java-diff-utils**
62-
* Version 3.0
63-
* changed generation of inline diffes, if there are different linefeeds within one diff, then these are excluded
64-
from the diff block.
65-
* Due to licensing issues Delta.java and DiffAlgorithm.java were removed.
66-
* Version 2.3-SNAPSHOT
67-
* Introduced a process listener to diff algorithms. For long running
68-
diffs one could implement some progress information.
69-
* automatic module name for JDK 9 and higher usage
70-
* Version 2.2
71-
* released at maven central
72-
* included checkstyle source code conventions
73-
* groupid changed to **com.github.wumpz**, due to maven central releasing
74-
* allow configurable splitting of lines to define the blocks to compare (words, characters, phrases).
75-
* Version 2.0
76-
* switch to maven and removed other artifacts
77-
* changed groupid to **com.github.java-diff-utils** due to different forks at github
78-
* updated maven plugins
79-
* JDK 1.8 compatibility, sorry if you have to stick with older versions
80-
* support for inline merge
81-
* restructured packages heavily
82-
* changed API
83-
* changed Algorithm to provide only cursor positions
84-
* integrated JGit (Eclipse Licensed) to provide HistogramDiff to gain speed for large datasets
85-
* removed all kinds of helper classes in favour of new JDK 8 function classes like Predicate
86-
* Version 1.2
87-
* JDK 1.5 compatibility
88-
* Ant build script
89-
* Generate output in unified diff format (thanks for Bill James)
90-
9154
## Source Code conventions
9255

9356
Recently a checkstyle process was integrated into the build process. java-diff-utils follows the sun java format convention. There are no TABs allowed. Use spaces.
9457

9558
```java
9659
public static <T> Patch<T> diff(List<T> original, List<T> revised,
97-
BiPredicate<T, T> equalizer) throws DiffException {
98-
if (equalizer != null) {
99-
return DiffUtils.diff(original, revised,
100-
new MyersDiff<>(equalizer));
101-
}
102-
return DiffUtils.diff(original, revised, new MyersDiff<>());
60+
BiPredicate<T, T> equalizer) throws DiffException {
61+
if (equalizer != null) {
62+
return DiffUtils.diff(original, revised,
63+
new MyersDiff<>(equalizer));
64+
}
65+
return DiffUtils.diff(original, revised, new MyersDiff<>());
10366
}
10467
```
10568

10669
This is a valid piece of source code:
70+
10771
* blocks without braces are not allowed
10872
* after control statements (if, while, for) a whitespace is expected
10973
* the opening brace should be in the same line as the control statement
11074

111-
### To Install ###
75+
### To Install
11276

11377
Just add the code below to your maven dependencies:
114-
```
78+
79+
```xml
11580
<dependency>
11681
<groupId>io.github.java-diff-utils</groupId>
11782
<artifactId>java-diff-utils</artifactId>
@@ -121,7 +86,7 @@ Just add the code below to your maven dependencies:
12186

12287
Attention. We changed groupid and artifactid. Starting with version 4 you have to use:
12388

124-
```
89+
```xml
12590
<dependency>
12691
<groupId>io.github.java-diff-utils</groupId>
12792
<artifactId>java-diff-utils</artifactId>
@@ -130,7 +95,8 @@ Attention. We changed groupid and artifactid. Starting with version 4 you have t
13095
```
13196

13297
or using gradle:
133-
```
134-
// https://mvnrepository.com/artifact/com.github.wumpz/diffutils
135-
compile group: 'com.github.wumpz', name: 'diffutils', version: '2.2'
98+
99+
```groovy
100+
// https://mvnrepository.com/artifact/io.github.java-diff-utils/java-diff-utils
101+
compile group: 'io.github.java-diff-utils', name: 'java-diff-utils', version: '4.0'
136102
```

0 commit comments

Comments
 (0)