From: Marc Herbert <[email protected]>
Date: Wed, 17 Nov 2010 13:14:07 +0000
Subject: [PATCH] Make git --graph option optional again in log washing.
The (newer) "magit-log-oneline-re" regular expression was requiring
--graph, making the (older) magit-configure-have-graph logic
irrelevant: it had to return "true". Making --graph optional again is
not just fixing support for old git clients but also opening some log
possibilities, like removing the spurious star or showing tags in the
status view.
---
> Well, to be frank there needs to be quite a lot of work around the log
> code. The long log doesn't work properly as it applies that RE to it.
>
> If you really want to fix the whole thing so that the log commands are
> a little more contextually aware and do the right thing when parsing,
> it would be a huge help. If you don't I'd say get rid of
> `magit-configure-have-graph' (unless people speak up and tell me they
> use it).
Well sorry *I* would like to speak up: I think making graph optional is
useful as explained in commit message above. And it is an easy and very
minor change, please review patch below.
PS: how often do you update github.com?
magit.el | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/magit.el b/magit.el
index 8ecb81b..7d0c4a7 100644
--- a/magit.el
+++ b/magit.el
@@ -2422,7 +2422,7 @@ in the corresponding directories."
(defvar magit-log-oneline-re
(concat
- "^\\([_\\*|/ -.]+\\)" ; graph (1)
+ "^\\([_\\*|/ -.]+\\)?" ; graph (1)
"\\(?:"
"\\([0-9a-fA-F]\\{40\\}\\) " ; sha1 (2)
"\\(?:\\((.+?)\\) \\)?" ; refs (3)
@@ -2468,7 +2468,8 @@ must return a string which will represent the log line.")
(propertize (substring sha1 0 8) 'face 'magit-log-sha1)
(insert-char ? 8))
" "
- (propertize graph 'face 'magit-log-graph)
+ (when graph
+ (propertize graph 'face 'magit-log-graph))
string-refs
(when message
(propertize message 'face 'magit-log-message)))))
--
1.7.2.3