[m-rev.] for review: Add sanity check to tools/import_srcdist.

Julien Fischer jfischer at opturion.com
Thu Jan 27 20:11:20 AEDT 2022


On Thu, 27 Jan 2022, Peter Wang wrote:

> tools/import_srcdist:
>    Check with "git status" that all files in the workspace have been
>    added, not ignored.
>
> diff --git a/tools/import_srcdist b/tools/import_srcdist
> index 51e861ba8..833d4acf0 100755
> --- a/tools/import_srcdist
> +++ b/tools/import_srcdist
> @@ -51,5 +51,10 @@ git checkout --detach "$initialcommit"
> git clean -fdxq .
> tar xf "$archive" --strip-components=1
> git add -f .
> +if git status --porcelain=v1 --ignored | grep -v '^A  '

The version of git I have installed on the host building the rotds
doesn't support --procelain with parameters.  According to the docs
v1 is the default anyway, I think you can omit that parameter.

> +then
> +    echo "Some files were not added." >&2
> +    exit 1
> +fi
> git commit -q -m "Imported $basename"
> git tag -a -m "Tag $version" "$tag"

That's fine otherwise.

Julien.


More information about the reviews mailing list