From: Edmundo Carmona Antoranz <eantoranz@gmail.com>
To: git@vger.kernel.org
Cc: max@max630.net, peff@peff.net,
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Subject: [PATCH v1] blame: avoid checking if a file exists on the working tree if a revision is provided
Date: Mon, 16 Nov 2015 19:07:17 -0600 [thread overview]
Message-ID: <1447722437-14937-1-git-send-email-eantoranz@gmail.com> (raw)
If a file has been deleted/renamed, blame refused to display
blame content even if the path provided does match an existing
blob on said revision.
$ git status
On branch hide
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: testfile1.txt
no changes added to commit (use "git add" and/or "git commit -a")
Before:
$ git blame testfile1.txt
fatal: cannot stat path 'testfile1.txt': No such file or directory
$ git blame testfile1.txt HEAD
fatal: cannot stat path 'testfile1.txt': No such file or directory
After:
$ git blame testfile1.txt
fatal: Cannot lstat 'testfile1.txt': No such file or directory
$ git blame testfile1.txt HEAD
^da1a96f testfile2.txt (Edmundo Carmona Antoranz 2015-11-10 17:52:00 -0600 1) testfile 2
^da1a96f testfile2.txt (Edmundo Carmona Antoranz 2015-11-10 17:52:00 -0600 2)
^da1a96f testfile2.txt (Edmundo Carmona Antoranz 2015-11-10 17:52:00 -0600 3) Some content
Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
---
builtin/blame.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index 83612f5..db430d5 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.2
next reply other threads:[~2015-11-17 1:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 1:07 Edmundo Carmona Antoranz [this message]
2015-11-17 1:16 ` [PATCH v1] blame: avoid checking if a file exists on the working tree if a revision is provided Edmundo Carmona Antoranz
2015-11-17 1:25 ` Edmundo Carmona Antoranz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447722437-14937-1-git-send-email-eantoranz@gmail.com \
--to=eantoranz@gmail.com \
--cc=git@vger.kernel.org \
--cc=max@max630.net \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox