1
0
mirror of synced 2026-01-18 17:36:53 +00:00
rmkaplan b791bff070
Rmk19: Updates and remaining components for managing comparisons and interactions between git and Medley (#658)
* PSEUDOHOSTS: Overlay a file system at the end of a path in another file system

New package, please look through it.

* REGIONMANAGER:  added RELCREATEPOSITION, allow for arguments to be spread

If the WIDTH argument looks like a list of arguments, the arguments are spread out.  Means that a relative region can be passed through intermediate functions.

* EXAMINEDEFS:  More control over regions and windows

Examination windows are returned so that callers can manipulate them

* TEDIT-PF-SEE:  tf respects reader environment and bold faces of DEFUN and DEFMACRO names

* COMPAREDIRECTORIES:  refactored for more flexibility and easier maintenance

Also, based on SPY, made more internal operations work on streams that are located and created once, rather than on file

Added CDMERGE to merge CDVALUES for different subdirectories, to permit scrolling of all differences in a single browser window

* COMPARESOURCES:  Region for CS browser is passed through, window is returned

Also tried to eliminate mismatching of simple edit timestamps

* COMPARETEXT: Files can be input streams, region is passed in, window is returned

* COMPAREDIRECTORIES again:  Fixed a promptwindow bug

* GITFNS:  New package for comparing and copying back and forth from My Medley to the git clone
2022-01-27 22:32:49 -08:00

43 lines
11 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Medley GITFNS2
4
1
GITFNS
1
4
By Ron Kaplan
This document was created in January 2022.
GITFNS bridges between the git's file-oriented style of development and version control and Medley's residential development style with its own version control conventions. Importantly, GITFNS also allows for more intelligent comparisons between Lisp source files,Tedit files, and text files in different git branches and between files in a git branch and the local Medley working directory.
The tools in this package must know the local file system path to the clone of the git repository. This path is the value of the variable GITMEDLEYDIR. GITMEDLEYDIR can be specified in the user's INIT file or it can be provided in the start-up script as a Unix shell variable. If it is not otherwise specified, it defaults to the value of the variable MEDLEYDIR. Typically GITMEDLEYDIR is a path rooted in the {UNIX} file device and thus obeys Unix file naming conventions (e.g. no versions). An example is the path {UNIX}/Users/kaplan/Local/medley3.5/git-medley/.
The Lisp-oriented file comparisons for a pull-request approval are a central use-case of this package. These comparisons are provided by the prc ("pull request compare") Medley executive command:
prc branch [command]
Suppose that a pull request has been issued on github for a particular branch, say branch rmk15. Then
prc rmk15
will bring up a lispusers/COMPAREDIRECTORIES browser for the files that differ between origin/rmk15 and origin/master. If the selected files are Lisp source files, the Compare item on the file browser menu will show the differences in a lispusers/COMPARESOURCES browser. The differences for other file types will be shown in a lispusers/COMPARETEXT browser.
prc is the special case of the more general bbc command ("branch-branch compare) for comparing the files in any two branches:
bbc branch1 branch2 [command]
This compares the files in branch1 and branch2, for example
bbc rmk15 lmm12 (local)
This will compare the files in origin/rmk15 and origin/lmm12. branch1 defaults to the origin files of the currently checked out branch, the second defaults to origin/master. If local is non-NIL, then a branch that has neither local/ or origin/ prepended will default to local (e.g. local/rmk15) instead of origin/. Local refers to the files that are currently in the clone directory, which may not be the same as the origin files, depending on the push/pull status.
The command cob ("check out branch") checks out a specified branch:
cob branch [command]
This checks out branch and then executes git pull. The branch parameter may also be NIL (or absent) or NEW. If branch is NIL or not provided, then it defaults to the user's "current branch", the branch named <initials>nnn, e.g. rmk15. The initials are the value of INITIALS as used for SEDIT time stamps, and nnn is the largest of the integers of all of the branches beginning with those initials. If branch is NEW (or T), then a new initialed branch is created and becomes the user's current branch. Its number is one greater than the largest number of previous initialed branches.
The currently checked out branch is obtained by the b? command:
b? [command]
It is generally unsafe to do Medley development by operating with files in the local clone repository. Medley provides a residential development environment that integrates tightly with the local file system. It is important to have consistent access to the source files of the currently running system, especially for files whose contents have been only partially loaded. A git pull or a branch switch that introduces new versions of some files or removes old files altogether can lead to unpredictable disconnects that are hard to recover from. This is true also because development can go on in the same Medley memory image for days if not weeks, so it is important to have explicit control of any file version changes.
GITFNS mitigates the danger by conventions that separate the files in the git clone (at GITMEDLEYDIR) from the files in the working Medley development directory. The variable MEDLEYDIR is taken to hold the path to the separate working directory, for example, {DSK}<Users>kaplan>Local>medley3.5>my-medley> (generally we refer to the working directory as "My Medley" as opposed to "Git Medley"). This differs from GITMEDLEYDIR above in that the file device is DSK, so that normal Medley version conventions apply, and it ends in a different final subdirectory. (The intermediate substrings are shared in this example, to collect all Medley relevant files in the same section of the local file system, but that need not be the case. )
The Medley variables for directory search paths (DIRECTORIES, LISPUSERSDIRECTORIES, FONTDIRECTORIES, etc.) all have MEDLEYDIR as a prefix, and the development environment makes no reference to GITMEDLEYDIR. Any back and forth transfer of information between the git clone and Medley development must be done by explicit synchronization actions. Crucially, Medley-updated files do not appear in the clone directories and new clone files do not move to the Medley directories without user intervention.
The files in My Medley and Git Medley can be compared with the gmc ("git my-medley compare") command:
gmc subdirectories [command]
This produces a browser for all the differing files in the ccorresponding Medley subdirectories and the currently checked out branch of the git clone. If subdirectories is omitted, it defaults to sources library lispusers. If it is ALL, then files in all My Medley subdirectories are examined.
In addition to the commands for comparing and viewing files, this browser menu now has commands for copying files from the git to My Medley and vice versa, and for deleting files in either location. Thus, a comparision of My Medley with origin/master will show those files that have been updated from a recent merge, and they can individually be copied to new My Medley versions. If the comparison is with a different branch, say the user's current branch, copying files from My Medley to git will set them up for commits that will be uploaded when the branch is pushed.
The menu item for deleting My Medley files will cause all version to be removed, not just the latest one, to avoid the possibility that an earlier is revealed. Deletion for My Medley files is also accomplished by renaming to a deletion/ subdirectory so that they can be recovered if a deletion is in error. Files in the git-clone are removed from the file system immediately, since git provides its own recovery mechanism for those files.
Note that GITFNS does not yet include functions for commits, pushes, or pull requests--those have to be done outside of Medley through the usual github interfaces.
For convenience, GITFNS defines two pseudohosts MM (for My Medley) and GIT (for the git clone) that make it easy to refer to the files at the ends of the different paths (see lispusers/PSEUDOHOSTS). Thus the file
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>COREIO
can be referred to more succinctly as {MM}<sources>COREIO in all file operations, and the corresonding git-clone file can be referred to as {GIT}/sources/COREIO. Likewise, the command cd {MM}<lispusers> makes My Medley's lispusers subdirectory be the connected directory for subsequentg relative file names.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))4<01><01>.<01>.<00><00>8.<00><00>8J<01><01> PAGEHEADING RUNNINGHEAD
TIMESROMAN$TERMINALMODERN
MODERN MODERN
MODERN
 HRULE.GETFN HRULE.GETFNMODERN
 HRULE.GETFNMODERN
 HRULE.GETFNMODERN  HRULE.GETFNMODERN ,<00><00><00>  <00>   <00><00>4Z  + 
3>B
,O(    <wD$h!
x<00>@<02>R K K<00> #0:
 D *f <00> ;<00>
C<01><00>e;&S<00><00>z<EFBFBD>