⑨ lab ≡ ByteLabs

Plan9/Git9

— Igor Böhm

Git9 has been added to 9front (thanks Ori). If you are not running the latest version of 9front, you can get a bootstrap copy of git9:

 % cd /tmp
 % hget https://orib.dev/git/git9/HEAD/snap.tar.gz | tar xvz
 % cd git9
 % mk all
 % mk install

Then get an updatable version from git9:

 % mkdir -p $home/src
 % cd $home/src
 % git/clone gits://orib.dev/git9
 % cd git9
 % mk all
 % mk install

Configure your user name and email:

 % mkdir -p $home/lib/git
 % echo '
 [user]
  name=Peter J. Weinberger
  email=pjw@plan9.org
 ' > $home/lib/git/config

Now you can git/clone projects from shithub.us, github.com, etc. like this:

 % cd $home/src
 % git/clone https://github.com/1g0rb0hm/9lab

Howto safely git/rebase with git9

 % git/fs
 % git/walk -fMRAU                 # no output means a clean tree
 % git/query HEAD >/tmp/prerebase  # remember where we are
 % git/pull -f                     # fetch origin (without modifying working tree)

 # query what is to be replayed, and what has arrived upstream
 % git/query origin/front..front      # your local commits
 % git/query front..origin/front      # incoming commits

 % git/rebase origin/front
 git/branch -nb 25c5523fc6120cb04ab1a53eefa92826ad0ee662 rebase.wip
 git/export c8ad422ec44ebfb3f6fbfb11abc62c93f55c4c23 | git/import # Mail: add Move command to move messages between imap folders
 git/export 91bfc4752827a7955a6bbb3896412abf9b49c50f | git/import # Mail: pass chord ed arguments to commands
 git/branch -nb rebase.wip heads/front
 git/branch -r rebase.wip

Now let’s execute the commands that git/rebase origin/9front printed:

 % git/branch -nb 25c5523fc6120cb04ab1a53eefa92826ad0ee662 rebase.wip
 refs/heads/rebase.wip: 25c5523fc6120cb04ab1a53eefa92826ad0ee662
 % git/export c8ad422ec44ebfb3f6fbfb11abc62c93f55c4c23 | git/import # Mail: add Move command to move messages between imap folders
 applying Mail: add Move command to move messages between imap folders
 M sys/man/1/acmemail
 M sys/src/cmd/upas/Mail/mbox.c
 % git/export 91bfc4752827a7955a6bbb3896412abf9b49c50f | git/import # Mail: pass chorded arguments to commands
 applying Mail: pass chorded arguments to commands
 M sys/src/cmd/upas/Mail/mail.h
 M sys/src/cmd/upas/Mail/mbox.c
 M sys/src/cmd/upas/Mail/mesg.c
 M sys/src/cmd/upas/Mail/win.c
 % git/branch -nb rebase.wip heads/front
 refs/heads/front: 5456a6bd7c42045cd1b293065443ece654f69c79
 % git/branch -r rebase.wip
 removed branch refs/heads/rebase.wip
 % git/log -s|sed 10q
 5456a6bd7c42045cd1b293065443ece654f69c79 Mail: pass chorded arguments to commands
 d1ae2fd3eccf5ab44aab6ddab7ef9cda3e622222 Mail: add Move command to move messages between imap folders
 25c5523fc6120cb04ab1a53eefa92826ad0ee662 aux/wacom: allow manual specification of baud rate with -b (thanks Aeva Palecek)
 6ae6679691fb93f4a66b10852c2235d09920637f mlkem(2): correct encapsulation description
 9f603b4c3dce92fe027ae6a69829f612288092c2 Mail: treat flag symbols as Runes; use '⋯' instead ' '
 3a7dd34de50f28cb7564c40d6ba7ec56e7a5eb03 acme: fix crash when an Edit (X|Y) command fails
 db293a0c62176c0016b9551ae7f7f47e3e3a94fc vncv: add -T trustedkeys to check the tls server certificate
 303bbdba4fc9bc9dc178aa3104e6e0d162c93055 hjfs: make lock error message more consistent with cwfs and gefs
 3ef9ef1fbd8f1731ec23576d776a3a88aa32e68f plumb/basic: allow lowercase 'rfc' when plumbing rfc numbers
 e4164cfba046355909bf011087eecab32a01b826 libdraw, libmemdraw: implement identity map optimization for memaffinewarp()

#Plan9 #9front