Creating and Applying 9front Patches (Git Edition)
History
-
October 2018, Ori pushes the first commit to git9.
-
April 2019, Ori starts the 9fans thread '[9fans] Git/fs: Possibly Usable'.
-
Late April 2019, Lufia announces their port of unix git on 9fans thread '[9fans] Git client'.
-
June 2019, git9 migrates to git.
-
July 2020, Atlassian deletes all Mercurial repositories without archive or remorse.
-
Early September 2020, Ori summarizes the model for git9.
-
September 2020, Ori announces git9 can serve itself.
-
November 2020, Ori announces that his git9 is self-hosting and shithub is launched.
-
September 2021, 9front releases ‘Community vs Infrastructure’, migrates to git9, and removes Mercurial and Python.
Creating
To create a patch we first pull 9front’s git repo and bind our files into place:
; sysupdate
; bind -a /dist/plan9front /
We should create our own work branch:
; git/branch -n mywork
We can now make our changes to the system.
If we lose our way, we can see which files have changed:
; git/diff -s
M sys/src/cmd/seq.c
;
We will commit our changes whilst inside our branch:
# We make changes to seq(1)
; git/commit -m 'seq: some kind of change' /sys/src/cmd/seq.c
heads/mywork: 40d27871e341512ad69a50645e289f6b3856c528
;
If we need to, we can get a commit hash manually:
; git/log -s | sed 1q | awk '{print $1}'
40d27871e341512ad69a50645e289f6b3856c528
We export our changes to a diff:
; git/export 40d27871e341512ad69a50645e289f6b3856c528 > $home/mypatch.diff
You can export your changes to the 9front pastebin for ease of linking:
; git/export 40d27871e341512ad69a50645e289f6b3856c528 | webpaste
We can return to the default 9front branch:
; git/branch front
Applying
In the same way we pull and bind our files into place:
; sysupdate
; bind -a /dist/plan9front /
For individual files you could use ape/patch
if desired, but for most 9front patches you should use git/import
:
; git/import < $home/mypatch.diff
applying seq: some kind of change
M sys/src/cmd/seq.c
;
The patch is now applied!
If you wish to trash the changes from the patch, use:
; git/revert /sys/src/cmd/seq.c
You can delete obsolete branches via:
; git/branch front
; git/branch -d mywork
If a patch is formatted properly and inline from an e-mail, you should be able to import from upasfs as per:
; git/import < /mail/fs/mbox/4321