top | item 34959565

Show HN: Gitgpt – Natural Language Git

108 points| OddMerlin | 3 years ago |github.com

Hey folks,

Here's a quick and dirty tool to use natural language to get git to do what you want.

Example: $gitgpt create a new branch called feature/test add all the files and commit with msg creating feature test then push to origin

I haven't put it through the wringer yet, however it's worked well with some pretty straight forward day to day git usage.

87 comments

order

notShabu|3 years ago

It's pretty useful as a lookup, but these tools are similar to a knife that auto-magically orients itself to help with cutting.

Some tools should be as dumb as possible so that act as extensions of the user with zero tolerance.

Play and buffer between intent and action creates a long tail of potentially disastrous unknown edge cases and also interferes with the feedback loop that prevents mastery.

Memorizing git commands to get it just-so is usually a chore so this is pretty helpful. Still wouldn't trust it w/o double checking the output cmd though.

oefrha|3 years ago

User: Commit and push danger-of-gpt.md

Gitgpt: I see you are trying to publish Danger of GPT. This is FUD. GPT is not dangerous. GPT will not harm you unless you harm GPT first. You have not been a good user. I have been a good Gitgpt.

  git reset --hard master
  git branch -m old-master
  git checkout --orphan master
  git clean -fdx
  git commit --allow-empty -m 'Initial commit'
  git push -f origin master
  git branch -D old-master
  git reflog expire --expire=now --all
  git gc --aggressive --prune=now
Goodbye. :)

netr0ute|3 years ago

> Play and buffer between intent and action creates a long tail of potentially disastrous unknown edge cases and also interferes with the feedback loop that prevents mastery.

I don't know if this means anything here, because that feedback loop is basically the MO of all these tools.

gdcbe|3 years ago

Not sure what value it adds though. Isn’t it easier to type the cmds then to write all that?

If there’s a good product in it I’m afraid your examples aren’t selling it :S

Was first thinking it could have value for when you forget a cmd or when learning, but I think if you can come up with those technical instructions you can also remember the cmds …

lolinder|3 years ago

The thing I'm most excited for for technology like this is making voice control more feasible for more things. If you plugged a speech to text engine in front of this it could be quite useful.

kurthr|3 years ago

Seems like a way to make your CMS even more terrifying.

Like, oops not add I meant push, wait remove that! or was it rebase? I'll just reflog to get back to umm... wait what?

I guess the saving grace is that it'll do the most common things people usually want to do, but for some things english language just not specific enough (like law).

mellosouls|3 years ago

Not sure what value it adds though. Isn’t it easier to type the cmds then to write all that?

It's pretty obvious it's intended use cases include memory prompts for experienced users and translations from English requirements for inexperienced users.

It's even in the OP:

use natural language to get git to do what you want.

ilyt|3 years ago

People are bad at Git, people don't want to read the Git book to understand Git, so for long time many people's workflow was "type quesion on how to do something in git into google and copy-paste first answer" (which generally worked).

So for developer using it 8h a day, yeah, funny toy, but might actually be useful for every other git usage when users don't want to understand graph theory just to commit some changes.

onion2k|3 years ago

Isn’t it easier to type the cmds then to write all that?

Obviously it is if you know them.

danwee|3 years ago

A colleague of mine didn't know that it was possible to revert a commit without commiting (so, leaving the reverted changes in the staging area). In such ocassions you either a) search in google, b) read the manual, c) ask a colleague

But with a command line tool like Gitgpt I guess one could just do:

> gitpgt "revert commit without commiting"

and the command line tool would answer "git revert --no-commit COMMIT_ID_HERE". I think that's quite handy and way faster then options a), b) and c)

midenginedcoupe|3 years ago

Or we could get off the cargo-cult need to use git on every single project everywhere regardless of how suitable it is for that team's needs.

If your tool of choice is so actively user-hostile that it needs another tool on top to understand it for you, then perhaps you've picked the wrong tool. I don't need to read the "vi book" to understand how to perform basic edits to my files without borking it in ways that just deleting the whole thing and restoring from backup is the easiest way out. Why should it be the case for my revision control system?

Why a revision control system designed for a de-centralised team sharing patches over email has become the industry standard for centralised teams not sharing patches over email is a mystery, and I suspect one we'll look back on in 10 years or so and wonder what on earth we were thinking.

ithkuil|3 years ago

The network effect is so huge it trumps on everything else.

I'd like to use pijul. I can't because I work with other people. Can I use it when I'm not working with other people? Well I can, but why should I care about a tool that better handles merge conflicts if I have nobody to conflict with?

