threads / patch / 30778

patchfast-export: report SHA-1 instead of gibberish when marks

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

## tl;dr

3 messages between Jun 12, 2012 and Jun 12, 2012. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Max Horn· Jun 12, 2012, 13:45 UTC · lore

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· Jun 12, 2012, 13:45 UTC · re: Max Horn · lore

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

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(-)
Show changes to builtin/fast-export.c +1 −1
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· Jun 12, 2012, 14:26 UTC · re: Max Horn · lore

Re: [PATCH] fast-export: report SHA-1 instead of gibberish when marks exist already

Max Horn <max@quendi.de> writes:
Show 6 quoted lines
> 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.
Show 16 quoted lines
>  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)

← back to recent threads