diff options
author | David Neto <dneto@google.com> | 2022-12-09 12:17:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-09 12:17:52 -0500 |
commit | 226d2a5f3c03df42957ee408769370b11a51026a (patch) | |
tree | 1da8a5f8c839285e84e359cde5b81ef1a414b6f0 /tools | |
parent | d890d83cecfea8483e07331f3a86fb040778b7de (diff) | |
download | amber-226d2a5f3c03df42957ee408769370b11a51026a.tar.gz |
git-sync-deps: show the tail, not the head of what's being checked out (#1004)
* git-sync-deps: show the tail, not the head of what's being checked out
This is more informative when in a deep path.
* Put the '...' at the front, not the end
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/git-sync-deps | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/git-sync-deps b/tools/git-sync-deps index 3090588..0a544d6 100755 --- a/tools/git-sync-deps +++ b/tools/git-sync-deps @@ -116,11 +116,11 @@ def is_git_toplevel(git, directory): def status(directory, checkoutable): - def truncate(s, length): - return s if len(s) <= length else s[:(length - 3)] + '...' + def tail_truncate(s, length): + return s if len(s) <= length else '...' + s[-(length - 3):] dlen = 36 - directory = truncate(directory, dlen) - checkoutable = truncate(checkoutable, 40) + directory = tail_truncate(directory, dlen) + checkoutable = tail_truncate(checkoutable, 40) sys.stdout.write('%-*s @ %s\n' % (dlen, directory, checkoutable)) |