Message ID | patch-v3-1.4-62b3a5881c9-20210911T111435Z-avarab@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 162410f8a020dc039ead88c0ec5337ed808b7019 |
Headers | show |
Series | remove dead & internal-only shell code | expand |
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > The is_zero_oid() function in git-submodule.sh has not been used since > e83e3333b57 (submodule: port submodule subcommand 'summary' from shell > to C, 2020-08-13), so we can remove it. > > This was the last user of the sane_egrep() function in > git-sh-setup.sh. I'm not removing it in case some out-of-tree user > relied on it. Per the discussion that can be found upthread of [1]. I am OK with losing sane_egrep because it is not about a usefulness we can give to our users based on our deep knowledge on how Git works; it was rather based on our experience having to deal with silly choice GNU grep made about coloring that made it unpleasant to use in scripts. The users shouldn't have to depend on us for such a thing. But I am OK either way---the whole topic is more or less "Meh" to me. It is hard to draw a line between a collection of pointless churn and a generally useful clean-up, and I am having a hard time deciding which side of the boundary this falls.
diff --git a/git-submodule.sh b/git-submodule.sh index dbd2ec20503..aeb96c58243 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -63,11 +63,6 @@ isnumber() n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1" } -# Given a full hex object ID, is this the zero OID? -is_zero_oid () { - echo "$1" | sane_egrep '^0+$' >/dev/null 2>&1 -} - # Sanitize the local git environment for use within a submodule. We # can't simply use clear_local_git_env since we want to preserve some # of the settings from GIT_CONFIG_PARAMETERS.
The is_zero_oid() function in git-submodule.sh has not been used since e83e3333b57 (submodule: port submodule subcommand 'summary' from shell to C, 2020-08-13), so we can remove it. This was the last user of the sane_egrep() function in git-sh-setup.sh. I'm not removing it in case some out-of-tree user relied on it. Per the discussion that can be found upthread of [1]. 1. https://lore.kernel.org/git/87tuiwjfvi.fsf@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- git-submodule.sh | 5 ----- 1 file changed, 5 deletions(-)