question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Add --verbose option

See original GitHub issue

Hi @carloscuesta!

I love gitmoji and gitmoji-cli. Thank you for making it happen.

I have my own pre-commit hook that makes changes to files and messages the user in the process, so that there’s a record and some awareness of what’s changed.

I’ll admit the way I do it is a bit hacky; I know R far better than I know bash, so I have the pre-commit hook call R to run a script. But it gets the job done, and it also messages the user about it.

That is to say, when I use a simple git commit it messages the user. But when I use gitmoji-cli -c, there is no messaging.

I think maybe the messaging ends up in stderr. For example, I tested what would happen if I had my pre-commit hook always exit with non-zero status. I learned via that test that at least the hook was working… but I also saw my R messaging come through in stderr. But when I changed it to exit successfully, alas, I lost my messaging.

Is there a way to get that back? As I suggested in the title, maybe a --verbose or -v option?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Jeremie-Chauvelcommented, Aug 25, 2021

From a quick look into it, execa support to disable the output buffer, to stream the process, tested in a quick POC, adding thoses options seems to do the trick (redirecting the stdout stream to the current process, might need a more careful approach with stdin):

2021-08-25-09-51-55 vs image

I will probably create a execa wrapper with the correct options for usage within gitmoji-cli when we want to display stdout (hook and commit modes)

0reactions
Jeremie-Chauvelcommented, Aug 25, 2021

basically:

const { stdout } = await execa(
      'git',
      ['commit', ...isSigned, '-m', title, '-m', answers.message],
      { buffer: false, stdio: [process.stdin, process.stdout, process.stderr] }
    )

buffer option: https://github.com/sindresorhus/execa#buffer

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request: Add "verbose" or "debug" option · Issue #18 ...
I'm currently have to perform a reconciliation loop over a set of files in a directory which requires repeatedly attempting to download content....
Read more >
Feature Request - Add more verbose output to the V...
Feature Request - Add more verbose output to the View Monitor function ... It would be great if there were some diagnostic logs...
Read more >
Verbose output - HTTPie 3.2.1 (latest) docs
To see all the HTTP communication, i.e. the final request/response as well as any possible intermediary requests/responses, use the --all option. The ...
Read more >
curl.1 the man page
Many of the options require an additional value next to them. ... but they enable more functionality in a better way than the...
Read more >
Add verbose output that prints values of all parameters (#112)
From user meeting 2021: Add flag that outputs all parameter values (including those where default values are being used). ... Drag your designs ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found