gitlib icon indicating copy to clipboard operation
gitlib copied to clipboard

Docs inconsistent and contradictory

Open jmct opened this issue 11 years ago • 13 comments

Hello,

The docs (README and the Git.Tutorial) for the gitlib package, are inconsistent with each other and with the library itself. I'll gladly write some more up-to-date ones, but I'm so confused on even the most basic of things (how to open a repo) that I need some pointers in the right direction.

Any help is appreciated.

Thanks!

jmct avatar Oct 07 '14 16:10 jmct

Sure thing, @jmct. How can I help? We could talk on IRC, by Google Hangout, e-mail, or here, whichever would give you the best resource.

jwiegley avatar Oct 08 '14 16:10 jwiegley

Hey @jwiegley! Thanks for your fast response.

I think I'm already starting to grasp it a bit more. Maybe what we can do is have me post things here when I'm stuck with some part of the library and we can work out the confusion. When I've got the hang of it I'll write up some new docs/examples and submit a pull-request.

Yesterday I was trying to use gitlib without a backend, which (of course) resulted in nothing working.

So just to start things off, this is where I'm at right now:

  • gitlib itself is agnostic to any backend
  • backends include gitlib-cmdline, gitlib-hit, gitlib-libgit2 (and probably more)
  • each backend must provide a RepositoryFactory, so that gitlib knows how to use that backend (this is what threw me off yesterday)

I'll try writing some small programs this weekend and see how it goes.

Thanks again!

jmct avatar Oct 08 '14 16:10 jmct

Yes! You've got it.

I think I'm going to discard the Factory notion, and just rely on qualified imports for switching between backends, though. It's a bit too complicated for too little benefit.

jwiegley avatar Oct 09 '14 03:10 jwiegley

I'm also having the same problem with Git.Tutorial being out of date. Particularly where it references createRepository which appears to be deprecated.

craigem avatar Oct 25 '14 23:10 craigem

Yes, it is very out of date.

jwiegley avatar Oct 26 '14 05:10 jwiegley

What can we do to help? I'm trying to work out how to utilise gitlib so if there's anything I can do to help, I'd be happy too :-)

craigem avatar Oct 26 '14 05:10 craigem

@craigem Just help get it down onto paper, so to speak. I'm more than happy to meet with you by whatever medium you desire (Google Hangouts, Skype, IRC, even telephone) and give you a brain dump, if you can turn that dump into written word for others.

jwiegley avatar Oct 26 '14 22:10 jwiegley

Hello! How's this going? @craigem, @jmct, i'm having the same problems -- do you guys have minimal working examples available? With that i'm sure i'll be okay, but for now i can't even figure out how to instantiate RepositoryFactory. Maybe it's just late, though.

toothbrush avatar Nov 19 '14 19:11 toothbrush

Hey @toothbrush, I did figure it out a bit, but then my PhD duties called and I had to switch away from it. My plan is to use my holiday break in a few weeks to write up some new docs and issue a PR.

As for your immediate question: Each backend provides a function that gives you a RepositoryFactory like https://github.com/jwiegley/gitlib/blob/master/gitlib-libgit2/Git/Libgit2.hs#L1502-L1509 for the Libgit2 backend.

jmct avatar Nov 20 '14 23:11 jmct

@jmct: thanks, I also managed. All i wanted (embarrassingly enough) was to pull out the HEAD hash. (Off-topic: i was amused to note that you're also an XMonad user on Arch. I will now stop stalking and get back to my own PhD duties too ;) )

toothbrush avatar Nov 20 '14 23:11 toothbrush

I would second that having at least a minimal example working in the source code itself would be most helpful. I also was stuck on not figuring out how to get RepositoryFactory instantiated...

edyu avatar Apr 10 '15 19:04 edyu

For example, I'd like to know how do I do the equivalent of "git init" on a directory for example. I know now that you can get lgFactory assuming I'm using the gitlib-libgit2 backend but how do I fill out the action parameter?

edyu avatar Apr 10 '15 19:04 edyu

For now, please see the git-monitor code as an example of how to use gitlib.

jwiegley avatar Apr 10 '15 19:04 jwiegley