How to use patches sent to vim_dev?

13 views
Skip to first unread message

Enan Ajmain

unread,
Oct 4, 2022, 1:38:15 AM10/4/22
to vim_use
Bram sends patches in vim_dev ML. But it's not structured to directly
use with `git am`, is it? If that's correct, what's the reason for
using a different patch format?

P.S. I am not gonna use the patch email. But my email client, Claws,
highlights the patch. In vim patch's case, it can't. That's why I
noticed the difference.

--
Enan

Tony Mechelynck

unread,
Oct 4, 2022, 2:20:55 AM10/4/22
to vim...@googlegroups.com
Bram's patches are in context diff (not unified context diff) format,
one of the formats acceptable to the "patch" program, and once upon a
time that was the program to be used when updating one's Vim source.

Nowadays, most people who compile their own Vim use either a git clone
of Bram's github master, or (like I do) a Mercurial clone of
Christian's Mercurial public clone of Bram's git master (that
Mercurial repository is located at http://hg.256bit.org/vim) and then
the email patches are just a reminder that a new patchlevel has been
published. Their contents are then not used directly.

Best regards,
Tony.

Tony Mechelynck

unread,
Oct 4, 2022, 2:49:05 AM10/4/22
to vim...@googlegroups.com
P.S. The reason for using a different patch format is that
historically, context diffs were introduced some time before unified
diffs, which means that it is (remotely) possible that some systems
have an old-fashioned "patch" program accepting context diffs but not
unified diffs. Both context diffs and unified diffs are human-readable
and can be used to "undo" a patch if the correct arguments are given
on the "patch" program's command-line.
>
> Best regards,
> Tony.

Enan Ajmain

unread,
Oct 4, 2022, 4:48:55 AM10/4/22
to vim...@googlegroups.com
On Tue, 4 Oct 2022 08:20:37 +0200
Tony Mechelynck <antoine.m...@gmail.com> wrote:

> Bram's patches are in context diff (not unified context diff) format,
> one of the formats acceptable to the "patch" program, and once upon a
> time that was the program to be used when updating one's Vim source.

Oh wow. Didn't know there are different kind of diffs [1]. Thanks for
the info.

[1]: http://www.math.utah.edu/docs/info/diff_3.html


--
Enan
3nan....@gmail.com
https://www.github.com/3N4N

GPG Key ID: 448F8D0D0D6DB601566E396CA031EA10A3ECB75D

Bram Moolenaar

unread,
Oct 4, 2022, 8:52:21 AM10/4/22
to vim...@googlegroups.com, Enan Ajmain
I send the patches to the maillist so that it's very easy to have a look
at them. You could get the diff in other ways if you know what tools to
use and what magic arguments to use, but that involves just enough work
that close to nobody will actually have a look.

You can apply all the patches in sequence using "patch" and you should
get the right code from that. But it's a lot easier using git and just
fetch the latest from github.

The patch format is one that includes all the information, also about
deleted files and special character handling. Git diffs normally don't
include that, you have to carefully specify what kind of diff it should
create (probably called a patch).

--
hundred-and-one symptoms of being an internet addict:
271. You collect hilarious signatures from all 250 mailing lists you
are subscribed to.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Enan Ajmain

unread,
Oct 4, 2022, 12:38:12 PM10/4/22
to vim...@googlegroups.com
On Tue, 04 Oct 2022 13:51:57 +0100
Bram Moolenaar <Br...@moolenaar.net> wrote:

> The patch format is one that includes all the information, also about
> deleted files and special character handling. Git diffs normally don't
> include that, you have to carefully specify what kind of diff it should
> create (probably called a patch).

Hmm. I'm reading up on different types of diffs after Tony Mechelynck's
comment. Thanks for the explanation.

--
Enan
Reply all
Reply to author
Forward
0 new messages