From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Green Subject: git blame --reverse: it's all a bit mysterious Date: Thu, 11 Nov 2010 19:51:34 +0000 Organization: Swansea University Message-ID: <87hbfnabax.wl%greenrd@greenrd.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Thu Nov 11 20:56:40 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PGdGC-0007m1-A8 for gcvg-git-2@lo.gmane.org; Thu, 11 Nov 2010 20:56:40 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756591Ab0KKT4h (ORCPT ); Thu, 11 Nov 2010 14:56:37 -0500 Received: from host29.netdorm.com ([64.182.105.29]:33791 "EHLO mxout.netdorm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756563Ab0KKT4g (ORCPT ); Thu, 11 Nov 2010 14:56:36 -0500 Received: from mail.dnsexit.com (mail.dnsexit.com [67.214.171.75] (may be forged)) by mxout.netdorm.com (8.13.8/8.13.8) with ESMTP id oABJvGpW032036 for ; Thu, 11 Nov 2010 14:57:17 -0500 Received: from cspcnh.swan.ac.uk (cspcnh.swan.ac.uk [137.44.6.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.dnsexit.com (Postfix) with ESMTP id A1BB2B7D3AD for ; Thu, 11 Nov 2010 14:55:05 -0500 (EST) Received: from cspcnh.swan.ac.uk.greenrd.org (exherbo.local [127.0.0.1]) by cspcnh.swan.ac.uk (8.14.4/8.14.4) with ESMTP id oABJpYsm011683 for ; Thu, 11 Nov 2010 19:51:34 GMT User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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