From: Robin Green <greenrd@greenrd.org>
To: git@vger.kernel.org
Subject: git blame --reverse: it's all a bit mysterious
Date: Thu, 11 Nov 2010 19:51:34 +0000 [thread overview]
Message-ID: <87hbfnabax.wl%greenrd@greenrd.org> (raw)
The --reverse option to git blame (which isn't listed in the option summary when you type just "git blame",
but *is* listed in the cross-referenced git-rev-list(1), though that's not terribly helpful) doesn't seem
to understand what I'm trying to ask, and the man page is not much help.
greenrd@cspcnh /var/db/paludis/repositories/arbor $ strace -f -e trace=file git blame --reverse 48d96ce0e486eedea9fda0f8e480ba3c6caffc90..HEAD exlibs/eutils.exlib
execve("/usr/bin/git", ["git", "blame", "--reverse", "48d96ce0e486eedea9fda0f8e480ba3c"..., "exlibs/eutils.exlib"], [/* 41 vars */]) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/usr/lib/libz.so.1", O_RDONLY) = 3
open("/usr/lib/libcrypto.so.0.9.8", O_RDONLY) = 3
open("/lib/libpthread.so.0", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("/lib/libdl.so.2", O_RDONLY) = 3
getcwd("/var/db/paludis/repositories/arbor", 4096) = 35
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64(".git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
access(".git/objects", X_OK) = 0
access(".git/refs", X_OK) = 0
lstat64(".git/HEAD", {st_mode=S_IFREG|0644, st_size=23, ...}) = 0
open(".git/HEAD", O_RDONLY|O_LARGEFILE) = 3
access("/etc/gitconfig", R_OK) = 0
open("/etc/gitconfig", O_RDONLY|O_LARGEFILE) = 3
access("/home/greenrd/.gitconfig", R_OK) = 0
open("/home/greenrd/.gitconfig", O_RDONLY|O_LARGEFILE) = 3
stat64(".git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
access(".git/config", R_OK) = 0
open(".git/config", O_RDONLY|O_LARGEFILE) = 3
access("/etc/gitconfig", R_OK) = 0
open("/etc/gitconfig", O_RDONLY|O_LARGEFILE) = 3
access("/home/greenrd/.gitconfig", R_OK) = 0
open("/home/greenrd/.gitconfig", O_RDONLY|O_LARGEFILE) = 3
access(".git/config", R_OK) = 0
open(".git/config", O_RDONLY|O_LARGEFILE) = 3
access("/etc/gitconfig", R_OK) = 0
open("/etc/gitconfig", O_RDONLY|O_LARGEFILE) = 3
access("/home/greenrd/.gitconfig", R_OK) = 0
open("/home/greenrd/.gitconfig", O_RDONLY|O_LARGEFILE) = 3
access(".git/config", R_OK) = 0
open(".git/config", O_RDONLY|O_LARGEFILE) = 3
lstat64("exlibs/eutils.exlib", 0xbf896768) = -1 ENOENT (No such file or directory)
stat64(".git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getcwd("/var/db/paludis/repositories/arbor", 1024) = 35
chdir(".git") = 0
getcwd("/var/db/paludis/repositories/arbor/.git", 4096) = 40
lstat64("/var/db/paludis/repositories/arbor/.git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
chdir("/var/db/paludis/repositories/arbor") = 0
chdir("/var/db/paludis/repositories/arbor") = 0
lstat64("48d96ce0e486eedea9fda0f8e480ba3c6caffc90..HEAD", 0xbf896768) = -1 ENOENT (No such file or directory)
fatal: cannot stat path '48d96ce0e486eedea9fda0f8e480ba3c6caffc90..HEAD': No such file or directory
Now this error message is very unhelpful. Why is git blame trying to interpret this as a filename,
when the man page implies that it expects a revision range (or possibly a single revision, if you
believe the option summary at the top of the man page)?
This isn't the first time I've noticed git misinterpreting a revision (range) as a filename, but
in this case, I have no clue what is going on.
I notice from the strace output that it's looking for the specified filename first, which of course
no longer exists in HEAD. The man page implies that blame --reverse only needs the file to exist
in the first revision of the revision range; if it also needs to exist in the *working tree* or
something like that, that should be documented in the man page.
I'm using git version 1.7.3.2.
--
Robin Green
next reply other threads:[~2010-11-11 19:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 19:51 Robin Green [this message]
2010-11-11 22:15 ` git blame --reverse: it's all a bit mysterious Thomas Rast
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=87hbfnabax.wl%greenrd@greenrd.org \
--to=greenrd@greenrd.org \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).