summaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2018-08-07 12:51:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-08 22:20:09 (GMT)
commitbf1a11f0a100b080a25233980c14b5ae8f3a7d2d (patch)
tree8c2cf02eb6f90f79786f862d9d6477feb5a85e04 /repository.h
parent1d89318c48d233d52f1db230cf622935ac3c69fa (diff)
downloadgit-bf1a11f0a100b080a25233980c14b5ae8f3a7d2d.zip
git-bf1a11f0a100b080a25233980c14b5ae8f3a7d2d.tar.gz
git-bf1a11f0a100b080a25233980c14b5ae8f3a7d2d.tar.bz2
sideband: highlight keywords in remote sideband output
The colorization is controlled with the config setting "color.remote". Supported keywords are "error", "warning", "hint" and "success". They are highlighted if they appear at the start of the line, which is common in error messages, eg. ERROR: commit is missing Change-Id The Git push process itself prints lots of non-actionable messages (eg. bandwidth statistics, object counters for different phases of the process). This obscures actionable error messages that servers may send back. Highlighting keywords in the sideband draws more attention to those messages. The background for this change is that Gerrit does server-side processing to create or update code reviews, and actionable error messages (eg. missing Change-Id) must be communicated back to the user during the push. User research has shown that new users have trouble seeing these messages. The highlighting is done on the client rather than server side, so servers don't have to grow capabilities to understand terminal escape codes and terminal state. It also consistent with the current state where Git is control of the local display (eg. prefixing messages with "remote: "). The highlighting can be configured using color.remote.<KEYWORD> configuration settings. Since the keys are matched case insensitively, we match the keywords case insensitively too. Finally, this solution is backwards compatible: many servers already prefix their messages with "error", and they will benefit from this change without requiring a server update. By contrast, a server-side solution would likely require plumbing the TERM variable through the git protocol, so it would require changes to both server and client. Helped-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
0 files changed, 0 insertions, 0 deletions