From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: <46E7EE42925499BF1B9558D2423340AA@eigenstate.org> In-Reply-To: <46E7EE42925499BF1B9558D2423340AA@eigenstate.org> From: Skip Tavakkolian Date: Wed, 3 Apr 2019 11:29:30 -0700 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="000000000000dff9940585a47072" Subject: Re: [9fans] Git/fs: Possibly Usable Topicbox-Message-UUID: f8d9bcca-ead9-11e9-9d60-3106f5b1d025 --000000000000dff9940585a47072 Content-Type: text/plain; charset="UTF-8" Hi, The avl library doesn't match up to 9legacy version. Any ideas? BTW, I think your notes on this message are a great start for a README. Thanks, -Skip On Mon, Apr 1, 2019 at 9:48 PM wrote: > It was mentioned on this list a short while ago. Now, it's > more or less at the point where it works for me. Expect > many bugs and problems, and many more missing tools, but > "the rest is just scripting". > > One caveat I have: Git's index file format is a bit > boneheaded, so I'm ignoring it. The index doesn't affect > the wire protocol, so this isn't an interoperability issue, > unless you share the same physical repository on both > Plan 9 and Unix. If you do, expect them to get out of > sync on uncommitted but added files. > > In fact, the entire concept of the staging area has been > removed, as it's both confusing and clunky. There are now > only three states that files can be in: 'untracked', > 'dirty', and 'committed'. Tracking is done with empty > files under .git/index9/{removed,tracked}/path/to/file. > > It's implemented in Plan 9 flavor C, and provides tools > for writing repository contents, and a file system for > read-only access, which will mirror the current state of > the repository. > > The code is here: https://bitbucket.org/oridb/git9 > > Install with `mk install`. There's no recursive binding > of directories, so you need to union /rc/bin/git and > $objtype/bin/git` by hand. > > Documentation has not yet been written. You'll need to > read the source. > > Some usage examples: > > git/clone git://git.eigenstate.org/git/ori/mc.git > git/log > cd subdir/name > git/add foo.c > git/commit > git/push > > Scripts will generally mount git/fs as needed to do > their work, but if you want to browse the repository > manually, run it yourself. You'll get `/n/git` mounted, > with the following contents: > > /n/git/object: The objects in the repo. > /n/git/branch: The branches in the repo. > /n/git/ctl: A file showing the status of the repo. > Currently, it only shows the > current branch. > > Commits are presented as directories with the following > contents: > > author: A file containing the author name > hash: A file containing the commit hash > parent: A file containing the commit parents, one per line. > msg: A file containing the log message for that commit > tree: A directory containing a view of the repository. > > So, for example: > > % ls /n/git/branch/heads/master > /n/git/branch/heads/master/author > /n/git/branch/heads/master/hash > /n/git/branch/heads/master/msg > /n/git/branch/heads/master/parent > /n/git/branch/heads/master/tree > % cat /n/git/branch/heads/master/hash > 7d539a7c08aba3f31b3913e0efef11c43ea9 > > # This is the same commit, with the same contents. > % ls /n/git/object/7d539a7c08aba3f31b3913e0efef11c43ea9f9ef > /n/git/object/7d539a7c08aba3f31b3913e0efef11c43ea9f9ef/author > /n/git/object/7d539a7c08aba3f31b3913e0efef11c43ea9f9ef/hash > /n/git/object/7d539a7c08aba3f31b3913e0efef11c43ea9f9ef/msg > /n/git/object/7d539a7c08aba3f31b3913e0efef11c43ea9f9ef/parent > /n/git/object/7d539a7c08aba3f31b3913e0efef11c43ea9f9ef/tree > > # what git/diff will hopefully do more concisely soon, filtering > # out the non-git files. > ape/diff -ur /n/git/branch/heads/master/tree . > Only in .: .git > Only in .: debug > diff -ur /n/git/branch/heads/master/tree/fold.myr ./fold.myr > --- /n/git/branch/heads/master/tree/fold.myr Wed Dec 31 > 16:00:00 1969 > +++ ./fold.myr Mon Apr 1 21:39:06 2019 > @@ -6,6 +6,8 @@ > const foldexpr : (e : expr# -> std.option(constval)) > ;; > > +/* Look, diffing files just works, and I don't need any fancy > glue! */ > + > const foldexpr = {e > match e > | &(`Eident &[.sc=`Sclassenum, .name=name, .ty=`Tyenum > &(`Body enum)]): > Only in .: refs > > > The following utilities and binaries are provided: > > fs: The git filesystem. > fetch: The protocol bits for getting data from a git server. > send: The protocol bits for sending data to a git server. > save: The gnarly bits for storing the files for a commit. > conf: A program to extract information from a config file. > clone: Clones a repository. > commit: Commits a snapshot of the working directory. > log: Prints the contents of a commmit log. > add: Tells the repository to add a file to the next commit. > walk: `du`, but for git status. > > > Supported protocols: git:// and git+ssh://. If someone > implements others, I'll gladly accept patches. > > TODOs: > git/mkpatch: Generate a 'git am' compatible patch. > git/apply: Apply a diff. > git/diff: Wrapper wrapper around git/walk that > diffs the changed files. > git/merge: Yup, what it says on the label. Should > also be a script around git/fs. > git/log: Need to figure out how to make it filter > by files. > /n/git/HEAD: add /n/git/head subtree which points > to the current commit. > > ...And a whole bunch more. > > > --000000000000dff9940585a47072 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

