naggie / dstask

Git powered terminal-based todo/note manager -- markdown note page per task. Single binary!
https://calbryant.uk/blog/dstask-a-taskwarrior-alternative/
MIT License
801 stars 47 forks source link

git library vs exec.Command #76

Closed Dieterbe closed 3 years ago

Dieterbe commented 3 years ago

Hello, I see in util.go that dstask currently executes the git binary for git operations. I was wondering if there's any particular opinions on this vs a golang git library such as go-git. There seems to be a couple options but the official one, git2go requires cgo so i would stay away from that.

dontlaugh commented 3 years ago

This is a tough one.

go-git has some advantages: easy creation of in-memory repository objects could make integration tests quite fast. Also, applications that pull in dstask as a library would benefit from a pure-go git implementation.

However, there might be some rough edges for command line users.

  1. I haven't checked on this in a while, but last time I looked, it did not respect OpenSSH config. Has this been fixed? I could not find an issue in the migrated repo.
  2. There may be other git config gotchas for command line users.
Dieterbe commented 3 years ago

I can't speak to the quality of the git libraries. Seems safer to stick to exec.Command then and spend our limited FOSS time on things with higher payoff :) (new features etc)

naggie commented 3 years ago

The main reason is I use a yubikey, which uses a GnuPG2 running as an SSH agent and assumed a go-based git library wouldn't be able to use an SSH agent. I didn't research it though. Another reason is I'm super familiar with the git cli and not a library.

That said, it would make porting dstask (using it like a library) to iOS/Android less painful.

Dieterbe commented 3 years ago

porting dstask (using it like a library) to iOS/Android

:heart_eyes: a mobile app would be awesome!

naggie commented 3 years ago

Yes it would! Having no smartphone app is a reason quite a lot of people don't use dstask yet. A friend of mine has said he wants to write an iOS and/or Android app for dstask (hello @botto ! )

Dieterbe commented 3 years ago

since this was a discussion, not an actual issue, i'm going to close this.