[PATCH 0/3] git-describe deals gracefully with broken submodules
- From
Stefan Beller <sbeller@google.com>
- Date
- Mar 21, 2017, 00:11 UTC
- Message-ID
- <20170321001156.21915-1-sbeller@google.com>
Our own version generation in GIT-VERSION-GEN is somewhat sane by testing if we have a .git dir, and use that as a signal whether the obtained copy of git was obtained using git (clone/fetch) or if it is just a downloaded tar ball.
Other scripts to generate a version are not as cautious and just run "git describe". An error from git-describe is treated as a sufficient signal to assume it is not a git repository.
When submodules come into play, this is not true, as a submodule may be damaged instead, such that we're still in a git repository but error out for the sake of reporting a severly broken submodule.
Add a flag to git-describe that instructs it to treat severe submodule errors as "dirty" instead of erroring out.
Thanks, Stefan
Stefan Beller (3): submodule.c: port is_submodule_modified to use porcelain 2 revision machinery: gentle submodule errors builtin/describe: introduce --submodule-error-as-dirty flag
builtin/describe.c | 17 ++--- diff-lib.c | 10 ++- diff.h | 1 + diffcore.h | 3 +- revision.c | 2 + submodule.c | 94 +++++++++++++++++----------- submodule.h | 10 ++- t/t4060-diff-submodule-option-diff-format.sh | 22 +++++++ t/t6120-describe.sh | 17 +++++ 9 files changed, 128 insertions(+), 48 deletions(-)
-- 2.12.0.402.g4b3201c2d6.dirty