Skip to content

Commit

Permalink
scripts/setlocalversion: remove mercurial, svn and git-svn supports
Browse files Browse the repository at this point in the history
The mercurial, svn, git-svn supports were added by the following commits:

 - 3dce174 ("kbuild: support mercurial in setlocalversion")

 - ba3d05f ("kbuild: add svn revision information to setlocalversion")

 - ff80aa9 ("setlocalversion: add git-svn support")

They did not explain why they are useful for the kernel source tree.
Let's revert all of them, and see if somebody will complain about it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nico Schottelius <nico-linuxsetlocalversion@schottelius.org>
  • Loading branch information
Masahiro Yamada committed May 26, 2021
1 parent c39013e commit 2a73cce
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions scripts/setlocalversion
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ scm_version()
fi
fi

# Is this git on svn?
if git config --get svn-remote.svn.url >/dev/null; then
printf -- '-svn%s' "$(git svn find-rev $head)"
fi

# Check for uncommitted changes.
# First, with git-status, but --no-optional-locks is only
# supported in git >= 2.14, so fall back to git-diff-index if
Expand All @@ -96,42 +91,6 @@ scm_version()
} | grep -qvE '^(.. )?scripts/package'; then
printf '%s' -dirty
fi

# All done with git
return
fi

# Check for mercurial and a mercurial repo.
if test -d .hg && hgid=$(hg id 2>/dev/null); then
# Do we have an tagged version? If so, latesttagdistance == 1
if [ "$(hg log -r . --template '{latesttagdistance}')" = "1" ]; then
id=$(hg log -r . --template '{latesttag}')
printf '%s%s' -hg "$id"
else
tag=$(printf '%s' "$hgid" | cut -d' ' -f2)
if [ -z "$tag" -o "$tag" = tip ]; then
id=$(printf '%s' "$hgid" | sed 's/[+ ].*//')
printf '%s%s' -hg "$id"
fi
fi

# Are there uncommitted changes?
# These are represented by + after the changeset id.
case "$hgid" in
*+|*+\ *) printf '%s' -dirty ;;
esac

# All done with mercurial
return
fi

# Check for svn and a svn repo.
if rev=$(LC_ALL=C svn info 2>/dev/null | grep '^Last Changed Rev'); then
rev=$(echo $rev | awk '{print $NF}')
printf -- '-svn%s' "$rev"

# All done with svn
return
fi
}

Expand Down

0 comments on commit 2a73cce

Please sign in to comment.