Skip to content

autoproj update fails if git prints warnings to stdout #375

@FifoIronton

Description

@FifoIronton

When updating a package using autoproj, it will fail in a confusing manner if git prints warnings out to stdout.
For a concrete example: I have set git confige core.autocrlf true in my environment, which causes the following output to stdout when adding a file:

$ git add ex.txt
warning: LF will be replaced by CRLF in ex.txt.
The file will have its original line endings in your working directory

Consequently, when running autoproj update in my project, I see the following error:

nick@laptop:/path/buildconf_root/package_dir$ autoproj update
  operating system: ubuntu,debian - 20.04,20.04.1,lts,focal,fossa
  updating bundler
  updating autoproj
  bundler: connected to https://rubygems.org/
  already up-to-date autoproj main configuration
[...]
Command failed
main configuration(/path/buildconf_root/autoproj): failed in import phase
    'git --git-dir /path/buildconf_root/autoproj/.git update-index --add --cacheinfo 100644,warning: LF will be replaced by CRLF in overrides.d/50-versions.yml.,overrides.d/50-versions.yml' returned status 129
    see /path/buildconf_root/install/log/main configuration-import.log for details
    last 1 lines are:

    error: option 'cacheinfo' expects <mode>,<sha1>,<path>

This error can be sidestepped by running git config core.safecrlf false, but this fix was not immediately clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions