Skip to content

Conversation

@ericpromislow
Copy link

fixes #3347

- What I did

For whatever reason, some files are git removed according to the container. If a particular set of files has been removed, and there aren't any other git changes, ignore the .m suffix on the version.

- How I did it

I wrote a clunky awk script to make that check. I wanted to do something like if diff -sw <(git status -s | sort) <(sort <<'EOT' list of files EOT ); then ...
but the script is written to use the bourne shell, which doesn't support process substitution.

I didn't bother understanding why those 11 files are deleted, but not deleting them would obviously be a better fix, and presumably not require awk code.

- How to verify it
Apply a tag to the codebase. I used git tag 20.10.10.
Running docker buildx bake && build/docker -v should output 20.10.10, not 20.10.10.m

- Description for the changelog
Avoid adding a .m suffix to the version field when there are no actual changes to the codebase.

- A picture of a cute animal (not mandatory but encouraged)

yodie

Running `git status` in the .variables script shows
11 deleted files.

I tried using `git update-index --assume-unchanged <deleted files>`
but got an error that you can't do that on a readonly file system.
If it's a readonly file system I don't know how those files got
deleted, but here's a kludgy workaround.

Verify that `git status -s` reports only those 11 deleted files.
If so, strip the '.m' suffix off the VERSION variable.

Signed-off-by: Eric Promislow <epromislow@suse.com>
@codecov-commenter
Copy link

Codecov Report

Merging #3348 (8406e93) into master (e57b5f7) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3348   +/-   ##
=======================================
  Coverage   58.01%   58.01%           
=======================================
  Files         302      302           
  Lines       21762    21762           
=======================================
  Hits        12625    12625           
  Misses       8215     8215           
  Partials      922      922           

@ericpromislow
Copy link
Author

#3349 looks like a better way to fix the problem.

@ericpromislow ericpromislow deleted the 3347-have-bakex-ignore-deleted-files branch October 25, 2021 00:30
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

Successfully merging this pull request may close these issues.

Using docker buildx bake to build a binary at a tagged commit ends up with a X.Y.Z.m version

2 participants