# [PATCH] fast-export: report SHA-1 instead of gibberish when marks

3 messages from 2012-06-12 to 2012-06-12. Participants: Max Horn, Junio C Hamano.
Thread: https://gitlist.dev/t/30778

## Max Horn, 2012-06-12 13:45

Subject: [PATCH] fast-export: report SHA-1 instead of gibberish when marks
Message-ID: <1339508716-51880-1-git-send-email-max@quendi.de>
URL: https://gitlist.dev/e/1339508716-51880-1-git-send-email-max%40quendi.de

```

This patch should be a fairly obvious bug fix. Just yesterday I run into
it, when testing some buggy code that lead to this error message being
triggered; the results was lots of unreadable binary gibberish
filling my terminal.

While I did not author this commit, I asked its author for (and received)
permission to submit it here. Hopefully this can be included in mainline git
(this would ease work on git-remote-hg a bit ;).

```

## Max Horn, 2012-06-12 13:45

Subject: [PATCH] fast-export: report SHA-1 instead of gibberish when marks exist already
Message-ID: <1339508716-51880-2-git-send-email-max@quendi.de>
URL: https://gitlist.dev/e/1339508716-51880-2-git-send-email-max%40quendi.de
In-Reply-To: <1339508716-51880-1-git-send-email-max@quendi.de>

```
From: Johannes Schindelin <johannes.schindelin@gmx.de>

Cc: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Max Horn <max@quendi.de>
---
 builtin/fast-export.c |    2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 19509ea..ef7c012 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -610,7 +610,7 @@ static void import_marks(char *input_file)
 			die ("Could not read blob %s", sha1_to_hex(sha1));
 
 		if (object->flags & SHOWN)
-			error("Object %s already has a mark", sha1);
+			error("Object %s already has a mark", sha1_to_hex(sha1));
 
 		mark_object(object, mark);
 		if (last_idnum < mark)
-- 
1.7.10.4

```

## Junio C Hamano, 2012-06-12 14:26

Subject: Re: [PATCH] fast-export: report SHA-1 instead of gibberish when marks exist already
Message-ID: <7vtxyg4ndd.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vtxyg4ndd.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1339508716-51880-2-git-send-email-max@quendi.de>

```
Max Horn <max@quendi.de> writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> Cc: Pieter de Bie <pdebie@ai.rug.nl>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Max Horn <max@quendi.de>
> ---

Thanks, both.  Applied.

>  builtin/fast-export.c |    2 +-
>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
>
> diff --git a/builtin/fast-export.c b/builtin/fast-export.c
> index 19509ea..ef7c012 100644
> --- a/builtin/fast-export.c
> +++ b/builtin/fast-export.c
> @@ -610,7 +610,7 @@ static void import_marks(char *input_file)
>  			die ("Could not read blob %s", sha1_to_hex(sha1));
>  
>  		if (object->flags & SHOWN)
> -			error("Object %s already has a mark", sha1);
> +			error("Object %s already has a mark", sha1_to_hex(sha1));
>  
>  		mark_object(object, mark);
>  		if (last_idnum < mark)

```
