threads / patch / 41283

patchblame: display a more helpful error message if the file was deleted

Subject: [PATCH] blame: display a more helpful error message if the file was deleted

## tl;dr

2 messages between Jan 29, 2016 and Jan 29, 2016. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Alex Henrie· Jan 29, 2016, 03:09 UTC · lore
`git blame 22414770 generate-cmdlist.perl` currently results in:
    fatal: cannot stat path '22414770': No such file or directory
This patch changes the error message to:
    fatal: ambiguous argument 'generate-cmdlist.perl': unknown revision
    or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'"

That way, the user knows to rewrite the command as `git blame 22414770 -- generate-cmdlist.perl`.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 builtin/blame.c | 2 --
 1 file changed, 2 deletions(-)
Show changes to builtin/blame.c +0 −2
diff --git a/builtin/blame.c b/builtin/blame.c
index 55bf5fa..9461a73 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -2704,8 +2704,6 @@ parse_done:
 		argv[argc - 1] = "--";
 
 		setup_work_tree();
-		if (!file_exists(path))
-			die_errno("cannot stat path '%s'", path);
 	}
 
 	revs.disable_stdin = 1;
-- 
2.7.0

← back to recent threads