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

lein vcs assert-committed is broken #2156

Closed
a1exsh opened this issue Jun 6, 2016 · 3 comments
Closed

lein vcs assert-committed is broken #2156

a1exsh opened this issue Jun 6, 2016 · 3 comments
Assignees

Comments

@a1exsh
Copy link

a1exsh commented Jun 6, 2016

Preconditions:

$ lein -v
Leiningen 2.6.1 on Java 1.8.0_91 OpenJDK 64-Bit Server VM

Setup:

$ lein new default
Generating a project called default based on the 'default' template.
The default template is intended for library projects, not applications.
To see other templates (app, plugin, etc), try `lein help new`.
$ cd default
$ git init .
Initialized empty Git repository in /.../default/.git/
$ git add project.clj
$ git commit -m "add project.clj"
$ $EDITOR project.clj
$ git diff --stat
 project.clj | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Observation:

$ lein vcs assert-committed && echo OK
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   project.clj

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .gitignore
    CHANGELOG.md
    LICENSE
    README.md
    doc/
    src/
    test/

no changes added to commit (use "git add" and/or "git commit -a")
OK

Expected: no OK message, Uncommitted changes in ... reported.

Observation:

$ git add project.clj
$ lein vcs assert-committed && echo OK
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   project.clj

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .gitignore
    CHANGELOG.md
    LICENSE
    README.md
    doc/
    src/
    test/

OK

Expected: no OK message, Uncommitted changes in ... reported.

@3duard0
Copy link
Contributor

3duard0 commented Jun 10, 2016

Yes, it seems to be broken.

The error was introduced by the fix of #1857 at this commit: c35a1de

The function eval/sh is not piping output from *out* anymore, instead it is piping from System/out. with-out-str when called with eval/sh as parameter is returning empty string, thus failing to match git status output.

That's all I've found about the problem, I still don't know a fix for this that won't break fix of #1857

3duard0 added a commit to 3duard0/leiningen that referenced this issue Jun 10, 2016
Usage of with-out-str with eval/sh should be replaced by utils/with-system-out-str
as eval/sh is writing output to System/out.
3duard0 added a commit to 3duard0/leiningen that referenced this issue Jun 10, 2016
Usage of with-out-str with eval/sh should be replaced by utils/with-system-out-str
as eval/sh is writing output to System/out.
@3duard0
Copy link
Contributor

3duard0 commented Jun 10, 2016

@hypirion I've added a fix for this, but I'm still new to clojure, if anything is not okay I'll be glad to correct.

@hypirion hypirion self-assigned this Jun 19, 2016
@hypirion
Copy link
Collaborator

Fixed by #2159.

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

No branches or pull requests

3 participants