If we have really short read the input buffer will not have a new line and rindex with through the ValueError exception. Handle the same gracefully Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxx> --- contrib/gitview/gitview | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview index 01128f4..4f39ddd 100755 --- a/contrib/gitview/gitview +++ b/contrib/gitview/gitview @@ -421,8 +421,13 @@ class AnnotateWindow(object): self.prev_read = "" if (buffer[len(buffer) -1] != '\n'): - self.prev_read = buffer[buffer.rindex("\n"):(len(buffer))] - buffer = buffer[0:buffer.rindex("\n")] + try: + newline_index = buffer.rindex("\n") + except ValueError: + newline_index = 0 + + self.prev_read = buffer[newline_index:(len(buffer))] + buffer = buffer[0:newline_index] for buff in buffer.split("\n"): annotate_line = re.compile('^([0-9a-f]{40}) (.+) (.+) (.+)$') -- 1.5.2.1.239.g75d8-dirty - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html