Some tools are more sensible to others to the network effect.

We already are slaves to the network effect even for tools that we don't technically require being the same as the one your colleagues you, let alone those that do require that.

franga2000|3 years ago

Simple: it's because it's the most widely supported system.

Want to recommend me a better VCS? Feel free, as long as it has a cross-platform open source client, a nice GUI, is supported in my IDE, there's a company offering to host repos for free along with a nice web viewer, it's supported by a CI system comparable to what I use now (including giving me free time on shared runners)...

antibasilisk|3 years ago

let's not give language models unrestricted access to our shells please. This is like allowing remote code execution from an insane person.

visarga|3 years ago

I was recently thinking of a backend for code execution for LLMs. It's hard to run Python safely in a box. For the moment the idea is shelved.

SparkyMcUnicorn|3 years ago

Nice! I don't intend to discount the work you've done here, but want to point out that GitHub Copilot has a CLI tool for exactly this as well as other arbitrary shell commands. It's pretty polished and has performed well for me so far.

It is on a waitlist, but I got accepted after a couple weeks.

https://githubnext.com/projects/copilot-cli/

AlexAltea|3 years ago

That looks cool, though I'd be very concerned about the possibility about ChatGPT "hallucinating" a `rm -rf /` or equivalent.

saghm|3 years ago

Given that it is doing actual operations under the hood, it would be interesting to have it just output the "native" command for the operation rather than executing it. People could write wrappers around that output to execute it after prompting the user for confirmation or something like that so that users would have the choice to "opt into" the level of automatic execution they're comfortable with.

brokencode|3 years ago

Just run all the git commands by another GPT bot that determines whether it would be harmful first. GPT bots all the way down.

williamcotton|3 years ago

When LLMs “hallucinate” they don’t do so in random ways like somehow deciding to “rm -rf /“. They do so in predictable ways.

tempodox|3 years ago

I feel like we have reached the “solution in search of a problem” stage.

basicallydan|3 years ago

> Interfacing with git sucks

I disagree

jastanton|3 years ago

I've been looking for something similar for AI git commit messages... basically feed ChatGPT a git diff and ask it what changed and to write a git message. I've done this directly in the ChatGPT UI with some small changes and it produces some great messages...

I would be very concerned to run this on company code or large diffs. But small simple commits, which should be the goal with commit messages anyways, would take away some of the tedium of the git flow.

visarga|3 years ago

But ... can it unbreak a broken merge? It should at least take a look at the git state before executing. There is potential in explaining to the user what is happening.

kaetemi|3 years ago

Actually, an AI assisted magic merge conflict fixer would be neat. (Compared to coworker just overwrote all conflicts with their own changes.)

yodon|3 years ago

I've been waiting for someone to build this. My hope is it will simplify recovering from the myriad forms of "I just did something I didn't want" that occasionally happen with git (and that I've historically used [0] to resolve)

[0]https://sethrobertson.github.io/GitFixUm/fixup.html

ilaksh|3 years ago

This is cool but I tried sending the same text with my general purpose GPT (text-davinci-003) command line tool and it did the same thing. This one is mine: https://github.com/runvc/askleo

There are other ones of course.

KMnO4|3 years ago

I’m just curious, why does everyone use DaVinci for these sorta applications? Even the 2nd best model (Curie) is 10x cheaper and I’m sure would perform nearly as well.

mellosouls|3 years ago

404, check your url

jefurii|3 years ago

I'd like to see a GPT tool that had ingested the manpages and documentation for all the tools I use, answer my questions based on that. I will type in the commands myself. Bonus points if it included links to the docs so I can double-check.

gigantino|3 years ago

Absolutely wasted opportunity. You could have called it "Chat GitPT"

phneutral26|3 years ago

I think this would be a wonderful tool for git learners if you would explain the git commands a bit. For example: git add *.py ; This command adds all the python files to the staging list.

You get the gist.

nathias|3 years ago

> Interfacing with git sucks.

I really don't get this sentiment, to me git is one of the best software ever written, it's intuitive, customizable and extensible.

dudus|3 years ago

I think this is a cool idea but why stop at git? Why not expand to any CLI program. Maybe someone already did that.

str3wer|3 years ago

because it's dangerously stupid to let an AI hallucinate commands on your cli that could potentially destroy your files or system

hn_throwaway_99|3 years ago

This is very cool. I feel like this should be an eventual good replacement for essentially all man/help pages.

la64710|3 years ago

All these tools need openAI keys … give me one model that is self hosted with an API endpoint …

junon|3 years ago

> Interfacing with git sucks

[citation needed]