Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Discussion of branching style #533

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
masinter opened this issue Oct 19, 2021 · 15 comments
Closed

Discussion of branching style #533

masinter opened this issue Oct 19, 2021 · 15 comments
Assignees

Comments

@masinter
Copy link
Member

masinter commented Oct 19, 2021

The original note was moved to a new issue #574

One of the interactions between Medley and Git is the handling of deleting a file from the repo.

If I have on my local disk FOO FOO.~1~ and FOO.~2~ and with some git action that updates FOO (checkout of another branch), it recovers OK : git will break the hard link between FOO and FOO.~2~ and Lisp will see FOO;3.

But things aren't so good if the checkout deletes FOO because FOO.~1~ and FOO.~2~ are still around. Lisp will see INFILEP(FOO) finding FOO:2.

At the very least, a github "hook" could warn the user when the checkout deleted a file while there are ~nn~ versions.

@masinter
Copy link
Member Author

masinter commented Oct 19, 2021

Moved to #574

@masinter masinter added the help wanted Extra attention is needed label Oct 19, 2021
@masinter
Copy link
Member Author

It might be easier if we used the {UNIX} device to avoid the DWIM of the {DSK} device compensating quietly but imperfectly.
E.g., if I delete file FOO then INFILEP(FOO) should be NIL.

Another way to do this would be to change maiko DSK code to Ignore versions that don't correspond to unversioned files. Fix up the hard links for files that are same content and make a new versioned file if FOO and FOO.~max~ (max versions aren't same content.

@rmkaplan
Copy link
Contributor

I don't want git by itself to screw around with my local file system at all. I want Medley to sit on top of git and be able to see files in branches and commitments, compare them intelligently, copy files or definitions that look good, etc. And let it do what it automatically does, maintain my local version history.

Separately, why do we fool around with all the overhead of branches? Trying to name them and describe them as if somehow they had conceptually related changes rather than changes that happened to emerge as work on one problem pulled a thread that opened up other issues, the typical Medley style of working in a sysout that can persist for days if not weeks. Commitments maybe (on a per-file basis, as part of CLEANUP?). But what do we get from incremental branches?

I can see why the branch structure would be good for major system-wide changes (5 byte atoms, 64 bit pointers, Unicode replacing XCCS...), but not for what evolves in the usual Medley work process.

@nbriggs
Copy link
Contributor

nbriggs commented Oct 20, 2021

git clean -dxn and look at what it will do, if you're happy with that, git clean -dxf -- such as:

silversword% cd medley
~/Projects/medley
silversword% git clean -dxn
Would remove library/EXPORTS.ALL
Would remove library/UNIXTELNET.LCOM.~1~
Would remove library/UNIXTELNET.LCOM.~2~
Would remove library/UNIXTELNET.~1~
Would remove library/UNIXTELNET.~2~
Would remove library/VTCHAT.LCOM.~2~
Would remove library/VTCHAT.LCOM.~3~
Would remove library/VTCHAT.~2~
Would remove library/VTCHAT.~3~
Would remove library/VTCHAT.~4~
Would remove library/WHEREIS.HASH
Would remove lispusers/DATE~
Would remove lispusers/LIFE.DFASL
Would remove loadups/init.dribble
Would remove scripts/lsee~
Would remove sources/LLSUBRS.LCOM.~1~
Would remove sources/LLSUBRS.LCOM.~2~
Would remove sources/LLSUBRS.LCOM.~3~
Would remove sources/LLSUBRS.LCOM.~6~
Would remove sources/LLSUBRS.LCOM.~7~
Would remove sources/LLSUBRS.~1~
Would remove sources/LLSUBRS.~2~
Would remove sources/LLSUBRS.~3~
Would remove sources/LLSUBRS.~6~
Would remove sources/LLSUBRS.~7~
Would remove sources/LLSUBRS.~8~
Would remove tmp/

@nbriggs
Copy link
Contributor

nbriggs commented Oct 20, 2021

This is why I suggested not using the repository as your working directory.

@rmkaplan
Copy link
Contributor

rmkaplan commented Oct 20, 2021 via email

@nbriggs
Copy link
Contributor

nbriggs commented Oct 20, 2021

I mean not in a branch, not in a directory that git knows anything about... copying the files from your workspace to the git repo directory (on a branch, or not, whatever) by hand when you're all done and want to release them to the world. Pretend git doesn't exist in your regular workflow right up until you want to release things.

@rmkaplan
Copy link
Contributor

rmkaplan commented Oct 20, 2021 via email

@nbriggs
Copy link
Contributor

nbriggs commented Oct 20, 2021

A branch (for doing a github pull-request) is ephemeral -- the branch will go away once it has been merged, so the name is not important. You could use something formulaic like kaplan-fixes-YYMMDDNN. The descriptions of the changes that you commit are important, those last forever and are the documentation for people following behind to have some idea of what you did and why you did it. There's default text in the PR, from the commit message(s) I guess, but that is also ephemeral (PRs are not a "git" thing, they're a "github" thing and not recorded in the git history)

@masinter
Copy link
Member Author

In the meanwhile, I think the enhancement I want is something like adding a script .git/hooks/post-checkout
which scans the repo for version files with no corresponding unversioned

find . -name ".~[1-9]~" -exec warnif {} ;

where warnif checks if (presumably after the checkout action, there wasn't an unnumbered corresponding file.
Fancier would be to consolidate the warnings.

I think we should continue to look for ways to make the integration of git and Interlisp.

The GitHub desktop isn't well-done and it can get you into bad states.
I think a medley Git client would be much more valuable

@rmkaplan
Copy link
Contributor

rmkaplan commented Oct 22, 2021 via email

@masinter
Copy link
Member Author

this issue morphed into a discussion of #536 while the original "want" was just a simple hook.

@rmkaplan
Copy link
Contributor

I advanced a bit towards a workable configuration: I copied by working clone to someplace else and removed its .git files, then recloned a fresh git. From inside medley I have it set up so that the glt clone is accessed through a new variable GMEDLEYDIR, which is a {UNIX} directory without medley version numbers. I will treat that mostly as a glorified dropbox that happens to have funny upload and download conventions--and that requires running FIXEDITDATE from time to time, so new downloaded files sort to the top.

I also tried to eliminate some of the git-rot in my working {dsk}-medley directory, files with early filecreated dates but later version numbers. I recovered a certain number of lost edits, but I'm sure that more will show up over time.

I will now use only medley tools (COMPARESOURCES, COMPAREDIRECTORIES, COPYFILES...) to move stuff back and forth between the clone and my working configuration. I'll only pull the Master branch of the clone, and only push new branches that contain whatever files I have copied over.

I think this will be a much safer arrangement.

@masinter
Copy link
Member Author

This discussion evolved from a simple feature request to a broader discussion of branching methodology.
But in the meanwhile it lost the original request. I'll open a new issue for it.

@masinter masinter removed the help wanted Extra attention is needed label Nov 19, 2021
@masinter masinter changed the title Want git hook to warn about deleting versions when a file is deleted Discussion of branching style Nov 19, 2021
@masinter
Copy link
Member Author

Maybe it would help to talk about the difference between {DSK} and {UNIX}. Whenever you git pull a branch that deletes or renames something, it can leave behind ~nn~ residue

image
so even though I deleted the "undecorated" file, the {DSK} device will show it's still there.

@Interlisp Interlisp locked and limited conversation to collaborators Aug 25, 2022
@masinter masinter converted this issue into discussion #915 Aug 25, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants