Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line longer description #40

Closed
ghostsquad opened this issue Feb 28, 2020 · 6 comments · Fixed by #77
Closed

Multi-line longer description #40

ghostsquad opened this issue Feb 28, 2020 · 6 comments · Fixed by #77
Labels

Comments

@ghostsquad
Copy link

How do I do a longer multi-line description when asked for a "Provide a longer description of the change" ?

@ghostsquad
Copy link
Author

make the behavior configurable, both as a default in the config file, but also an overriding flag.

Implementation

If you pass --edit you'll be dropped into your user defined editor to create the longer commit body (pre-filled with everything else that's set prior)

Look at the git config for core.editor and use that defined program to write the commit message (which has been pre-filled with everything set prior). You can then fall back to looking for environment variables VISUAL or EDITOR with a hardcoded fallback to vi. Similar to how you can do this with git.

To maintain backwards compatibility, without flags, support single line messages (kind of like git -m).

Users can create bash aliases, or change the configuration to support a default behavior if they wish.

Note, that if the default behavior can be set to --edit behavior in the config, then it would would be also useful to have a --no-edit CLI option, to override the config file.

@ghostsquad
Copy link
Author

I've been using this as a daily driver for awhile now, and I absolutely love it. However the problem of not being able to easily write long multi-line commit bodies is still a problem.

My workaround right now is pretty terrible

gacp
git commit --amend
git push --force

@vivaxy any chance you could spend some time on this? I'd contribute but I'm pretty terrible with javascript and worse with typescript.

@vivaxy
Copy link
Owner

vivaxy commented Apr 9, 2020

gacp uses prompts underhood. prompts does not supports editor mode for now, see: terkelg/prompts#52.

I think there are two ways of implementing this feature:

  1. By typing \n means line break in body section. This brings less work to do, and could be done soon.
  2. By passing --edit, and invoke node-external-editor or vi. This brings a lot work to do, and I won't be able to implement it for now.

Let me know which way you prefer. @ghostsquad

Thanks for your suggestion.

@ghostsquad
Copy link
Author

I should have posted this a lot earlier. using \n doesn't work. it prints a literal \n in the commit body.

I would prefer option 2

vivaxy added a commit that referenced this issue Jun 23, 2020
using external-editor module

resolve #40, #43
@vivaxy
Copy link
Owner

vivaxy commented Jun 23, 2020

Supported in gacp@2.10.0

@ghostsquad
Copy link
Author

you are kidding! I didn't know you were working on 2.0! I'll download and try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants