All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bundle: Fix "verify" output if history is complete
@ 2013-03-07  0:56 Lukas Fleischer
  2013-03-07  0:56 ` [PATCH 2/2] bundle: Add colons to list headings in "verify" Lukas Fleischer
  2013-03-08 18:01 ` [PATCH v2] " Lukas Fleischer
  0 siblings, 2 replies; 4+ messages in thread
From: Lukas Fleischer @ 2013-03-07  0:56 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin, Lukas Fleischer

A more informative message for "complete" bundles was added in commit
8c3710fd. However, the prerequisites ref list is currently read *after*
we check if it equals zero, which means we never actually print the
newly introduced message.

Move the code that reads the prerequisites ref list before the check to
fix this.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
---
I am not sure whether we should add a test case for such a simple "bug".
If you think we should, just let me know and I will add one.

 bundle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bundle.c b/bundle.c
index 8d12816..65db53b 100644
--- a/bundle.c
+++ b/bundle.c
@@ -188,10 +188,10 @@ int verify_bundle(struct bundle_header *header, int verbose)
 			     r->nr),
 			  r->nr);
 		list_refs(r, 0, NULL);
+		r = &header->prerequisites;
 		if (!r->nr) {
 			printf_ln(_("The bundle records a complete history."));
 		} else {
-			r = &header->prerequisites;
 			printf_ln(Q_("The bundle requires this ref",
 				     "The bundle requires these %d refs",
 				     r->nr),
-- 
1.8.2.rc2.352.g908df73

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] bundle: Add colons to list headings in "verify"
  2013-03-07  0:56 [PATCH 1/2] bundle: Fix "verify" output if history is complete Lukas Fleischer
@ 2013-03-07  0:56 ` Lukas Fleischer
  2013-03-07 21:38   ` Junio C Hamano
  2013-03-08 18:01 ` [PATCH v2] " Lukas Fleischer
  1 sibling, 1 reply; 4+ messages in thread
From: Lukas Fleischer @ 2013-03-07  0:56 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin, Lukas Fleischer

These slightly improve the reading flow by making it obvious that a list
follows.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
---
 bundle.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bundle.c b/bundle.c
index 65db53b..8cd8b4f 100644
--- a/bundle.c
+++ b/bundle.c
@@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose)
 		struct ref_list *r;
 
 		r = &header->references;
-		printf_ln(Q_("The bundle contains %d ref",
-			     "The bundle contains %d refs",
+		printf_ln(Q_("The bundle contains %d ref:",
+			     "The bundle contains %d refs:",
 			     r->nr),
 			  r->nr);
 		list_refs(r, 0, NULL);
@@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose)
 		if (!r->nr) {
 			printf_ln(_("The bundle records a complete history."));
 		} else {
-			printf_ln(Q_("The bundle requires this ref",
-				     "The bundle requires these %d refs",
+			printf_ln(Q_("The bundle requires this ref:",
+				     "The bundle requires these %d refs:",
 				     r->nr),
 				  r->nr);
 			list_refs(r, 0, NULL);
-- 
1.8.2.rc2.352.g908df73

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] bundle: Add colons to list headings in "verify"
  2013-03-07  0:56 ` [PATCH 2/2] bundle: Add colons to list headings in "verify" Lukas Fleischer
@ 2013-03-07 21:38   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2013-03-07 21:38 UTC (permalink / raw)
  To: Lukas Fleischer; +Cc: git, Johannes Schindelin

Lukas Fleischer <git@cryptocrack.de> writes:

> These slightly improve the reading flow by making it obvious that a list
> follows.
>
> Signed-off-by: Lukas Fleischer <git@cryptocrack.de>

Perhaps.

The earlier message says "contains X ref(s)" while the later one
says "requires this/these X ref(s)".  Do we want to make them
consistent, too?

> ---
>  bundle.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/bundle.c b/bundle.c
> index 65db53b..8cd8b4f 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose)
>  		struct ref_list *r;
>  
>  		r = &header->references;
> -		printf_ln(Q_("The bundle contains %d ref",
> -			     "The bundle contains %d refs",
> +		printf_ln(Q_("The bundle contains %d ref:",
> +			     "The bundle contains %d refs:",
>  			     r->nr),
>  			  r->nr);
>  		list_refs(r, 0, NULL);
> @@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose)
>  		if (!r->nr) {
>  			printf_ln(_("The bundle records a complete history."));
>  		} else {
> -			printf_ln(Q_("The bundle requires this ref",
> -				     "The bundle requires these %d refs",
> +			printf_ln(Q_("The bundle requires this ref:",
> +				     "The bundle requires these %d refs:",
>  				     r->nr),
>  				  r->nr);
>  			list_refs(r, 0, NULL);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] bundle: Add colons to list headings in "verify"
  2013-03-07  0:56 [PATCH 1/2] bundle: Fix "verify" output if history is complete Lukas Fleischer
  2013-03-07  0:56 ` [PATCH 2/2] bundle: Add colons to list headings in "verify" Lukas Fleischer
@ 2013-03-08 18:01 ` Lukas Fleischer
  1 sibling, 0 replies; 4+ messages in thread
From: Lukas Fleischer @ 2013-03-08 18:01 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin, Lukas Fleischer

These slightly improve the reading flow by making it obvious that a list
follows.

Also, make the wording of both headings consistent by changing "contains
%d ref(s)" to "contains this ref"/"contains these %d refs".

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
---
 bundle.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bundle.c b/bundle.c
index 65db53b..6210a6b 100644
--- a/bundle.c
+++ b/bundle.c
@@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose)
 		struct ref_list *r;
 
 		r = &header->references;
-		printf_ln(Q_("The bundle contains %d ref",
-			     "The bundle contains %d refs",
+		printf_ln(Q_("The bundle contains this ref:",
+			     "The bundle contains these %d refs:",
 			     r->nr),
 			  r->nr);
 		list_refs(r, 0, NULL);
@@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose)
 		if (!r->nr) {
 			printf_ln(_("The bundle records a complete history."));
 		} else {
-			printf_ln(Q_("The bundle requires this ref",
-				     "The bundle requires these %d refs",
+			printf_ln(Q_("The bundle requires this ref:",
+				     "The bundle requires these %d refs:",
 				     r->nr),
 				  r->nr);
 			list_refs(r, 0, NULL);
-- 
1.8.2.rc2.352.g908df73

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-08 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07  0:56 [PATCH 1/2] bundle: Fix "verify" output if history is complete Lukas Fleischer
2013-03-07  0:56 ` [PATCH 2/2] bundle: Add colons to list headings in "verify" Lukas Fleischer
2013-03-07 21:38   ` Junio C Hamano
2013-03-08 18:01 ` [PATCH v2] " Lukas Fleischer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.