threads / discuss / 59554

Can see log for a renamed file

Subject: Can see log for a renamed file

## tl;dr

2 messages between Apr 5, 2023 and Apr 6, 2023.

replies: 1people: 2as markdown or json

Eugen Konkov· Apr 5, 2023, 23:16 UTC · lore
Hello, folks.

``` git log 9ce3e165f284d55503eff9b627ef3723854c53bb^ -- lib/Invoice/Schema/Result/Company.pm fatal: ambiguous argument 'lib/Invoice/Schema/Result/Company.pm': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' ```

But if I checkout to the commit before renaming then this command works:
git log 9ce3e165f284d55503eff9b627ef3723854c53bb^ -- lib/Invoice/Schema/Result/Company.pm
I beleive it would be much handy if git checks the file after analizing of the commit 9ce3e165f284d55503eff9b627ef3723854c53bb^
Thanks
-- 
Best regards,
Eugen Konkov
Jeff King· Apr 6, 2023, 03:59 UTC · re: Eugen Konkov · lore

Re: Can see log for a renamed file

On Wed, Apr 05, 2023 at 07:16:02PM -0400, Eugen Konkov wrote:
Show 8 quoted lines
> Hello, folks.
> 
> ```
> git log 9ce3e165f284d55503eff9b627ef3723854c53bb^ -- lib/Invoice/Schema/Result/Company.pm
> fatal: ambiguous argument 'lib/Invoice/Schema/Result/Company.pm': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
> ```

Are you sure you've cut and paste accurately here? You _do_ have a "--" in the command you showed, so it should not print the "ambiguous argument" error. It should behave exactly as you're expecting (accepting the path as-is).

If that is what you typed, then something very funny is going on in your Git build, where it is ignoring some arguments. Is "git" a wrapper script or something?

-Peff

← back to recent threads