{"thread":{"id":"5277","subject":"[PATCH 28/28] makes upload_pack void","startedAt":"2006-08-14T20:40:51Z","lastAt":"2006-08-14T23:03:27Z","messageCount":4,"participants":["David Rientjes","Nikolai Weibull"],"isPatch":true,"patchVersion":1,"patchTotal":28},"messages":[{"id":"25309","messageId":"Pine.LNX.4.63.0608141340060.19383@chino.corp.google.com","threadId":"5277","inReplyTo":null,"subject":"[PATCH 28/28] makes upload_pack void","fromName":"David Rientjes","fromEmail":"rientjes@google.com","sentAt":"2006-08-14T20:40:51Z","receivedAt":"2006-08-14T20:40:51Z","isPatch":true,"sender":{"key":"rientjes@google.com","avatar":null},"body":"Makes upload_pack void and removes conditional return.\n\n\t\tDavid\n\nSigned-off-by: David Rientjes <rientjes@google.com>\n---\n upload-pack.c |   11 +++++------\n 1 files changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/upload-pack.c b/upload-pack.c\nindex bbd6bd6..27e2abe 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -459,18 +459,17 @@ static int send_ref(const char *refname,\n \treturn 0;\n }\n \n-static int upload_pack(void)\n+static void upload_pack(void)\n {\n \treset_timeout();\n \thead_ref(send_ref);\n \tfor_each_ref(send_ref);\n \tpacket_flush(1);\n \treceive_needs();\n-\tif (!want_obj.nr)\n-\t\treturn 0;\n-\tget_common_commits();\n-\tcreate_pack_file();\n-\treturn 0;\n+\tif (want_obj.nr) {\n+\t\tget_common_commits();\n+\t\tcreate_pack_file();\n+\t}\n }\n \n int main(int argc, char **argv)\n-- \n1.4.2.g89bb-dirty\n"},{"id":"25317","messageId":"dbfc82860608141545s3e75457eo4be1201395e24354@mail.gmail.com","threadId":"5277","inReplyTo":"Pine.LNX.4.63.0608141340060.19383@chino.corp.google.com","subject":"Re: [PATCH 28/28] makes upload_pack void","fromName":"Nikolai Weibull","fromEmail":"now@bitwi.se","sentAt":"2006-08-14T22:45:20Z","receivedAt":"2006-08-14T22:45:20Z","isPatch":true,"sender":{"key":"now@bitwi.se","avatar":"https://gravatar.com/avatar/d9242f067845cf9a72be23e4213c3b6e53492178e5df97372088a441af846133?d=mp&s=160"},"body":"On 8/14/06, David Rientjes <rientjes@google.com> wrote:\n> Makes upload_pack void and removes conditional return.\n\n> -static int upload_pack(void)\n> +static void upload_pack(void)\n\nI don't know for sure, but I'm guessing the intention was to be able\nto return a failing code /if/ there ever was a condition where\nupload_pack() would fail, e.g., if send_ref() would return a status\ncode instead of die():ing if it can't parse the given sha1.  In a\nfuture libification, the change of return type may have to be\nreverted.\n\n  nikolai\n"},{"id":"25318","messageId":"Pine.LNX.4.63.0608141549150.21515@chino.corp.google.com","threadId":"5277","inReplyTo":"dbfc82860608141545s3e75457eo4be1201395e24354@mail.gmail.com","subject":"Re: [PATCH 28/28] makes upload_pack void","fromName":"David Rientjes","fromEmail":"rientjes@google.com","sentAt":"2006-08-14T22:51:01Z","receivedAt":"2006-08-14T22:51:01Z","isPatch":true,"sender":{"key":"rientjes@google.com","avatar":null},"body":"On Tue, 15 Aug 2006, Nikolai Weibull wrote:\n> I don't know for sure, but I'm guessing the intention was to be able\n> to return a failing code /if/ there ever was a condition where\n> upload_pack() would fail, e.g., if send_ref() would return a status\n> code instead of die():ing if it can't parse the given sha1.  In a\n> future libification, the change of return type may have to be\n> reverted.\n> \n\nOf course.\n\nIf upload_pack were modified to return an error code based on a specific code \npath, I trust the implementer would know how to change void to int.\n\n\t\tDavid\n"},{"id":"25320","messageId":"dbfc82860608141603y64737257n85cc169a6f58ff7e@mail.gmail.com","threadId":"5277","inReplyTo":"Pine.LNX.4.63.0608141549150.21515@chino.corp.google.com","subject":"Re: [PATCH 28/28] makes upload_pack void","fromName":"Nikolai Weibull","fromEmail":"now@bitwi.se","sentAt":"2006-08-14T23:03:27Z","receivedAt":"2006-08-14T23:03:27Z","isPatch":true,"sender":{"key":"now@bitwi.se","avatar":"https://gravatar.com/avatar/d9242f067845cf9a72be23e4213c3b6e53492178e5df97372088a441af846133?d=mp&s=160"},"body":"On 8/15/06, David Rientjes <rientjes@google.com> wrote:\n> On Tue, 15 Aug 2006, Nikolai Weibull wrote:\n> > I don't know for sure, but I'm guessing the intention was to be able\n> > to return a failing code /if/ there ever was a condition where\n> > upload_pack() would fail, e.g., if send_ref() would return a status\n> > code instead of die():ing if it can't parse the given sha1.  In a\n> > future libification, the change of return type may have to be\n> > reverted.\n\n> Of course.\n>\n> If upload_pack were modified to return an error code based on a specific code\n> path, I trust the implementer would know how to change void to int.\n\nSo do I.  However, I trust that whoever implemented send_ref() knew\nabout void.  (See how easy it was to do what you did but the other way\naround?)\n\nIt was just a comment.  I don't have anything against the patch as such.\n\n  nikolai\n"}]}