Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
54510cc6
Unverified
Commit
54510cc6
authored
Nov 19, 2017
by
Carlos Martín Nieto
Committed by
GitHub
Nov 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4391 from libgit2/cmn/expose-indent-heuristic
diff: expose the "indent heuristic" in the diff options
parents
a8f19f81
7e3faf58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
CHANGELOG.md
+4
-0
include/git2/diff.h
+6
-0
src/diff_xdiff.c
+2
-0
No files found.
CHANGELOG.md
View file @
54510cc6
...
...
@@ -12,6 +12,10 @@ v0.26 + 1
*
We now support conditional includes in configuration files.
*
There is a new diff option,
`GIT_DIFF_INDENT_HEURISTIC`
which activates a
heuristic which takes into account whitespace and indentation in order to
produce better diffs when dealing with ambiguous diff hunks.
### API additions
*
`git_remote_create_detached()`
creates a remote that is not associated
...
...
include/git2/diff.h
View file @
54510cc6
...
...
@@ -206,6 +206,12 @@ typedef enum {
* can apply given diff information to binary files.
*/
GIT_DIFF_SHOW_BINARY
=
(
1
<<
30
),
/** Use a heuristic that takes indentation and whitespace into account
* which generally can produce better diffs when dealing with ambiguous
* diff hunks.
*/
GIT_DIFF_INDENT_HEURISTIC
=
(
1
<<
31
),
}
git_diff_option_t
;
/**
...
...
src/diff_xdiff.c
View file @
54510cc6
...
...
@@ -239,6 +239,8 @@ void git_xdiff_init(git_xdiff_output *xo, const git_diff_options *opts)
xo
->
params
.
flags
|=
XDF_IGNORE_WHITESPACE_CHANGE
;
if
(
flags
&
GIT_DIFF_IGNORE_WHITESPACE_EOL
)
xo
->
params
.
flags
|=
XDF_IGNORE_WHITESPACE_AT_EOL
;
if
(
flags
&
GIT_DIFF_INDENT_HEURISTIC
)
xo
->
params
.
flags
|=
XDF_INDENT_HEURISTIC
;
if
(
flags
&
GIT_DIFF_PATIENCE
)
xo
->
params
.
flags
|=
XDF_PATIENCE_DIFF
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment