From: Junio C Hamano <gitster@pobox.com>
To: Phil Hord <phil.hord@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Confusing error message
Date: Thu, 14 Jun 2012 16:18:04 -0700 [thread overview]
Message-ID: <7vy5npcwk3.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v395xebal.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 14 Jun 2012 16:14:26 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Phil Hord <phil.hord@gmail.com> writes:
>
>> I messed something up during a rebase in a moved file (probably
>> because I had rename detection turned off). So now I want to fix it.
>>
>> I think I have the commit amended right, but to be sure I want to diff
>> the old file and the new file.
>>
>> $ git diff newfile HEAD^:oldfile
>> fatal: Path 'oldfile' exists, but not 'oldfile'.
>> Did you mean 'HEAD^:oldfile' aka 'HEAD^:./oldfile'?
>
> You can feed two blob object names to "git diff", but I do not think
> there is any provision to compare a blob object and a file in the
> working tree.
Ah, actually we do have a bolted-on hack to allow you feeding a blob
and a file, but I think you still need to follow the command line
convention of subcommand name (=diff), any dashed options
(e.g. "-R"), any object names (=HEAD^:oldfile) and then finally
pathnames (e.g. "newfile").
Does "git diff -R HEAD^:oldfile newfile" work?
next prev parent reply other threads:[~2012-06-14 23:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 22:54 Confusing error message Phil Hord
2012-06-14 23:14 ` Junio C Hamano
2012-06-14 23:18 ` Junio C Hamano [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-10-21 8:57 Ralf Baechle
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=7vy5npcwk3.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=phil.hord@gmail.com \
/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).