{"thread":{"id":"22835","subject":"[PATCH 0/3] ld/push-porcelain","startedAt":"2010-02-26T20:44:16Z","lastAt":"2010-02-27T04:01:30Z","messageCount":6,"participants":["Larry D'Anna","Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"135772","messageId":"cover.1267216808.git.larry@elder-gods.org","threadId":"22835","inReplyTo":null,"subject":"[PATCH 0/3] ld/push-porcelain","fromName":"Larry D'Anna","fromEmail":"larry@elder-gods.org","sentAt":"2010-02-26T20:44:16Z","receivedAt":"2010-02-26T20:44:16Z","isPatch":true,"sender":{"key":"larry@elder-gods.org","avatar":"https://avatars.githubusercontent.com/u/3013304?v=4"},"body":"Changes since last version:\n\n* removed git-push: squelch advice message if in --porcelain mode\n* chaned \"error message\" to \"advice message\" in commit subject\n\nLarry D'Anna (3):\n  git-push: fix an advice message so it goes to stderr\n  git-push: send \"To <remoteurl>\" messages to the standard output in\n    --porcelain mode\n  git-push: make git push --dry-run --porcelain exit with status 0 even\n    if updates will be rejected\n\n builtin-push.c      |    6 +++---\n builtin-send-pack.c |    4 ++++\n send-pack.h         |    1 +\n transport.c         |    6 ++++--\n 4 files changed, 12 insertions(+), 5 deletions(-)\n"},{"id":"135773","messageId":"68fd39ac6602471919939a84168be62f1fe464f7.1267216808.git.larry@elder-gods.org","threadId":"22835","inReplyTo":"cover.1267216808.git.larry@elder-gods.org","subject":"[PATCH 1/3] git-push: fix an advice message so it goes to stderr","fromName":"Larry D'Anna","fromEmail":"larry@elder-gods.org","sentAt":"2010-02-26T20:44:17Z","receivedAt":"2010-02-26T20:44:17Z","isPatch":true,"sender":{"key":"larry@elder-gods.org","avatar":"https://avatars.githubusercontent.com/u/3013304?v=4"},"body":"These sort of messages typically go to the standard error.\n\nSigned-off-by: Larry D'Anna <larry@elder-gods.org>\n---\n builtin-push.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 5633f0a..0a27072 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -124,9 +124,9 @@ static int push_with_options(struct transport *transport, int flags)\n \t\treturn 0;\n \n \tif (nonfastforward && advice_push_nonfastforward) {\n-\t\tprintf(\"To prevent you from losing history, non-fast-forward updates were rejected\\n\"\n-\t\t       \"Merge the remote changes before pushing again.  See the 'Note about\\n\"\n-\t\t       \"fast-forwards' section of 'git push --help' for details.\\n\");\n+\t\tfprintf(stderr, \"To prevent you from losing history, non-fast-forward updates were rejected\\n\"\n+\t\t\t\t\"Merge the remote changes before pushing again.  See the 'Note about\\n\"\n+\t\t\t\t\"fast-forwards' section of 'git push --help' for details.\\n\");\n \t}\n \n \treturn 1;\n-- \n1.7.0.rc2.40.g7d8aa\n"},{"id":"135775","messageId":"0ecbc2ed26f4fe0a253bd34f94ffae8f71f81aea.1267216808.git.larry@elder-gods.org","threadId":"22835","inReplyTo":"cover.1267216808.git.larry@elder-gods.org","subject":"[PATCH 2/3] git-push: send \"To <remoteurl>\" messages to the standard output in --porcelain mode","fromName":"Larry D'Anna","fromEmail":"larry@elder-gods.org","sentAt":"2010-02-26T20:44:18Z","receivedAt":"2010-02-26T20:44:18Z","isPatch":true,"sender":{"key":"larry@elder-gods.org","avatar":"https://avatars.githubusercontent.com/u/3013304?v=4"},"body":"git-push prints the line \"To <remoteurl>\" before above each of the ref status\nlines.  In --porcelain mode, these \"To <remoteurl>\" lines go to the standard\nerror, but the ref status lines go to the standard output.  This makes it\ndifficult for the process reading standard output to know which ref status lines\ncorrespond to which remote.  This patch sends the \"To <remoteurl>\" lines to the\nthe standard output instead.\n\nSigned-off-by: Larry D'Anna <larry@elder-gods.org>\n---\n transport.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 08e4fa0..32885f7 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -675,7 +675,7 @@ static void print_ok_ref_status(struct ref *ref, int porcelain)\n static int print_one_push_status(struct ref *ref, const char *dest, int count, int porcelain)\n {\n \tif (!count)\n-\t\tfprintf(stderr, \"To %s\\n\", dest);\n+\t\tfprintf(porcelain ? stdout : stderr, \"To %s\\n\", dest);\n \n \tswitch(ref->status) {\n \tcase REF_STATUS_NONE:\n-- \n1.7.0.rc2.40.g7d8aa\n"},{"id":"135774","messageId":"6d253d15b5174c3982bcc434b7c2b361712d20cb.1267216808.git.larry@elder-gods.org","threadId":"22835","inReplyTo":"cover.1267216808.git.larry@elder-gods.org","subject":"[PATCH 3/3] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected","fromName":"Larry D'Anna","fromEmail":"larry@elder-gods.org","sentAt":"2010-02-26T20:44:19Z","receivedAt":"2010-02-26T20:44:19Z","isPatch":true,"sender":{"key":"larry@elder-gods.org","avatar":"https://avatars.githubusercontent.com/u/3013304?v=4"},"body":"The script calling git push --dry-run --porcelain can see clearly from the\noutput that the updates will be rejected.  However, it will probably need to\ndistinguish this condition from the push failing for other reasons, such as the\nremote not being reachable.\n\nSigned-off-by: Larry D'Anna <larry@elder-gods.org>\n---\n builtin-send-pack.c |    4 ++++\n send-pack.h         |    1 +\n transport.c         |    4 +++-\n 3 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-send-pack.c b/builtin-send-pack.c\nindex 2183a47..2bf3d43 100644\n--- a/builtin-send-pack.c\n+++ b/builtin-send-pack.c\n@@ -510,6 +510,10 @@ int send_pack(struct send_pack_args *args,\n \n \tif (ret < 0)\n \t\treturn ret;\n+\n+\tif (args->porcelain && args->dry_run)\n+\t\treturn 0;\n+\n \tfor (ref = remote_refs; ref; ref = ref->next) {\n \t\tswitch (ref->status) {\n \t\tcase REF_STATUS_NONE:\ndiff --git a/send-pack.h b/send-pack.h\nindex 28141ac..60b4ba6 100644\n--- a/send-pack.h\n+++ b/send-pack.h\n@@ -4,6 +4,7 @@\n struct send_pack_args {\n \tunsigned verbose:1,\n \t\tquiet:1,\n+\t\tporcelain:1,\n \t\tsend_mirror:1,\n \t\tforce_update:1,\n \t\tuse_thin_pack:1,\ndiff --git a/transport.c b/transport.c\nindex 32885f7..8291621 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -791,6 +791,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re\n \targs.verbose = !!(flags & TRANSPORT_PUSH_VERBOSE);\n \targs.quiet = !!(flags & TRANSPORT_PUSH_QUIET);\n \targs.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN);\n+\targs.porcelain = !!(flags & TRANSPORT_PUSH_PORCELAIN);\n \n \tret = send_pack(&args, data->fd, data->conn, remote_refs,\n \t\t\t&data->extra_have);\n@@ -1055,7 +1056,8 @@ int transport_push(struct transport *transport,\n \t\tret = transport->push_refs(transport, remote_refs, flags);\n \t\terr = push_had_errors(remote_refs);\n \n-\t\tret |= err;\n+\t\tif ( !(pretend && porcelain) )\n+\t\t\tret |= err;\n \n \t\tif (!quiet || err)\n \t\t\tprint_push_status(transport->url, remote_refs,\n-- \n1.7.0.rc2.40.g7d8aa\n"},{"id":"135792","messageId":"be6fef0d1002261844u5082b5bv90d46852218f632e@mail.gmail.com","threadId":"22835","inReplyTo":"6d253d15b5174c3982bcc434b7c2b361712d20cb.1267216808.git.larry@elder-gods.org","subject":"Re: [PATCH 3/3] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-27T02:44:14Z","receivedAt":"2010-02-27T02:44:14Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sat, Feb 27, 2010 at 4:44 AM, Larry D'Anna <larry@elder-gods.org> wrote:\n> The script calling git push --dry-run --porcelain can see clearly from the\n> output that the updates will be rejected.  However, it will probably need to\n> distinguish this condition from the push failing for other reasons, such as the\n> remote not being reachable.\n>\n> Signed-off-by: Larry D'Anna <larry@elder-gods.org>\n\nI thought that in the previous iteration, the status won't be touched\nanymore? You agreed too:\n\n  <20100210055529.GA1566@cthulhu>\n\n-- \nCheers,\nRay Chuan\n"},{"id":"135801","messageId":"20100227040130.GA11517@cthulhu","threadId":"22835","inReplyTo":"be6fef0d1002261844u5082b5bv90d46852218f632e@mail.gmail.com","subject":"Re: [PATCH 3/3] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected","fromName":"Larry D'Anna","fromEmail":"larry@elder-gods.org","sentAt":"2010-02-27T04:01:30Z","receivedAt":"2010-02-27T04:01:30Z","isPatch":true,"sender":{"key":"larry@elder-gods.org","avatar":"https://avatars.githubusercontent.com/u/3013304?v=4"},"body":"* Tay Ray Chuan (rctay89@gmail.com) [100226 21:44]:\n> Hi,\n> \n> On Sat, Feb 27, 2010 at 4:44 AM, Larry D'Anna <larry@elder-gods.org> wrote:\n> > The script calling git push --dry-run --porcelain can see clearly from the\n> > output that the updates will be rejected.  However, it will probably need to\n> > distinguish this condition from the push failing for other reasons, such as the\n> > remote not being reachable.\n> >\n> > Signed-off-by: Larry D'Anna <larry@elder-gods.org>\n> \n> I thought that in the previous iteration, the status won't be touched\n> anymore? You agreed too:\n> \n>   <20100210055529.GA1566@cthulhu>\n\nfixed.\n\n        --larry\n"}]}