9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Git/fs: Possibly Usable
@ 2019-04-03 16:02 ori
  2019-04-03 16:59 ` Giacomo
  0 siblings, 1 reply; 32+ messages in thread
From: ori @ 2019-04-03 16:02 UTC (permalink / raw)
  To: giacomo, 9fans, ori


> Impressive!
>
> I didn't imagine one could implement git in so few lines of C! Thanks for challenging my assumptions!
>
> I'd like to port it to Jehanne but I cannot find a license in the repository, so in theory it's "all rights reserved" under most jurisdictions.
>
> What's your take on this?
>
> Did you intend to put it under public domain instead? Maybe MIT? Or LPL?
>
>
> Giacomo

Don't particularly care. At some point I'd like to commit it to 9front, but I can relicense it then.

Do you have a preference?




^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: [9fans] Git/fs: Possibly Usable
@ 2019-04-02 15:35 ori
  0 siblings, 0 replies; 32+ messages in thread
From: ori @ 2019-04-02 15:35 UTC (permalink / raw)
  To: driusan, 9fans

> On Tue, Apr 2, 2019 at 12:49 AM <ori@eigenstate.org> wrote:
>> 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.
>>
>
> What problems did you have with the index format? In my experience
> it was relatively sane (relative to the pack protocol/format, I mean,
> which is a pretty low bar to set.)

It's easy to implement, but the tool is more useful without it.
The concept of staged files that it implies makes git clunkier
to use.

The index would also require a special tool to manipulate it,
which makes manipulating it from a script much clunkier.




^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: [9fans] Git/fs: Possibly Usable
@ 2019-04-02  5:36 cinap_lenrek
  0 siblings, 0 replies; 32+ messages in thread
From: cinap_lenrek @ 2019-04-02  5:36 UTC (permalink / raw)
  To: 9fans

excellent work! thank you!

--
cinap



^ permalink raw reply	[flat|nested] 32+ messages in thread
* [9fans] Git/fs: Possibly Usable
@ 2019-04-02  4:41 ori
  2019-04-02  6:10 ` Skip Tavakkolian
                   ` (5 more replies)
  0 siblings, 6 replies; 32+ messages in thread
From: ori @ 2019-04-02  4:41 UTC (permalink / raw)
  To: 9fans

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.




^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2019-08-09  5:56 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 16:02 [9fans] Git/fs: Possibly Usable ori
2019-04-03 16:59 ` Giacomo
2019-04-03 18:41   ` Cull
2019-04-03 18:43     ` [9fans] Fw: " Cull
2019-04-03 18:47       ` hiro
2019-04-03 19:24         ` Cull
2019-04-03 18:57       ` Kurt H Maier
2019-04-03 19:01         ` Cull
2019-04-03 19:02           ` [9fans] Fw: " Cull
2019-04-03 18:44   ` [9fans] " Ori Bernstein
  -- strict thread matches above, loose matches on Subject: below --
2019-04-02 15:35 ori
2019-04-02  5:36 cinap_lenrek
2019-04-02  4:41 ori
2019-04-02  6:10 ` Skip Tavakkolian
2019-04-02 13:32 ` Dave MacFarlane
2019-04-02 14:37 ` Kyohei Kadota
2019-04-03 10:38 ` Giacomo
2019-04-03 18:29 ` Skip Tavakkolian
2019-04-03 20:14   ` David du Colombier
2019-04-03 20:23   ` Ori Bernstein
2019-04-04  0:00     ` Skip Tavakkolian
2019-04-04  0:34       ` Kurt H Maier
2019-04-04  1:22     ` Ori Bernstein
2019-07-08 19:54 ` Ori Bernstein
2019-07-12 18:27   ` Patrick Marchand
2019-07-12 20:21     ` Steve Simon
2019-07-21 21:06       ` clueelf
2019-07-25 21:59         ` Ori Bernstein
2019-08-05 18:43           ` Skip Tavakkolian
2019-08-05 21:17             ` erik quanstrom
2019-08-05 21:22               ` erik quanstrom
2019-08-09  5:56             ` Ori Bernstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).