Skip to content
Snippets Groups Projects
Commit 257507a3 authored by Junio C Hamano's avatar Junio C Hamano
Browse files

Merge branch 'sh/submodule-summary-abbrev-fix'

The "git submodule summary" subcommand showed shortened commit
object names by mechanically truncating them at 7-hexdigit, which
has been improved to let "rev-parse --short" scale the length of
the abbreviation with the size of the repository.

* sh/submodule-summary-abbrev-fix:
  git-submodule.sh: shorten submodule SHA-1s using rev-parse
parents 75e1a08b 0586a438
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -850,8 +850,11 @@ cmd_summary() {
;;
esac
 
sha1_abbr_src=$(echo $sha1_src | cut -c1-7)
sha1_abbr_dst=$(echo $sha1_dst | cut -c1-7)
sha1_abbr_src=$(GIT_DIR="$name/.git" git rev-parse --short $sha1_src 2>/dev/null ||
echo $sha1_src | cut -c1-7)
sha1_abbr_dst=$(GIT_DIR="$name/.git" git rev-parse --short $sha1_dst 2>/dev/null ||
echo $sha1_dst | cut -c1-7)
if test $status = T
then
blob="$(gettext "blob")"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment