{"thread":{"id":"33095","subject":"[PATCH 1/2] bundle: Fix \"verify\" output if history is complete","startedAt":"2013-03-07T00:56:35Z","lastAt":"2013-03-08T18:01:26Z","messageCount":4,"participants":["Lukas Fleischer","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"210743","messageId":"1362617796-4120-1-git-send-email-git@cryptocrack.de","threadId":"33095","inReplyTo":null,"subject":"[PATCH 1/2] bundle: Fix \"verify\" output if history is complete","fromName":"Lukas Fleischer","fromEmail":"git@cryptocrack.de","sentAt":"2013-03-07T00:56:35Z","receivedAt":"2013-03-07T00:56:35Z","isPatch":true,"sender":{"key":"git@cryptocrack.de","avatar":null},"body":"A more informative message for \"complete\" bundles was added in commit\n8c3710fd. However, the prerequisites ref list is currently read *after*\nwe check if it equals zero, which means we never actually print the\nnewly introduced message.\n\nMove the code that reads the prerequisites ref list before the check to\nfix this.\n\nSigned-off-by: Lukas Fleischer <git@cryptocrack.de>\n---\nI am not sure whether we should add a test case for such a simple \"bug\".\nIf you think we should, just let me know and I will add one.\n\n bundle.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/bundle.c b/bundle.c\nindex 8d12816..65db53b 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -188,10 +188,10 @@ int verify_bundle(struct bundle_header *header, int verbose)\n \t\t\t     r->nr),\n \t\t\t  r->nr);\n \t\tlist_refs(r, 0, NULL);\n+\t\tr = &header->prerequisites;\n \t\tif (!r->nr) {\n \t\t\tprintf_ln(_(\"The bundle records a complete history.\"));\n \t\t} else {\n-\t\t\tr = &header->prerequisites;\n \t\t\tprintf_ln(Q_(\"The bundle requires this ref\",\n \t\t\t\t     \"The bundle requires these %d refs\",\n \t\t\t\t     r->nr),\n-- \n1.8.2.rc2.352.g908df73\n"},{"id":"210744","messageId":"1362617796-4120-2-git-send-email-git@cryptocrack.de","threadId":"33095","inReplyTo":"1362617796-4120-1-git-send-email-git@cryptocrack.de","subject":"[PATCH 2/2] bundle: Add colons to list headings in \"verify\"","fromName":"Lukas Fleischer","fromEmail":"git@cryptocrack.de","sentAt":"2013-03-07T00:56:36Z","receivedAt":"2013-03-07T00:56:36Z","isPatch":true,"sender":{"key":"git@cryptocrack.de","avatar":null},"body":"These slightly improve the reading flow by making it obvious that a list\nfollows.\n\nSigned-off-by: Lukas Fleischer <git@cryptocrack.de>\n---\n bundle.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/bundle.c b/bundle.c\nindex 65db53b..8cd8b4f 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose)\n \t\tstruct ref_list *r;\n \n \t\tr = &header->references;\n-\t\tprintf_ln(Q_(\"The bundle contains %d ref\",\n-\t\t\t     \"The bundle contains %d refs\",\n+\t\tprintf_ln(Q_(\"The bundle contains %d ref:\",\n+\t\t\t     \"The bundle contains %d refs:\",\n \t\t\t     r->nr),\n \t\t\t  r->nr);\n \t\tlist_refs(r, 0, NULL);\n@@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose)\n \t\tif (!r->nr) {\n \t\t\tprintf_ln(_(\"The bundle records a complete history.\"));\n \t\t} else {\n-\t\t\tprintf_ln(Q_(\"The bundle requires this ref\",\n-\t\t\t\t     \"The bundle requires these %d refs\",\n+\t\t\tprintf_ln(Q_(\"The bundle requires this ref:\",\n+\t\t\t\t     \"The bundle requires these %d refs:\",\n \t\t\t\t     r->nr),\n \t\t\t\t  r->nr);\n \t\t\tlist_refs(r, 0, NULL);\n-- \n1.8.2.rc2.352.g908df73\n"},{"id":"210788","messageId":"7vvc92lwkr.fsf@alter.siamese.dyndns.org","threadId":"33095","inReplyTo":"1362617796-4120-2-git-send-email-git@cryptocrack.de","subject":"Re: [PATCH 2/2] bundle: Add colons to list headings in \"verify\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-07T21:38:28Z","receivedAt":"2013-03-07T21:38:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lukas Fleischer <git@cryptocrack.de> writes:\n\n> These slightly improve the reading flow by making it obvious that a list\n> follows.\n>\n> Signed-off-by: Lukas Fleischer <git@cryptocrack.de>\n\nPerhaps.\n\nThe earlier message says \"contains X ref(s)\" while the later one\nsays \"requires this/these X ref(s)\".  Do we want to make them\nconsistent, too?\n\n> ---\n>  bundle.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/bundle.c b/bundle.c\n> index 65db53b..8cd8b4f 100644\n> --- a/bundle.c\n> +++ b/bundle.c\n> @@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose)\n>  \t\tstruct ref_list *r;\n>  \n>  \t\tr = &header->references;\n> -\t\tprintf_ln(Q_(\"The bundle contains %d ref\",\n> -\t\t\t     \"The bundle contains %d refs\",\n> +\t\tprintf_ln(Q_(\"The bundle contains %d ref:\",\n> +\t\t\t     \"The bundle contains %d refs:\",\n>  \t\t\t     r->nr),\n>  \t\t\t  r->nr);\n>  \t\tlist_refs(r, 0, NULL);\n> @@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose)\n>  \t\tif (!r->nr) {\n>  \t\t\tprintf_ln(_(\"The bundle records a complete history.\"));\n>  \t\t} else {\n> -\t\t\tprintf_ln(Q_(\"The bundle requires this ref\",\n> -\t\t\t\t     \"The bundle requires these %d refs\",\n> +\t\t\tprintf_ln(Q_(\"The bundle requires this ref:\",\n> +\t\t\t\t     \"The bundle requires these %d refs:\",\n>  \t\t\t\t     r->nr),\n>  \t\t\t\t  r->nr);\n>  \t\t\tlist_refs(r, 0, NULL);\n"},{"id":"210845","messageId":"1362765686-18396-1-git-send-email-git@cryptocrack.de","threadId":"33095","inReplyTo":"1362617796-4120-1-git-send-email-git@cryptocrack.de","subject":"[PATCH v2] bundle: Add colons to list headings in \"verify\"","fromName":"Lukas Fleischer","fromEmail":"git@cryptocrack.de","sentAt":"2013-03-08T18:01:26Z","receivedAt":"2013-03-08T18:01:26Z","isPatch":true,"sender":{"key":"git@cryptocrack.de","avatar":null},"body":"These slightly improve the reading flow by making it obvious that a list\nfollows.\n\nAlso, make the wording of both headings consistent by changing \"contains\n%d ref(s)\" to \"contains this ref\"/\"contains these %d refs\".\n\nSigned-off-by: Lukas Fleischer <git@cryptocrack.de>\n---\n bundle.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/bundle.c b/bundle.c\nindex 65db53b..6210a6b 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose)\n \t\tstruct ref_list *r;\n \n \t\tr = &header->references;\n-\t\tprintf_ln(Q_(\"The bundle contains %d ref\",\n-\t\t\t     \"The bundle contains %d refs\",\n+\t\tprintf_ln(Q_(\"The bundle contains this ref:\",\n+\t\t\t     \"The bundle contains these %d refs:\",\n \t\t\t     r->nr),\n \t\t\t  r->nr);\n \t\tlist_refs(r, 0, NULL);\n@@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose)\n \t\tif (!r->nr) {\n \t\t\tprintf_ln(_(\"The bundle records a complete history.\"));\n \t\t} else {\n-\t\t\tprintf_ln(Q_(\"The bundle requires this ref\",\n-\t\t\t\t     \"The bundle requires these %d refs\",\n+\t\t\tprintf_ln(Q_(\"The bundle requires this ref:\",\n+\t\t\t\t     \"The bundle requires these %d refs:\",\n \t\t\t\t     r->nr),\n \t\t\t\t  r->nr);\n \t\t\tlist_refs(r, 0, NULL);\n-- \n1.8.2.rc2.352.g908df73\n"}]}