All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blame: display a more helpful error message if the file was deleted
@ 2016-01-29  3:09 Alex Henrie
  2016-01-29  3:10 ` Alex Henrie
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Henrie @ 2016-01-29  3:09 UTC (permalink / raw)
  To: tklauser, gitster, git; +Cc: Alex Henrie

`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(-)

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] blame: display a more helpful error message if the file was deleted
@ 2015-12-16  0:00 Alex Henrie
  2015-12-16 19:56 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Henrie @ 2015-12-16  0:00 UTC (permalink / raw)
  To: git, gitster; +Cc: Alex Henrie

`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(-)

diff --git a/builtin/blame.c b/builtin/blame.c
index 1df13cf..f070272 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -2683,8 +2683,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.6.4

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

end of thread, other threads:[~2016-01-29  3:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29  3:09 [PATCH] blame: display a more helpful error message if the file was deleted Alex Henrie
2016-01-29  3:10 ` Alex Henrie
  -- strict thread matches above, loose matches on Subject: below --
2015-12-16  0:00 Alex Henrie
2015-12-16 19:56 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.