Project

General

Profile

git on windows "The entry does not exist or can not be annotated"

Added by Tomas Pospisek over 12 years ago

When access the "Repository" in Redmine I see a

"404

The entry or revision was not found in the repository."

What works:

  • redmine can actually access the "git" executable, since in the administrative settings is showing me the version of the git executable
  • when I start "cmd", then go to the directory that I've configured as a repository (c:\git_repository\cfm-cmm) and issue a "git log" there, then I am shown the respective commit logs

What doesn't work:

  • when I start "ruby script/runner Repository.fetch_changesets -e production" I get a "fatal: Not a git repository 'c:\git_repository\cfm-cmm'

Both the c:\Programm Files\Git\cmd and c:\Programm Files\Git\cmd are set in the system path.

Could anybody hint me please at what could be wrong here?


Replies (2)

RE: git on windows "The entry does not exist or can not be annotated" - Added by Tomas Pospisek over 12 years ago

I wrote:

What doesn't work:

  • when I start "ruby script/runner Repository.fetch_changesets -e production" I get a "fatal: Not a git repository 'c:\git_repository\cfm-cmm'

So, when I give Redmin the repository as 'c:\git_repository\cfm-cmm\.git' then fetching the changesets with script/runner actually works.

However I still get a 404

RE: git on windows "The entry does not exist or can not be annotated" - Added by Tomas Pospisek over 12 years ago

I wrote:

I wrote:

What doesn't work:

  • when I start "ruby script/runner Repository.fetch_changesets -e production" I get a "fatal: Not a git repository 'c:\git_repository\cfm-cmm'

So, when I give Redmin the repository as 'c:\git_repository\cfm-cmm\.git' then fetching the changesets with script/runner actually works.

Err, actually accessing the repository from within Redmin now works as well. I just had to restart the mongrel servers.

Redmine issues the git command as follows:

"C:\Programm Files\Git\bin\git.exe" "--git-dir" "c:/git_repository/cfm-cmm/.git" "-c" "core.quotepath=false" "-c" "log.decorate=no" "log" "--no-color" .... and more here irrelevant options

The version of git that runs on that Windows server is 1.7.6.msysgit.0

If try to execute git under Linux (git v1.7.1), then I also have to add the "*/.git" to the path otherwise I get the same "Not a git repository:" error.

So the bug is, that Redmine is suggesting to use a repository path of the style of "Bare and local repository (e.g. /gitrepo, c:\gitrepo)" when in thruth this has to be "Bare and local repository (e.g. /gitrepo/.git, c:\gitrepo\.git)" or maybe better added programmatically in the git_adapter.rb like so:

full_args = [GIT_BIN, '--git-dir', (repo_path =~ /\.git$/ ?  repo_path : File.join(repo_path, '.git') ) ]
    (1-2/2)