1
$ git lg1 --author=name . |awk -F' ' '{print $2}'
8901004
4e4c435
ab9e126

$ git lg1 --author=name . |awk -F' ' '{print $2}'|xargs -I{} git show {} --name-only
fatal: ambiguous argument '8901004': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Question> How should I do here to fix the git complaint?

Note: git lg1 Pretty git branch graphs

q0987
  • 34,938
  • 69
  • 242
  • 387
  • I think the problem does not have to do with xargs. If you use `git show 8901004 --name-only` alone you should get the same error. Note that the error message tells you what you could try: add another `--` to the git command. – mkrieger1 Oct 07 '20 at 20:43
  • @mkrieger1, I could run `git show 8901004 --name-only` without problems. – q0987 Oct 07 '20 at 20:53
  • I can run your command with `git lg1` just fine on a repo. – zrrbite Oct 07 '20 at 21:03

1 Answers1

0

This runs just fine in a git 2.28 Windows bash:

MINGW64 /c/git/git (master)
$ git lg -2 --author=name . |awk -F' ' '{print $2}'|grep 8|xargs -I{} git show {} --name-only

I tried with --name-only or git show --name-only {}, without adding any '--' at the end, and it does work.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250