7 comments

  • JdeBP 3 hours ago
    The display weirdness (e.g. the Z shell's percent character showing up) that you are seeing in your demo is because you are putting the terminal line discipline into raw mode, raw mode of course does not do CR-before-LF stuffing, and there's some confusion in the code as to when it does and when it does not explicitly emit CRs.

    * https://github.com/bmf-san/ggc/blob/9e93ef8a87973cab916e37a9...

    * https://github.com/bmf-san/ggc/blob/9e93ef8a87973cab916e37a9...

    • johnisgood 3 hours ago
      Where is the "%" showing up? I only see it before he runs ggc. It is common to use "%" instead of "$" in some shells.

      In particular, C Shell (csh) and Tcsh uses "%" as the prompt character. Common in BSD systems.

      Of course you can customize Zsh (or Bash) to show "%", too.

      Edit: never mind, I noticed it when he quit "ggc". My bad. :)

  • donatj 1 hour ago
    I'm kind of relieved to see that it calls out to the native git binary. There is a popular pure-Go git implementation that is in my experience very slow.
  • awestroke 3 hours ago
    A terminal based CLI? As opposed to what?
    • osigurdson 1 hour ago
      I think they mean it is an interactive type terminal program (vs "one shot" as the git cli itself).
      • csmantle 1 hour ago
        From the GIF in the repo I think it's somewhere between CLI and TUI -- it's interactive but does not try to draw windows/surfaces in the terminal. But the borderline is fuzzy, so yeah
  • johnisgood 3 hours ago
    This is not intended to be an insult of any sort, but I am pretty sure the use of LLM to write this was not so moderate, but I have nothing against it, you have a working project. I have done the same with projects similar to this.

    I use lazygit (also written in Go) and magit a lot, they are quite nice. For GUI, I use Git Cola.

    I wish the demo GIF was something more complex, perhaps adding & removing a particular chunk and committing it or something like that.

    • emigre 1 hour ago
      How were you able to tell?
  • scosman 1 hour ago
    Naming suggestion; you’re too close to gcc for my brain to see the difference.
    • emigre 1 hour ago
      I agree!... Definitely confusing...
  • nikolayasdf123 2 hours ago
    > Requirement: git command must be installed

    holdup... is this just a wrapper around git?

    • nikolayasdf123 2 hours ago
      > cmd := c.execCommand("git", "branch", "--format", "%(refname:short)")

      oh my god. you have just wrapped standard git CLI. well, this is dissapointing.

      • williamdclt 1 hour ago
        Not sure what you expected? That's the case for all git clients (is there any using libgit?) and almost certainly the right thing to do
        • ultramann 1 hour ago
          I'm aware of go-git [0] which

          > aims to be fully compatible with git, all the porcelain operations are implemented to work exactly as git does

          written in pure go, therefore with a go native api.

          I've never tried to use it, but it does look quite impressive to me.

          [0] https://github.com/go-git/go-git

          • throwaway127482 14 minutes ago
            I've used it - it's lacking a ton of features. Another commenter in this thread said it's very slow compared to the git CLI, which is not surprising given that git is written in C.
        • johnisgood 45 minutes ago
          I would have used libgit2 myself in any languages. If bindings do not exist, I would have made the bindings first. There is no way I would have called out to an external program.

          Someone mentioned https://github.com/go-git/go-git. I would have definitely used it unless there are better alternatives. If - as someone who claimed - it turns out it is slow, I would have created my own bindings to libgit2 still, most likely.

      • trwhite 2 hours ago
        I’m not sure I see from your example why? You’d expect any git client to have branch.