{"thread":{"id":"12484","subject":"[PATCH] Fix 'git remote show' regression on empty repository in 1.5.4","startedAt":"2008-03-04T06:00:36Z","lastAt":"2008-03-04T08:37:28Z","messageCount":2,"participants":["Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"70892","messageId":"20080304060036.GA17106@spearce.org","threadId":"12484","inReplyTo":null,"subject":"[PATCH] Fix 'git remote show' regression on empty repository in 1.5.4","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-03-04T06:00:36Z","receivedAt":"2008-03-04T06:00:36Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Back in 18f7c51c we switched git-ls-remote/git-peek-remote to\nuse the transport backend, rather than do everything itself.\n\nAs part of that switch we started to produce a non-zero exit\nstatus if no refs were received from the remote peer, which\nhappens when the remote peer has no commits pushed to it yet.\n(E.g. \"git --git-dir=foo.git init; git ls-remote foo.git\")\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n This patch is built against `maint`.\n\n It will cause a merge conflict against `master` as there is a\n change there to invoke transport_disconnect(transport) before\n displaying the refs.\n\n Since the disconnect patch is not in maint, but this is a current\n regression in 1.5.4.3, I'm sending you a conflicting patch.  :)\n\n As far as resolving this when it merges to master, the return value\n of transport_disconnect() is probably what should be checked to\n signal a non-zero exit status to the caller, not the empty ref list.\n\n builtin-ls-remote.c |    4 ----\n 1 files changed, 0 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-ls-remote.c b/builtin-ls-remote.c\nindex 6dd31d1..720280e 100644\n--- a/builtin-ls-remote.c\n+++ b/builtin-ls-remote.c\n@@ -94,10 +94,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)\n \t\ttransport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);\n \n \tref = transport_get_remote_refs(transport);\n-\n-\tif (!ref)\n-\t\treturn 1;\n"},{"id":"70908","messageId":"7vd4qaanqv.fsf@gitster.siamese.dyndns.org","threadId":"12484","inReplyTo":"20080304060036.GA17106@spearce.org","subject":"Re: [PATCH] Fix 'git remote show' regression on empty repository in 1.5.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-04T08:37:28Z","receivedAt":"2008-03-04T08:37:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n>  It will cause a merge conflict against `master` as there is a\n>  change there to invoke transport_disconnect(transport) before\n>  displaying the refs.\n>\n>  Since the disconnect patch is not in maint, but this is a current\n>  regression in 1.5.4.3, I'm sending you a conflicting patch.  :)\n\nThat's perfectly fine.  Merging is what maintainers do.\n\n"}]}