public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Karthik Nayak <karthik.188@gmail•com>
Cc: Git <git@vger•kernel.org>
Subject: Re: [PATCH v6 00/17] Port branch.c to use ref-filter's printing options
Date: Tue, 17 May 2016 13:30:52 -0700	[thread overview]
Message-ID: <xmqqinycv343.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: CAOLa=ZQ-XwEhTRwoNhrBH=NCQhpsHR=PfgtDrfJs23j6hkBWRA@mail.gmail.com

Karthik Nayak <karthik.188@gmail•com> writes:

> Sorry for that.
> The only reason I haven't based it on 'master' is because it doesn't contain
> 'f307218'.
>
> ➔ git branch --contains=f307218
>   next
>   ref-filter

It is not clear from the above what your local ref-filter contains
beyond 'master', so it is not very useful to me when I am trying to
help you to avoid taking this topic hostage to all the topics in
'next' (if I queued this directly on 'next', I have to hold this
series until all the topics in 'next' graduates to 'master).

The series certainly would not apply to f307218 at all; it depends
on other stuff you have either in your local 'ref-filter' or 'next'.
It does not apply to the result of a merge of 'es/test-gpg-tags' topic 
into 'master', either, but the above does not make it clear what
else you are using from 'next' at all.

In any case, I think I managed to reduce the dependency on only
'es/test-gpg-tags' and 'master', and that is what I'll be queuing.
Please double check the patches in kn/ref-filter-branch-list topic
and also the merge of it into 'pu' for mismerges.

The difference between the result of merging the previously queued
one to 'pu', and the result of merging this round to 'pu', looks
like the attached.

Thanks.

 builtin/branch.c               |  2 +-
 ref-filter.c                   |  6 ++++--
 t/t6302-for-each-ref-filter.sh | 30 +++++++++++++++---------------
 3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 0bbb4de..2412738 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -293,7 +293,7 @@ static int calc_maxwidth(struct ref_array *refs, int remote_bonus)
 		skip_prefix(it->refname, "refs/remotes/", &desc);
 		if (it->kind == FILTER_REFS_DETACHED_HEAD) {
 			char *head_desc = get_head_description();
-			w = strlen(head_desc);
+			w = utf8_strwidth(head_desc);
 			free(head_desc);
 		} else
 			w = utf8_strwidth(desc);
diff --git a/ref-filter.c b/ref-filter.c
index 74c4869..f25671c 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1196,12 +1196,14 @@ char *get_head_description(void)
 		strbuf_addf(&desc, _("(no branch, bisect started on %s)"),
 			    state.branch);
 	else if (state.detached_from) {
-		/* TRANSLATORS: make sure these match _("HEAD detached at ")
-		   and _("HEAD detached from ") in wt-status.c */
 		if (state.detached_at)
+			/* TRANSLATORS: make sure this matches
+			   "HEAD detached at " in wt-status.c */
 			strbuf_addf(&desc, _("(HEAD detached at %s)"),
 				state.detached_from);
 		else
+			/* TRANSLATORS: make sure this matches
+			   "HEAD detached from " in wt-status.c */
 			strbuf_addf(&desc, _("(HEAD detached from %s)"),
 				state.detached_from);
 	}
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 331d978..a09a1a4 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -342,22 +342,22 @@ test_expect_success 'improper usage of %(if), %(then), %(else) and %(end) atoms'
 '
 
 test_expect_success 'check %(if)...%(then)...%(end) atoms' '
-	git for-each-ref --format="%(if)%(authorname)%(then)%(authorname): %(refname)%(end)" >actual &&
+	git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Author: %(authorname)%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	A U Thor: refs/heads/master
-	A U Thor: refs/heads/side
-	A U Thor: refs/odd/spot
-
-
-
-	A U Thor: refs/tags/foo1.10
-	A U Thor: refs/tags/foo1.3
-	A U Thor: refs/tags/foo1.6
-	A U Thor: refs/tags/four
-	A U Thor: refs/tags/one
-
-	A U Thor: refs/tags/three
-	A U Thor: refs/tags/two
+	refs/heads/master Author: A U Thor
+	refs/heads/side Author: A U Thor
+	refs/odd/spot Author: A U Thor
+	refs/tags/annotated-tag
+	refs/tags/doubly-annotated-tag
+	refs/tags/doubly-signed-tag
+	refs/tags/foo1.10 Author: A U Thor
+	refs/tags/foo1.3 Author: A U Thor
+	refs/tags/foo1.6 Author: A U Thor
+	refs/tags/four Author: A U Thor
+	refs/tags/one Author: A U Thor
+	refs/tags/signed-tag
+	refs/tags/three Author: A U Thor
+	refs/tags/two Author: A U Thor
 	EOF
 	test_cmp expect actual
 '

  reply	other threads:[~2016-05-17 20:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-15 10:45 [PATCH v6 00/17] Port branch.c to use ref-filter's printing options Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 01/17] ref-filter: implement %(if), %(then), and %(else) atoms Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 02/17] ref-filter: include reference to 'used_atom' within 'atom_value' Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 03/17] ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>) Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 04/17] ref-filter: modify "%(objectname:short)" to take length Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 05/17] ref-filter: move get_head_description() from branch.c Karthik Nayak
2016-05-17 19:59   ` Junio C Hamano
2016-05-20 14:20     ` Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 06/17] ref-filter: introduce format_ref_array_item() Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 07/17] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 08/17] ref-filter: add support for %(upstream:track,nobracket) Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 09/17] ref-filter: make "%(symref)" atom work with the ':short' modifier Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 10/17] ref-filter: introduce refname_atom_parser_internal() Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 11/17] ref-filter: introduce symref_atom_parser() and refname_atom_parser() Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 12/17] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal() Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 14/17] ref-filter: allow porcelain to translate messages in the output Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 15/17] branch, tag: use porcelain output Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 16/17] branch: use ref-filter printing APIs Karthik Nayak
2016-05-15 10:45 ` [PATCH v6 17/17] branch: implement '--format' option Karthik Nayak
2016-05-16 22:12 ` [PATCH v6 00/17] Port branch.c to use ref-filter's printing options Junio C Hamano
2016-05-17  8:04   ` Karthik Nayak
2016-05-17 17:52     ` Junio C Hamano
2016-05-17 19:02       ` Karthik Nayak
2016-05-17 20:30         ` Junio C Hamano [this message]
2016-05-18 10:45           ` Karthik Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqinycv343.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=karthik.188@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox