static void show_stats(struct patch *patch)
{
+ const char *prefix = "";
char *name = patch->new_name;
int len, max, add, del, total;
max = max_len;
if (max > 50)
max = 50;
- if (len > max)
+ if (len > max) {
+ char *slash;
+ prefix = "...";
+ max -= 3;
name += len - max;
+ slash = strchr(name, '/');
+ if (slash)
+ name = slash;
+ }
len = max;
/*
add = (add * max + max_change / 2) / max_change;
del = total - add;
}
- printf(" %-*s |%5d %.*s%.*s\n",
+ printf(" %s%-*s |%5d %.*s%.*s\n", prefix,
len, name, patch->lines_added + patch->lines_deleted,
add, pluses, del, minuses);
}