"gource: failed to generate log file" for Git repository
I'm getting the following error message when gource is executed in the Git repository directory even though I have Git in PATH environment variable (as suggested in the issue #67):
$ gource .
gource: failed to generate log file
Git directory in PATH:
c:\Program Files\Git\cmd\
Tested in plain Windows Console, Git bash and Cygwin.
Operating system: Windows 7 64-bit Gource version: 0.42
I'm thinking if it cannot be caused by an incompatibility with Git. I'm using Git version 2.8 (Cygwin) and 2.12 (Windows) currently.
What happens if you run: git.exe log in the directory you are in (NOTE: gource specifically runs git.exe)
I have this issue too:
$ gource
fatal: Not a git repository (or any of the parent directories): .git
gource: failed to generate log file
Try 'gource --help' for more information.
I have tried this in Git Bash and Windows's cmd.exe.
$ git --version
git version 2.9.2.windows.1
$ gource --help
Gource v0.42
...
I have tried re-cloning the git repository but that made no difference. This works fine on my desktop but does not work on my laptop.
What type of output do you get if you run git log @sci4me ?
@emilrowland
$ git log
commit 27922a9da863e91cebcfadc09a86ab74fd194d86
Author: sci4me <[email protected]>
Date: Tue Jun 20 14:47:40 2017 -0500
update VM.cs
commit 41e06676c4611b03531ca3e3fc69ee5930e00580
Author: sci4me <[email protected]>
Date: Tue Jun 20 14:46:27 2017 -0500
work on Neo
The error 'fatal: Not a git repository (or any of the parent directories): .git' would have come from the running the git.exe log command. Perhaps it could be an issue with the directory path it is passing to it (maybe an encoding problem).
@acaudwell I am running Gource (and ran git.exe log) from 'C:\Users\sci4me\Documents\Projects\neo-lang\Neo'. Like I said, Gource fails from cmd.exe and Git Bash but git.exe log works just fine from both.
This is the full command gource tries to run so you could try that in that directory:
git log --pretty=format:user:%aN%n%ct --reverse --raw --encoding=UTF-8 --no-renames
Also maybe try it with the Repo in a different folder not under Documents (e.g. C:\Neo or something) in case it is something to do with that.
@acaudwell I tried that command in my current repo as well as a clone of it at C:\neo. Both times, I got this:
user:sci4me
1495961284
:000000 100644 0000000... 757313e... A .gitignore
:000000 100644 0000000... e9f2c86... A Neo.sln
:000000 100644 0000000... 052dd0b... A README.md
...
user:sci4me
1495965356
:100644 100644 e9f2c86... b72bdfb... M Neo.sln
:100644 100644 052dd0b... 3cd85bf... M README.md
:000000 100644 0000000... 949a907... A V4/AST/ChunkNode.cs
:000000 100644 0000000... 094f027... A V4/AST/DeclarationNode.cs
:000000 100644 0000000... 9c63654... A V4/AST/ExpressionNode.cs
:000000 100644 0000000... 8a4f3d2... A V4/AST/Node.cs
...
(Obviously I cut a bunch of the output out)
I tried pasting the above into a file and running it with gource neo.log. It didn't work initially because the expected 'tab' character between the file status (e.g. 'A') and the filename was instead 2 spaces. That may have just been a side effect of pasting it here. Once I edited each entry to have a tab it worked.
If you run the command piped into a file and the run the file with gource presumably that works? Are the tabs missing?
@acaudwell Piping the log command to a file and running gource with said log file works just fine.
Hah. Strange. Well at least there's an easy work around.
@acaudwell Can I somehow try to pipe the log output into gource myself? I presume that's roughly what you do anyway, but, perhaps it would work if I were to do it myself in the terminal?
It can read STDIN (it's documented) but history logs are just saved to a temporary file and then read.
@acaudwell I'm actually quite surprised to find that it seems to work just fine if I pipe the git log command into gource. I ran this:
git log --pretty=format:user:%aN%n%ct --reverse --raw --encoding=UTF-8 --no-renames | gource --log-format git -
And it worked just fine. And yet when I just run gource with no arguments in the same directory, it doesn't work.
I get this if there is a zero commit in the repository. Then I see something like this in the git log:
user:git.admin
0
user:Nick Wagg
667587478
:000000 100644 0000000000 3d239644d5 A pdms001/basiclayer/ascii.mcr
:
if I remove the 2 offending lines then it is fine