1

I want to find the first instance of $PREFIX/opt/rubies in this file.

I'm using the suggestion from this answer:

git log -S <whatever> --source --all

So my line is:

git log -S "PREFIX/opt/rubies" --source --all

but I get this error message:

fatal: ambiguous argument 'PREFIX/opt/rubies': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions

I also have an alias set up:

alias.search log --format='%C(yellow)%h %an %ad%C(reset)%n%w(72,1,2)%s' -S

So I try:

git search "PREFIX/opt/rubies"

Same error. I thought it might be because the slashes needed escaping, nope.

The version of Git I'm using is 1.7.1, because I broke my newer Git the other day and haven't got round to fixing it. I'm running the commands via zsh, version 4.3.9.

Any help or insight is much appreciated.

Community
  • 1
  • 1
ian
  • 12,003
  • 9
  • 51
  • 107

1 Answers1

0

If you are literally getting

ambiguous argument 'PREFIX/opt/rubies'
, have you checked that
PREFIX
is defined is in the root of your development directory (same place as .git)? It looks from the file that $PREFIX is a variable in the code in the file.
Mark Leighton Fisher
  • 5,609
  • 2
  • 18
  • 29
  • Since I removed the `$` sign in front of it and wrapped it in quotes, why would the shell interpolate it? It's just an uppercase string literal. And why is git thinking a string literal passed as an argument to `-S` should be treated as a path? – ian Aug 12 '14 at 18:19