The avl library doesn't match u= p to 9legacy version. Any ideas?

BTW, I think your= notes on this message are a great start for a README.

=
Thanks,
-Skip

On Mon, Apr 1, 2019 at 9:48 PM <ori@eigenstate.org> wrote:
=
It was mentioned on this = list a short while ago. Now, it's
more or less at the point where it works for me. Expect
many bugs and problems, and many more missing tools, but
"the rest is just scripting".

One caveat I have: Git's index file format is a bit
boneheaded, so I'm ignoring it. The index doesn't affect
the wire protocol, so this isn't an interoperability issue,
unless you share the same physical repository on both
Plan 9 and Unix. If you do, expect them to get out of
sync on uncommitted but added files.

In fact, the entire concept of the staging area has been
removed, as it's both confusing and clunky. There are now
only three states that files can be in: 'untracked',
'dirty', and 'committed'. Tracking is done with empty
files under .git/index9/{removed,tracked}/path/to/file.

It's implemented in Plan 9 flavor C, and provides tools
for writing repository contents, and a file system for
read-only access, which will mirror the current state of
the repository.

The code is here: https://bitbucket.org/oridb/git9

Install with `mk install`. There's no recursive binding
of directories, so you need to union /rc/bin/git and
$objtype/bin/git` by hand.

Documentation has not yet been written. You'll need to
read the source.

Some usage examples:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/clone git://git.eigenstate.o= rg/git/ori/mc.git
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/log
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd subdir/name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/add foo.c
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/commit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/push

Scripts will generally mount git/fs as needed to do
their work, but if you want to browse the repository
manually, run it yourself. You'll get `/n/git` mounted,
with the following contents:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/object:=C2=A0 The objects in the repo. =C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/branch:=C2=A0 The branches in the repo.<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/ctl:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0A file showing the status of the repo.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Currentl= y, it only shows the current branch.

Commits are presented as directories with the following
contents:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 author: A file containing the author name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 hash:=C2=A0 =C2=A0A file containing the commit = hash
=C2=A0 =C2=A0 =C2=A0 =C2=A0 parent: A file containing the commit parents, o= ne per line.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 msg:=C2=A0 =C2=A0 A file containing the log mes= sage for that commit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tree:=C2=A0 =C2=A0A directory containing a view= of the repository.

So, for example:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 % ls /n/git/branch/heads/master
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/branch/heads/master/author
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/branch/heads/master/hash
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/branch/heads/master/msg
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/branch/heads/master/parent
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/branch/heads/master/tree
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % cat /n/git/branch/heads/master/hash
=C2=A0 =C2=A0 =C2=A0 =C2=A0 7d539a7c08aba3f31b3913e0efef11c43ea9

=C2=A0 =C2=A0 =C2=A0 =C2=A0 # This is the same commit, with the same conten= ts.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % ls /n/git/object/7d539a7c08aba3f31b3913e0efef= 11c43ea9f9ef
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/object/7d539a7c08aba3f31b3913e0efef11c43= ea9f9ef/author
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/object/7d539a7c08aba3f31b3913e0efef11c43= ea9f9ef/hash
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/object/7d539a7c08aba3f31b3913e0efef11c43= ea9f9ef/msg
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/object/7d539a7c08aba3f31b3913e0efef11c43= ea9f9ef/parent
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/object/7d539a7c08aba3f31b3913e0efef11c43= ea9f9ef/tree

=C2=A0 =C2=A0 =C2=A0 =C2=A0 # what git/diff will hopefully do more concisel= y soon, filtering
=C2=A0 =C2=A0 =C2=A0 =C2=A0 # out the non-git files.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ape/diff -ur /n/git/branch/heads/master/tree .<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 Only in .: .git
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Only in .: debug
=C2=A0 =C2=A0 =C2=A0 =C2=A0 diff -ur /n/git/branch/heads/master/tree/fold.m= yr ./fold.myr
=C2=A0 =C2=A0 =C2=A0 =C2=A0 --- /n/git/branch/heads/master/tree/fold.myr=C2= =A0 =C2=A0 Wed Dec 31 16:00:00 1969
=C2=A0 =C2=A0 =C2=A0 =C2=A0 +++ ./fold.myr=C2=A0 Mon Apr=C2=A0 1 21:39:06 2= 019
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @@ -6,6 +6,8 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const foldexpr : (e= : expr# -> std.option(constval))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 +/* Look, diffing files just works, and I don&#= 39;t need any fancy glue! */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0const foldexpr =3D {e
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 match e
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | &(`Eident &am= p;[.sc=3D`Sclassenum, .name=3Dname, .ty=3D`Tyenum &(`Body enum)]):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Only in .: refs


The following utilities and binaries are provided:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 fs:=C2=A0 =C2=A0 =C2=A0The git filesystem.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fetch:=C2=A0 The protocol bits for getting data= from a git server.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 send:=C2=A0 =C2=A0The protocol bits for sending= data to a git server.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 save:=C2=A0 =C2=A0The gnarly bits for storing t= he files for a commit.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 conf:=C2=A0 =C2=A0A program to extract informat= ion from a config file.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 clone:=C2=A0 Clones a repository.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 commit: Commits a snapshot of the working direc= tory.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 log:=C2=A0 =C2=A0 Prints the contents of a comm= mit log.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 add:=C2=A0 =C2=A0 Tells the repository to add a= file to the next commit.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 walk:=C2=A0 =C2=A0`du`, but for git status.


Supported protocols: git:// and git+ssh://. If someone
implements others, I'll gladly accept patches.

TODOs:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/mkpatch:=C2=A0 =C2=A0 Generate a 'git a= m' compatible patch.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/apply:=C2=A0 =C2=A0 =C2=A0 Apply a diff. =C2=A0 =C2=A0 =C2=A0 =C2=A0 git/diff:=C2=A0 =C2=A0 =C2=A0 =C2=A0Wrapper wra= pper around git/walk that
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 diffs the changed files.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/merge:=C2=A0 =C2=A0 =C2=A0 Yup, what it say= s on the label. Should
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 also be a script around git/fs.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 git/log:=C2=A0 =C2=A0 =C2=A0 =C2=A0 Need to fig= ure out how to make it filter
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 by files.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /n/git/HEAD:=C2=A0 =C2=A0 add /n/git/head subtr= ee which points
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 to the current commit.

...And a whole bunch more.


--000000000000dff9940585a47072--