git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* `git log relative_path_to_object` does not respect the --work-tree path
@ 2014-09-29 16:40 Roberto Eduardo Decurnex Gorosito
  2014-09-29 18:06 ` Junio C Hamano
  2014-09-29 20:56 ` Jonathan Nieder
  0 siblings, 2 replies; 5+ messages in thread
From: Roberto Eduardo Decurnex Gorosito @ 2014-09-29 16:40 UTC (permalink / raw)
  To: git

When passing objects to the `git log`, by just naming them or using
the `--objects` option, relative paths are evaluated using the current
working directory instead of the current working tree path.

Even the error message is clearly wrong.
    "unknown revision or path not in the working tree."

Example:

Given a repo at "~/path/to_repo" containing a file such as "README.md"
("~/path/to_repo/README.md")

~/path$ git --work-tree=~/path/to_repo log README.md
fatal: ambiguous argument 'README.md': unknown revision or path not in
the working tree.

As you can see here
(https://github.com/robertodecurnex/git/blob/master/setup.c#L147) git
is trying to `lstat` the path as it was given when it should validate
the file existence within the work tree (perpending the work-tree
before the file name).

Note: I now several workarounds for this, I'm not looking for a
solution to the specific problem but to discuss the implementation and
evaluate a change over the current behavior.

Regards,
--
Roberto Decurnex

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-30 12:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 16:40 `git log relative_path_to_object` does not respect the --work-tree path Roberto Eduardo Decurnex Gorosito
2014-09-29 18:06 ` Junio C Hamano
2014-09-29 18:11   ` Roberto Eduardo Decurnex Gorosito
2014-09-29 20:56 ` Jonathan Nieder
2014-09-30 12:42   ` Roberto Eduardo Decurnex Gorosito

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).