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.

commit not aborting

See original GitHub issue

Hey, I hae the following test - setup: ./package.json

{
  "name": "guppy-test",
  "devDependencies": {
    "git-guppy": "^1.2.1",
    "gulp": "^3.9.1",
    "gulp-task-loader": "^1.2.1",
    "guppy-pre-commit": "^0.3.0"
  }
}

./gulpfile.js

var gulp = require('gulp');
require('gulp-task-loader')('hooks_gulp-tasks');

gulp.task('pre-commit', ['rejector']);

./hooks_gulp-tasks/rejector.js

var gulp = require('gulp');
var guppy = require('git-guppy')(gulp);

module.exports = function () {
  console.log("Nope, I'm rejecting ", guppy.src('pre-commit'), '!');

  return 1;
};

But every commit is just passing and completing without any trace of the return 1.

Versions:

λ node --version
v6.3.0
λ npm --version
3.10.3
λ gulp --version
[16:33:54] CLI version 1.2.1
[16:33:54] Local version 3.9.1
λ git --version
git version 2.9.0.windows.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
therealklannicommented, Jul 15, 2016

I would just use the gulp-util error method.

0reactions
LucaVazzcommented, Jul 15, 2016

Oh… Sorry, my bad, I totally forgot about the streams.

(Do you know about a better way in gulp to error correctly for this use-case than PluginError from gulp-util or would that be fitting?)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aborting commit due to empty commit message - Stack Overflow
The reason is that git doesn't allow commit without messages. You have to associate some messages with your commit command. Share.
Read more >
doesn't abort commit if user doesn't modify the template ...
What steps will reproduce the problem? set a template commit message; try doing a commit; click "Commit" without modifying the message.
Read more >
Git - git-commit Documentation
If the user exits the editor without editing the message, the commit is aborted. This has no effect when a message is given...
Read more >
Gcommit does not abort commit message if prepare ... - GitHub
Hi,. I have prepare-commit-msg and commit-msg hooks active. This simply messes up Gcommit. ... Which works fine. Ticket numbers are prepended to ...
Read more >
Why can't you abort a git commit amend? - Reddit
Git aborts the commit if the message is empty. When amending you already have a message. Hence if you want to abort the...
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