git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fetch-pack: show clearer error message upon ERR
@ 2017-04-10 21:05 Jonathan Tan
  2017-04-11 21:47 ` Jonathan Nieder
  2017-04-12 18:06 ` [PATCH v2] " Jonathan Tan
  0 siblings, 2 replies; 8+ messages in thread
From: Jonathan Tan @ 2017-04-10 21:05 UTC (permalink / raw)
  To: git; +Cc: Jonathan Tan

Currently, fetch-pack prints a confusing error message ("expected
ACK/NAK") when the server it's communicating with sends a pkt-line
starting with "ERR".  Replace it with a less confusing error message.

(Git will send "ERR" lines when a "want" line references an object that
it does not have. This is uncommon, but can happen if a repository is
garbage-collected during a negotiation.)

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---

This situation has been noticed occasionally in my company - this is a
small change that would make the situation slightly easier to
understand.

 fetch-pack.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fetch-pack.c b/fetch-pack.c
index d07d85ce3..688523bfd 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -276,6 +276,8 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
 			return ACK;
 		}
 	}
+	if (skip_prefix(line, "ERR ", &arg))
+		die(_("git fetch-pack: got remote error '%s'"), arg);
 	die(_("git fetch-pack: expected ACK/NAK, got '%s'"), line);
 }
 
-- 
2.12.2.715.g7642488e1d-goog


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

end of thread, other threads:[~2017-04-18  4:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-10 21:05 [PATCH] fetch-pack: show clearer error message upon ERR Jonathan Tan
2017-04-11 21:47 ` Jonathan Nieder
2017-04-12 18:27   ` Jonathan Tan
2017-04-12 18:06 ` [PATCH v2] " Jonathan Tan
2017-04-17 17:49   ` Jonathan Tan
2017-04-18  1:48     ` Junio C Hamano
2017-04-18  4:50     ` Junio C Hamano
2017-04-17 22:56   ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).