cblp / gt

A git-based version control system
https://github.com/cblp/gt#readme
GNU General Public License v2.0
3 stars 0 forks source link

gt-branch/branches #8

Open cblp opened 9 years ago

cblp commented 9 years ago

Bad

$ git branch
* master
  feature1

$ git branch -a
* master
  feature1
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/feature2

Good

$ gt-branch  # only current branch
master

$ gt-branches  # local = not mirrored to any remote
master  (current)
feature1  (local)
feature2
cblp commented 9 years ago

How are we going to read commits and store repository state?

Just like git does. We're building on top of it.

How does git store them internally?

This knowledge is relatively simple, but I don't think we have to know it. We can use some libraries or even git command to get information from repo.

sphaso commented 9 years ago

Does this mean that gt is a decorator over git? (we're leveraging on git and giving the user a few shortcuts to work in the "proper way")

cblp commented 9 years ago

Yes, a decorator. I prefer to consider git an engine for gt.

cblp commented 9 years ago

Git is also a file formats and protocols. If gt will also use these formats and protocols, can it be called a decorator?

sphaso commented 9 years ago

My reason to call it a decorator is just because gt calls git commands directly without recreating the wheel and reimplementing operations on git files \ protocol.

cblp commented 9 years ago

What kind of libraries are we going to use?

I'm looking at gitlib. It's the only Haskell↔git library existing in Debian and Ubuntu (libghc-gitlib-dev).

But gitlib is only half of binding, it's only interface, and it requires a backend (cmdline [calling git binary], libgit2 [binding to same-named C library], hlibgit2 [yet another libgit2 binding], or hit [pure Haskell library implementing git file formats]), and none of them presents in Ubuntu.

So, when in future we will promote gt into Debian or Ubuntu repository, we'll need some other git library also being packaged. It may be either gitlib backend library or completely different git access library.

eleweek commented 9 years ago

So I need to use gitlib to implement gt branch, right?

cblp commented 9 years ago

Yes. Try to use gitlib and install any of its backend (gitlib-libgit2 must work) with cabal.

cblp commented 9 years ago

Good news, everyone!

Now you can add build-depends: gitlib, gitlib-libgit2 into gt.cabal and follow instructions from master:README.md.

cblp commented 9 years ago

I tested it in Ubuntu 14.10. If it doesn't install required packages, let me know.