leiningen
leiningen copied to clipboard
lein release <task> fails with - java.lang.Exception: Couldn't commit. git exit code: 1
If I run lein release :patch or :major or other task, I get the following error
Robins-MacBook-Pro-2:$ lein release :patch
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
java.lang.Exception: Couldn't commit. git exit code: 1
at leiningen.core.eval$sh_with_exit_code.invokeStatic (eval.clj:212)
leiningen.core.eval$sh_with_exit_code.doInvoke (eval.clj:200)
clojure.lang.RestFn.invoke (RestFn.java:516)
leiningen.vcs$fn__8159.invokeStatic (vcs.clj:70)
leiningen.vcs/fn (vcs.clj:68)
clojure.lang.MultiFn.invoke (MultiFn.java:229)
clojure.lang.Var.invoke (Var.java:379)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invokeStatic (core.clj:648)
clojure.core$apply.invoke (core.clj:641)
leiningen.vcs$vcs.invokeStatic (vcs.clj:102)
Can you give more info on your git environment? I don't know if there's enough info here to debug it, particularly not without git's stderr output.
This is weird, I just ran into the same issue:
$ git version
git version 2.15.0
hub version 2.2.9
$ lein version
Leiningen 2.7.0 on Java 1.8.0_66 Java HotSpot(TM) 64-Bit Server VM
The problem was that the project I was trying to release was already on a released version, so after running: ["change" "version" "leiningen.release/bump-version" "release"] nothing actually changed.
Then when ["vcs" "commit"] was run, it throws an error. Closing as I think you solved your issue on Clojurians Slack @RobinNagpal?
It sounds like this is still a problem, since the actual error message emitted by git is not displayed?
Ah yes, I meant to open an enhancement issue but got distracted. But it would be fine on this issue too.
Sorry if I'm being obtuse, but what might I do to get past this issue? Specify my own :release-tasks with some modifications? Fine to just remove ["vcs" "commit"]?
For the record, part of why I'm asking here is that I don't think that I already have this particular version released (or shouldn't), so I'm not sure why this is happening in my case. I may have to dig further before I can provide any more useful description than that. In the mean time, I would greatly appreciate any light which might be shed on the situation.
It looks like this may have been an authentication issue with Clojars with password expiration, which put things in an odd intermediate state which couldn't be recovered from. Looking through the :release-tasks, I was able to get a release cobbled together picking up from where it left off. But it would be nice if there was a way for leiningen to better resume a failed release task from where it left off.
@metasoarous the way that I resolved this issue was changing the projects version to a SNAPSHOT one, e.g. 1.0.0-SNAPSHOT so that the task ["change" "version" "leiningen.release/bump-version" "release"] had something to change. That sounds different to what you're describing though.
I've opened https://github.com/technomancy/leiningen/issues/2402 for the more general problem you're describing.
@danielcompton Thanks for the feedback! I'll keep that in mind next time.
I just noticed this as well. I have a vanilla :release-tasks.
I ran lein release :minor and I noticed that lein release didn't create a snapshot commit.
I see the deploy step failed silently (because it prompt for deploy credentials)