applying patches



On 6/1/20129:32 AM, Alexander Klimov wrote:
>>> Yes, such a more-or-less automatic patching system could be useful. I
>>> wonder if it would know about Git or just patches. I wouldn't be
>>> surprised if such a thing has already been created for Python or Lisp.
>
> Git has git-am(1) which applies patches directly from mailbox,
This kind of misses the point.  If I am running Maxima,

1. I do not want to become an expert on git.
2. I do not have the source files for Maxima on my computer  (although I 
may have old copies).
3. I do not want to change a whole source file and run it interpreted, 
or compile the source
file which may require running make etc. to get compiler dependencies right.

4. All I want to do is try out a feature.  In fact, that feature may 
never even get into the
released source code.


>
> furthermore git uses patches compatible with patch(1), thus one can
> just cd to the directory with sources (not necessary git-cloned) and
> do
>
> $ patch -p1<  patch-file-to-apply

Again, this is a retrograde approach to software development, assuming that
the real way to make a "fix" is to change the source file, and re-make 
the whole
world.
>
>
>
>> Here is the kind of thing that would be useful.  You come up with
>> a good idea that other people might want to try out without
>> recompiling maxima etc etc.   Create a file that can be read in
>> like this:
>>
>> ;;; file defining new feature  xxx
>> ;;; written by<author>  <date>
>> ;;; tested in Maxima<version>
>>
>> (in-package :maxima)
>>
>> ;;; redefine two functions in file simp.lisp
>
> The problem with this approach is that unless the format is
> standardized and the tools are written, it requires a human
> intervention "to apply such a patch" -- tedious and error-prone.

There are no tools necessary other than a text editor, to make this file.
>
>
> By the way, just file name is not enough, one also needs to mention
> where to put the functions in each file when the patch is "applied".
If someone wishes to make the changes to the source file, yes, one would 
have to
search for
(defun  xxx .....)

or perhaps (defmfun xxx ...)

delete the definition and insert the new one.

>
>
>> I continue to object generally to patches and files whose authorship
>> can be discerned only by examining the separate change logs, so any
>> alterations to pre-existing functions should have comments
>> identifying authors, too.
>
> Why do manually what a program can do? Git has git-blame(1) if one
> wants to know who to blame for each line.
Why do I have to install git and become an expert in it?

Here is the synopsis for git-blame

/git blame/  [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [--incremental] [-L n,m]
             [-S<revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
             [<rev>  | --contents<file>  | --reverse<rev>] [--]<file>

Also the description says that this will not help for lines that were deleted or replaced.
Knowing the author of a line also does not necessarily provide a comment as to why
the new line is superior to the old.

I also sometimes print out programs to read / revise them, and take them
away from a computer. It is nice to have the program text provide relevant
comments, in my opinion.


>
> By the way, some open source projects keep AUTHORS [1] file that
> mention which files each person modified (if I understand correctly,
> this is done to prevent a single person from changing too many files),
> but, of course, this file is automatically generated.
>
> [1]<http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/etc/AUTHORS>;