Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fizzy apply#125

New issue

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

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
wumpz merged 17 commits intojava-diff-utils:masterfromanatawa12:fizzy-apply
Nov 28, 2021
Merged

Fizzy apply#125

wumpz merged 17 commits intojava-diff-utils:masterfromanatawa12:fizzy-apply
Nov 28, 2021

Conversation

anatawa12
Copy link
Contributor

Closes#112

@wumpz
Copy link
Collaborator

Sorry. Fortgot about this patch. I will look into it.

@wumpz
Copy link
Collaborator

Could you first resolve the conflicts? Strangely I am not able to resolve it using Github.

@anatawa12
Copy link
ContributorAuthor

Could you first resolve the conflicts? Strangely I am not able to resolve it using Github.

Yes. i'll resolve conflicts and add more documentation about fuzzy patch.

Co-authored-by: cowwoc <cowwoc2020@gmail.com>
@cowwoc
Copy link
Contributor

The new documentation look good to me. Thank you!

@wumpzwumpz merged commit37f9eaf intojava-diff-utils:masterNov 28, 2021
@wumpz
Copy link
Collaborator

Merged. Thx for the improvement. Could this something for the Wiki documentation?

@meteorcloudy
Copy link

meteorcloudy commentedOct 5, 2023
edited
Loading

We are using applyFuzzy in Bazel (seebazelbuild/bazel#17897), but it's leading to a problem of applying a clean patch with multiple chunks:kythe/kythe#5864

My debugging shows there is something wrong about calculating thedefaultPosition at

for (AbstractDelta<T>delta :getDeltas()) {
ctx.defaultPosition =delta.getSource().getPosition() +lastPatchDelta;
intpatchPosition =findPositionFuzzy(ctx,delta);
if (0 <=patchPosition) {
delta.applyFuzzyToAt(ctx.result,ctx.currentFuzz,patchPosition);
lastPatchDelta =patchPosition -delta.getSource().getPosition();
ctx.lastPatchEnd =delta.getSource().last() +lastPatchDelta;
}else {

Do I understand correctly thatlastPatchDelta means the offset we should apply to the next delta after applying the previous one? If so it probably should not belastPatchDelta = patchPosition - delta.getSource().getPosition(); since the new chunk could be smaller.

The problematic patch I encountered is:

--- src/include/souffle/utility/FileUtil.h+++ src/include/souffle/utility/FileUtil.h@@ -20,23 +20,16 @@ #include <climits> #include <cstdio> #include <cstdlib>-#include <filesystem> #include <fstream> #include <map>-#include <optional> #include <sstream> #include <string> #include <utility> #include <sys/stat.h>-// --------------------------------------------------------------------------------//                               File Utils-// -------------------------------------------------------------------------------- #ifndef _WIN32 #include <unistd.h> #else-#define NOMINMAX #define NOGDI #include <fcntl.h> #include <io.h>@@ -44,11 +37,21 @@ #include <windows.h> // --------------------------------------------------------------------------------//                               Windows+//                               File Utils // -------------------------------------------------------------------------------+#define X_OK 1 /* execute permission - unsupported in windows*/+ #define PATH_MAX 260+/**+ * access and realpath are missing on windows, we use their windows equivalents+ * as work-arounds.+ */+inline int access(const char* path, int mode) {+    return _access(path, mode);+}+ inline char* realpath(const char* path, char* resolved_path) {     return _fullpath(resolved_path, path, PATH_MAX); }

onhttps://github.com/souffle-lang/souffle/tree/cc8ea091721fcfb60bed45a0edf571ad9d0c58a5/src/include/souffle/utility/FileUtil.h

copybara-servicebot pushed a commit to bazelbuild/bazel that referenced this pull requestOct 6, 2023
Apply the chunks separately and in reverse order to workaround an issue in applyFuzzy.Seejava-diff-utils/java-diff-utils#125 (comment)Fixes#17897 (comment)RELNOTES: NonePiperOrigin-RevId: 571336806Change-Id: I8eb6b859d1ce8fb990d9237f728198af34e0d393
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@cowwoccowwoccowwoc left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Support for fuzzy patches
4 participants
@anatawa12@wumpz@cowwoc@meteorcloudy

[8]ページ先頭

©2009-2025 Movatter.jp