rev-parse doesn't take pwd into consideration
- From
- Luciano Rocha <luciano@eurotux.com>
- Date
- May 26, 2008, 19:58 UTC
- Message-ID
- <20080526195812.GA23396@bit.office.eurotux.com>
Hello,
I was frustrated for some minutes trying to get the HEAD version of a file, as is in the documentation. Using git's source as an example: git/Documentation$ git show HEAD:docbook.xsl fatal: ambiguous argument 'HEAD:docbook.xsl': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
<hmmm>
$ git show HEAD -- docbook.xsl <nil> $
Seeing in the documentation that the parsing was made by git-rev-parse, I tried running git-rev-parse directly, ending with the same error.
I tried with the full path, just in case, but it didn't work also ($PWD/docbook.xsl).
Until finally I tried the absolute path as git is concerned, and it worked.
It works anywhere: git$ git show HEAD:Documentation/docbook.xsl <contents> git/Documentation$ git show HEAD:Documentation/docbook.xsl <contents> ...
Is it difficult to make rev-parse accept relative path specifications?
-- Luciano Rocha <luciano@eurotux.com> Eurotux Informática, S.A. <http://www.eurotux.com/>