Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:25:21+00:00 2026-05-22T21:25:21+00:00

$ vim patch Index: toPatch =================================================================== — toPatch +++ toPatch @@ -2,4 +2,4 @@

  • 0
$ vim patch
Index: toPatch
===================================================================
--- toPatch
+++ toPatch
@@ -2,4 +2,4 @@
  */
-final public class XMLWriter {
+public class XMLWriter {

$ vim toPatch
 */
final public class XMLWriter {

  public static float CURRENT_VERSION=2.2f;
    $ patch -p0 -ui patch
patching file toPatch
Hunk #1 succeeded at 1 with fuzz 2 (offset -1 lines).

Why the fuzz and the line offset? This is a demo case trying to understand diff and patch, since tools sometimes/often don’t seem to work as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:25:22+00:00Added an answer on May 22, 2026 at 9:25 pm

    Patch does some basic checking of consistency of the diff and your file, and if these checks fail, you get offset or fuzz.

    You have offset -1, since patch expects the contents of the diff match lines 2–4 of your file. In your file, however, they are lines 1–3.

    You have fuzz>0, since the first line of the context (two spaces and a */) does not match the line in the actual file (one space and a */). Because of that, patch did a second pass where it ignored the first and the last line of the context.

    This doesn’t explain why you see fuzz=2 and not 1. Maybe an error copy-pasting the files? Any other ideas, anybody?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to patch up a new vim syntax file for some custom format
I'm trying to create a patch for cf.vim to resolve an issue with hashes.
I am editing a file like /path/to/file.txt with vim, hence the current directory is
Say I get a patch created with git format-patch . The file is basically
Possible Duplicate: Open file from complete path under cursor in Vim Let's say I
I'm having a problem when trying to make vim expand the file name under
i am new vim user i cannot create file in my host by vim
When I do vim ftp://[user@]machine/path in Vim I get this error: E683: File name
I have a gitmodules file like this: [submodule dotfiles/vim/bundle/cucumber] path = dotfiles/vim/bundle/cucumber url =
In Vim script, if I have a file name, how to get it's path?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.