Issue #231: Kallithea 0.3 and 0.3.2, seems to improperly create git respository
|Reported by:||Lutchy Horace|
|Created on:||2016-07-14 01:23|
|Updated on:||2016-07-20 21:49|
When creating a git repository, the folder structure is improper. Ie, Ansible_Playbooks, see below.
. |-- LHProjects-Network | |-- Ansible_Playbooks | | |-- HEAD | | |-- branches | | |-- config | | |-- description | | |-- hooks | | | |-- post-receive | | | `-- pre-receive | | |-- info | | | `-- exclude | | |-- objects | | | |-- info | | | `-- pack | | `-- refs | | |-- heads | | `-- tags
I don't personally use Git repositories, but unfortunately at this time, I need it for this specific use case. Furthermore, when I manually create a file and commit changes. I get HTTP 500 server error with the following traceback, see below.
Error - <class 'kallithea.lib.vcs.exceptions.EmptyRepositoryError'>: There are no changesets yet URL: http://scm.lhprojects.net/LHProjects-Network/Ansible_Playbooks/changeset/tip File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in __call__ app_iter = self.application(environ, sr_checker) File '/usr/local/libexec/scm/kallithea/kallithea/lib/middleware/sessionmiddleware.py', line 62 in __call__ return self.wrap_app(environ, session_start_response) File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/routes/middleware.py', line 131 in __c$ ll__ response = self.app(environ, start_response) File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/pylons/wsgiapp.py', line 103 in __call$ _ response = self.dispatch(controller, environ, start_response) File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/pylons/wsgiapp.py', line 313 in dispat$ h return controller(environ, start_response) File '/usr/local/libexec/scm/kallithea/kallithea/lib/base.py', line 446 in __call__ return WSGIController.__call__(self, environ, start_response) File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/pylons/controllers/core.py', line 214 $ n __call__ response = self._dispatch_call() File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/pylons/controllers/core.py', line 164 i n _dispatch_call response = self._inspect_call(func) File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 i n _inspect_call result = self._perform_call(func, args) File '/usr/local/libexec/scm/kallithea-venv/lib/python2.7/site-packages/pylons/controllers/core.py', line 57 in _perform_call return func(**args) File '<decorator-gen-65>', line 2 in index File '/usr/local/libexec/scm/kallithea/kallithea/lib/auth.py', line 810 in __wrapper return func(*fargs, **fkwargs) File '<decorator-gen-64>', line 2 in index File '/usr/local/libexec/scm/kallithea/kallithea/lib/auth.py', line 857 in __wrapper return func(*fargs, **fkwargs) File '/usr/local/libexec/scm/kallithea/kallithea/controllers/changeset.py', line 326 in index return self._index(revision, method=method) File '/usr/local/libexec/scm/kallithea/kallithea/controllers/changeset.py', line 204 in _index rev_ranges = [c.db_repo_scm_instance.get_changeset(revision)] File '/usr/local/libexec/scm/kallithea/kallithea/lib/vcs/backends/git/repository.py', line 502 in get_changeset revision = self._get_revision(revision) File '/usr/local/libexec/scm/kallithea/kallithea/lib/vcs/backends/git/repository.py', line 279 in _get_revision raise EmptyRepositoryError("There are no changesets yet") EmptyRepositoryError: There are no changesets yet
It seems the quick fix is to move all the files and folders into a sub folder .git.
Comment by Mads Kiilerich, on 2016-07-14 01:30
Git has this bare format too.
And if you just created the repo, it is right that there are no changesets?
"manually create a file" - what does that mean? Doing it the non-manual way through the web interface? ;-)
Comment by Lutchy Horace, on 2016-07-14 03:39
I am not familiar with git, so I wouldn't know what you mean by 'Git has this bare format too'. I am assuming, same as 'hg init'.
To answer your questions.
1) While 'git push', git command will complain that the remote repository is not a 'git repository'.
As far as "manually create a file", see below.
Steps to reproduce:
- Create a repository test and set VCS to 'git'
- Once you are navigated to the summary page, click 'Add new file'
- Type test and enter a commit message.
- Hit enter and you will get a HTTP 500 Response page
This might be related, see http://stackoverflow.com/a/6167960/3684335
"git init --bare" does not create a .git directory. It puts the files directly on the folder. When adding the remote origin I get : ""fatal: Not a git repository (or any parent up to mount point /home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not se
Comment by Andrej Shadura, on 2016-07-14 07:57
hg init is similar to
git init, but not
git init --bare. I think you need to learn more about bare repositories, because what you're describing is exactly how they work.
Comment by Andrej Shadura, on 2016-07-14 08:03
I have just tried what you described above, and it worked.
Comment by Lutchy Horace, on 2016-07-14 16:19
I've never worked with 'git' ever, except when I needed to clone projects from github.com. Whenever I can avoid git, the better.
As for as the 500 HTTP error, the issue was on my end, missing 'filename'.
In regards to 'Not a git repository' issue, as I posted earlier, in my case. I was attempting to directly work with the git repository via SSH. IE, 'git push example.com:test'. I am assuming, for git to recognize that it's a 'bare repository', the path needs to end in .git? IE, what I've noticed quite familiar around the web, http://example.com/my_project.git ? I've spent few hours scouring the web for information about this with no luck if this is mandatory.
Never the less, moving all the files inside a .git repository. Kallithea still recognized it as a git repository and I was able to push into it successfully via SSH. Although, I am not sure if this breaks anything in regards to pushing and pulling from http://example.com/test will work.
EDIT 1: Looks like Kallithea revert it back to a 'bare repository'. Additionally, git isn't complaining. I assuming this might have something to do with the repository being empty, which explains why git was complaining that it's 'Not a git repository'. I've read reports, you must at least git push .gitignore, to get things going. I am not too sure about that. Never the less, I got things working with my work around.
Comment by Andrej Shadura, on 2016-07-14 17:37
- You can't avoid git because of how widespread it is.
- Git is very unlike Mercurial.
- You can't work with Git even with tools like hg-git if you don't understand how it works internally, at least a little bit.
- Kallithea doesn't support SSH at the moment.
Comment by Lutchy Horace, on 2016-07-14 18:16
I do not or will I ever use Git as a VCS and have no interest in learning the internals, except for the simple Git (clone, pull, push) fundamentals. Getting this to work is a one time use case for a project to clone my Ansible Playbooks. Aside from that, I appreciate the help.
Comment by Lutchy Horace, on 2016-07-14 18:17
The issue was resolve on my end.
Comment by Andrej Shadura, on 2016-07-15 08:43
There's not need to react like that, I'm just telling you the state of the things. Too many projects use Git for you to be able to sensibly isolate yourself from it, and Git is very difficult to use unless you understand the principles its storage is built upon. I'm not trying to convince you to use Git, not at all, that's just how it works.
Comment by Andrej Shadura, on 2016-07-15 08:44
I'm speaking purely from my experience of dealing with Git and not understanding how it works, and believe me it's very confusing. Understanding its fundamentals made my work with it at least bearable.
Comment by Lutchy Horace, on 2016-07-20 21:49
No, I am just clarifying my position in regards to Git. I haven't worked with Git within the past year (if not longer) except for PHPMyAdmin project, which I prefer to git pull to keep it up to date (which I will automate and add my Ansible Playbook on the list). Irregardless to the widespread use of Git, I have successfully avoided using git as GitHub does provide downloadable tar balls. Aside from the fundamentals I've elaborated on earlier which I now have a better understanding of. IE, 'git pull', 'git push', and 'git clone'. I can continue avoiding using Git.
Yeah, Git is difficult and unless you are interested in doing my work for me. :) Nope.