Skip to content

Makefile: Incorrect syntax resulting in shell command not being executed #1673

@Pratheek555

Description

@Pratheek555

What is the issue?

Currently the root Makefile computers GIT_TREESTATE like below:

GIT_TREESTATE=$(shell if [ -n "$(git status --porcelain)" ]; then echo "dirty"; else echo "clean"; fi)

The issue with this is that the syntax $(git status --porcelain) is parsed by the make command as a variable and not as a shell command substitution. As a result it expands into a empty string before the shell runs, and GIT_TREESTATE always resolves to clean.

Below examples uses the echo command to illustrate the issue:

Current Behaviour:

  • It shows that the GIT Treestate is clean even when is not
Image

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions