Giter Club home page Giter Club logo

Comments (10)

Nutlope avatar Nutlope commented on August 28, 2024 1

Thanks for the suggestion @spenserblack, I agreed that this would be great! @privatenumber has a PR #64 that when merged, should enable us to do this well. I'll let you two chat about implementation details :)

from aicommits.

privatenumber avatar privatenumber commented on August 28, 2024 1

I'm working on a Git hook in #83 so using the editor configured in Git will open via git commit with AI generated messages.

For CLI mode, @Nutlope wants a more user-friendly editor inline.

from aicommits.

spenserblack avatar spenserblack commented on August 28, 2024

A git hook is an interesting idea 👍

Assuming that some users may want to use aicommits in all repositories via the hook, I wonder if it would make sense to document how to use a template directory so that all new repos come with the hook pre-installed.

from aicommits.

privatenumber avatar privatenumber commented on August 28, 2024

Closed via #95

from aicommits.

joeytwiddle avatar joeytwiddle commented on August 28, 2024

This makes it possible to edit when using the hook integration.

But I think it would still be useful to hit E to edit the commit, when using the aicommits command on an un-hooked project.

Why? I jump around lots of projects, and occasionally call on aicommits. I would like to have this feature without needing to set up the hook integration.

from aicommits.

privatenumber avatar privatenumber commented on August 28, 2024

That idea was tabled because we'll need to maintain a CLI text editor which would be a huge maintenance risk if people keep asking for more features.

from aicommits.

spenserblack avatar spenserblack commented on August 28, 2024

we'll need to maintain a CLI text editor

Can't you just start a text editor subprocess? Git picks the editor to use in this order:

  1. $GIT_EDITOR
  2. core.editor config value
  3. $VISUAL
  4. $EDITOR

E.g. GIT_EDITOR=vi git commit.

So instead of building out a CLI text editor, why not try to resolve an editor from these and try to execute them in a subprocess, in a way similar to git?

from aicommits.

privatenumber avatar privatenumber commented on August 28, 2024

That's what was implemented with the git hook.

from aicommits.

spenserblack avatar spenserblack commented on August 28, 2024

I agree with the implication in @joeytwiddle's comment that installing a hook in many repositories can get repetitive. TBH I usually limit hooks to what must be used to contribute to a repo (linters, formatters, etc.).

Maybe I'm misunderstanding your definition of "CLI text editor," but what I'm asking is if E should remain tabled if you don't need to maintain a CLI text editor.

from aicommits.

joeytwiddle avatar joeytwiddle commented on August 28, 2024

Instead of aicommits opening an editor, perhaps we could ask git to do it.

For example, after running git commit -m ...

await execa('git', ['commit', '-m', message, ...rawArgv]);

We could immediately run git commit --amend

(iff the user had pressed E)

from aicommits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.