Can't analyse deleted paths
In a repo of mine, the directory containing most code was moved relatively recently.
When I call git who without params, the top committer has hundreds of commits, but most of these commits happened on the (moved) folder.
$ git who
┌─────────────────────────────────────────────────────┐
│Author Last Edit Commits│
├─────────────────────────────────────────────────────┤
│[REDACTED] 1 month ago 676│
│[REDACTED] 2 mon. ago 78│
│[REDACTED] 4 yr. ago 5│
...
$ git who src
┌─────────────────────────────────────────────────────┐
│Author Last Edit Commits│
├─────────────────────────────────────────────────────┤
│[REDACTED] 1 month ago 16│
│[REDACTED] 6 mon. ago 1│
└─────────────────────────────────────────────────────┘
$ git who previousname # now at "src/previousname"
Git subprocess exited with code 128. Error output:
fatal: ambiguous argument 'previousname': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
$ git who *
┌─────────────────────────────────────────────────────┐
│Author Last Edit Commits│
├─────────────────────────────────────────────────────┤
│[REDACTED] 1 month ago 385│
│[REDACTED] 2 mon. ago 51│
│[REDACTED] 4 yr. ago 3│
...
I'm not sure what you're asking exactly. Are you trying to run git who on previousname, to get a sense for how many commits were made by each author to that old directory?
You should be able to do this by running git who -- previousname. Just like with git log, if the path isn't present in the working tree, you need to add the --.
Let me know if that works!
Yeah, that doesn't work.
git log -- previousname shows me all commits made involving that path, git who -- previousname has the same error output as git who previousname.
Steps to reproduce:
$ git init
$ git commit -m 'commit 1' --allow-empty
$ echo test >foo
$ git add foo && git commit -am 'commit 2'
$ git who # shows 2 commits
$ git mv foo bar && git commit -m 'commit 3'
$ git who # shows 3 commits
$ git who bar # shows only 1 commit
$ git who foo # errors
Hmm, thanks for spotting this. I think I had this working at one point but maybe since broke it.
I definitely intended that this should work, so stay tuned for a fix.
Okay this is fixed in v0.7. Feel free to re-open if you still encounter trouble