Re: [PATCH v4 15/16] branch: use ref-filter printing APIs

2 messages, 2 authors, 2016-06-16 · open the first message on its own page

Re: [PATCH v4 15/16] branch: use ref-filter printing APIs

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:18:45

Junio C Hamano [off-list ref] writes:
Karthik Nayak [off-list ref] writes:
quoted
+			    branch_get_color(BRANCH_COLOR_REMOTE), maxwidth,
+			    remote_prefix, branch_get_color(BRANCH_COLOR_RESET));
+	} else {
+		strbuf_addf(&local, "%%(refname:strip=2)%s%%(if)%%(symref)%%(then) -> %%(symref:short)%%(end)",
+			    branch_get_color(BRANCH_COLOR_RESET));
+		strbuf_addf(&remote, "%s%s%%(refname:strip=2)%s%%(if)%%(symref)%%(then) -> %%(symref:short)%%(end)",
+			    branch_get_color(BRANCH_COLOR_REMOTE), remote_prefix, branch_get_color(BRANCH_COLOR_RESET));
The overlong lines are somewhat irritating, but the change above in
this round relative to the previous one shows a good use case for
the conditional formatting feature and illustrates how powerful the
concept it is.  I like it.

Thanks, will queue.
Having said that, doesn't this need to be further adjusted for
95c38fb0 (branch: fix shortening of non-remote symrefs, 2016-04-03)?

http://thread.gmane.org/gmane.comp.version-control.git/290622/focus=290624

Re: [PATCH v4 15/16] branch: use ref-filter printing APIs

From: Karthik Nayak <hidden>
Date: 2016-06-16 02:18:46

Hello,

On Wed, Apr 13, 2016 at 2:35 AM, Junio C Hamano [off-list ref] wrote:
Junio C Hamano [off-list ref] writes:
quoted
Karthik Nayak [off-list ref] writes:
quoted
+                        branch_get_color(BRANCH_COLOR_REMOTE), maxwidth,
+                        remote_prefix, branch_get_color(BRANCH_COLOR_RESET));
+    } else {
+            strbuf_addf(&local, "%%(refname:strip=2)%s%%(if)%%(symref)%%(then) -> %%(symref:short)%%(end)",
+                        branch_get_color(BRANCH_COLOR_RESET));
+            strbuf_addf(&remote, "%s%s%%(refname:strip=2)%s%%(if)%%(symref)%%(then) -> %%(symref:short)%%(end)",
+                        branch_get_color(BRANCH_COLOR_REMOTE), remote_prefix, branch_get_color(BRANCH_COLOR_RESET));
The overlong lines are somewhat irritating, but the change above in
this round relative to the previous one shows a good use case for
the conditional formatting feature and illustrates how powerful the
concept it is.  I like it.

Thanks, will queue.
They are quite long and a little confusing, but like you said really powerful.
Having said that, doesn't this need to be further adjusted for
95c38fb0 (branch: fix shortening of non-remote symrefs, 2016-04-03)?

http://thread.gmane.org/gmane.comp.version-control.git/290622/focus=290624
That was one of the changes made in this version of the patch series :)

-- 
Regards,
Karthik Nayak
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help