Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't allow Gitolite Repositories #166

Closed
joshuafcole opened this issue May 5, 2011 · 19 comments
Closed

Doesn't allow Gitolite Repositories #166

joshuafcole opened this issue May 5, 2011 · 19 comments

Comments

@joshuafcole
Copy link

Gitolite (a git authentication system) repositories take the format "ssh://example.com**:my-repo name" rather than "ssh://example.com/**my-repo name" The GUI automatically prepends the folder name with a slash, which makes adding a gitolite repository impossible. I don't mind if the workaround is non-GUI, but I cannot seem to find a workaround period. Seriously looking forward to using this. Hope you can take a look at it soon.

@lgordon
Copy link

lgordon commented May 5, 2011

I was trying to figure out how to use gitolite on a non-standard port since the colon is being used to reference the repo and I think this thread might have the solution to the problem here:

http://groups.google.com/group/gitolite/browse_thread/thread/4a36135f4e730fb7?pli=1

as a side note gitolite+gitweb seems like a good authentication+web interface for sparkleshare

@joshuafcole
Copy link
Author

Great call Igordon. Guess I should've tested more extensively before raising the warning flag! And here I forked for nothing...

@hbons
Copy link
Owner

hbons commented May 5, 2011

So what was the solution in the end? Did you leave out the ":"?

@joshuafcole
Copy link
Author

Turns out that if you use an explicit SSH url to reference the git repo, you can use slash notation just like a normal repo!

@hbons
Copy link
Owner

hbons commented May 5, 2011

Ok, just asking because if you did some kind of workaround it's better to fix it in sparkles. Good that it works. :)

@jeff-h
Copy link

jeff-h commented Jun 16, 2011

Unfortunately this solution doesn't work for me. My gitolite repos only respond at a url such as username@server:repo.git not ssh://username@server/home/username/repositories/repo.git.

When I try the latter, it seems to work, but the console spits out this:

16/06/11 10:51:56 PM [0x0-0x11e11e].org.sparkleshare.sparkleshare[69574] 22:51:56 [Cmd] /opt/local/bin/git clone "ssh://username@server/home/username/repositories/repo.git" "/Users/jeffh/SparkleShare/.tmp/repo"
16/06/11 10:52:02 PM [0x0-0x11e11e].org.sparkleshare.sparkleshare[69574] R access for home/username/repositories/repo DENIED to jeff
16/06/11 10:52:02 PM [0x0-0x11e11e].org.sparkleshare.sparkleshare[69574](Or there may be no repository at the given path. Did you spell it correctly?)
16/06/11 10:52:02 PM [0x0-0x11e11e].org.sparkleshare.sparkleshare[69574] fatal: The remote end hung up unexpectedly
16/06/11 10:52:02 PM [0x0-0x11e11e].org.sparkleshare.sparkleshare[69574] 22:52:02 [Git] Exit code 128
16/06/11 10:52:02 PM [0x0-0x11e11e].org.sparkleshare.sparkleshare[69574] 22:52:02 [Fetcher] Failed

@jeff-h
Copy link

jeff-h commented Jun 16, 2011

A little more info on this;

gitolite does NOT appear to allow explicit ssh:// protocol connections ie on the commandline:

This works:
git clone username@server:repo.git

This does not:
git clone ssh://username@server/some/path/repositories/repo.git

I think the latter does authenticate with SSH but gitolite does not make the correct connection to the appropriate "virtual gitolite user", thus failing gitolite's repository permissions system.

At the end of the day I got this working by:

— manually checking out my repo from the terminal into my sparkleshare folder using the syntax gitolite likes:

git clone username@server:repo.git

— hand-modified the .config/sparkleshare/config.xml file, adding the following:

  <folder>
    <name>repofoldername</name>
    <url>[email protected]/home/user/repositories/reponame.git</url>
    <backend>Git</backend>
  </folder>

I also tried the following instead of the above, which also seems to work fine:

  <folder>
    <name>repofoldername</name>
    <url>[email protected]:reponame.git</url>
    <backend>Git</backend>
  </folder>

Ultimately my conclusion is that it would be ideal if sparkleshare could allow a more flexible entry of the server details, at the very least not presuming ssh:// as it appears to at present and perhaps ideally not mandating the / between the server and the repository name.

ps thanks for the awesome work on sparkleshare... loving it :)

@joshuafcole
Copy link
Author

Unless something major has changed without me noticing it, this may be an issue with the way you defined your repository in your conf. It still seems to work fine with me, and I'm running both more or less vanilla.

@wimh
Copy link

wimh commented Jun 16, 2011

@test66 If this works:

git clone username@server:repo.git

Can you also check if the following command works:

git clone ssh://username@server/~/repo.git

(note the ~ in the url)

The server:repo.git syntax is explicit supported by git: http://www.kernel.org/pub/software/scm/git/docs/git-clone.html#URLS

@jeff-h
Copy link

jeff-h commented Jun 17, 2011

@joshuafcole: "may be an issue with the way you defined your repository in your conf" — do you mean my gitolite config? If so, I'm not aware of anything unusual I could even be doing in there; my repos are defined like:

repo    reponame
    RW jeff

If you mean my Sparkleshare config, it's entirely possible I haven't defined the XML config properly but that's really the essence of this issue; to request that the GUI allow entry of the gitolite-format server details.

@wimh — here's what I got:

jeffh$ git clone ssh://username@server/~/reponame.git
Initialized empty Git repository in /Users/jeffh/Desktop/reponame/.git/
bad command: git-upload-pack '~/reponame.git'
fatal: The remote end hung up unexpectedly

@joshuafcole
Copy link
Author

Not sure if it'd help, but try RW+. + gives a few special permissions like
the ability to perform nonFFWs and such. I tend to give myself full
permission to my repo so that's the only differentiating factor I can see
between my config and yours. I do agree that it shouldn't be necessary
though.

On Thu, Jun 16, 2011 at 11:51 PM, test66 <
[email protected]>wrote:

@joshuafcole: "may be an issue with the way you defined your repository in
your conf" do you mean my gitolite config? If so, I'm not aware of
anything unusual I could even be doing in there; my repos are defined like:

repo reponame
RW jeff

If you mean my Sparkleshare config, it's entirely possible I haven't
defined the XML config properly but that's really the essence of this issue;
to request that the GUI allow entry of the gitolite-format server details.

@wimh here's what I got:

jeffh$ git clone ssh://username@server//reponame.git
Initialized empty Git repository in /Users/jeffh/Desktop/reponame/.git/
bad command: git-upload-pack '
/reponame.git'
fatal: The remote end hung up unexpectedly

Reply to this email directly or view it on GitHub:
#166 (comment)

Screw the environment. Please print this email immediately. And then burn
it.

@jeff-h
Copy link

jeff-h commented Jun 20, 2011

Tried that (RW+) with a fresh repo and no luck, same result. As far as I can see, it's simply not possible for me to enter the details of my gitolite-configured repository into Sparkleshare.

@wimh
Copy link

wimh commented Jun 27, 2011

I have setup Gitolite on windows for some testing.

I see gitolite is very picky on the syntax. These two commands work:

git ls-remote git@localhost:test1
git ls-remote ssh://git@localhost/test1

But everything else I tried does not work, including these simular do not work:

git ls-remote ssh://git@localhost:test1
git ls-remote git@localhost/test1

@jeff-h
Copy link

jeff-h commented Jun 27, 2011

@wimh, thanks for this; you have an ssh:// syntax above that I haven't tried previously, and it works for me with Sparkle! Since Sparkleshare presumes ssh:// in the url (check the ~/.config/sparkleshare/config.xml file to see this) my experience would suggest that the only syntax to add a gitolite repo to Sparkleshare is:

ssh://user@server/repo

...where repo is your gitolite repo with or without the .git on the end

Thus the values you'd put into Sparkleshare "Add remote folder..." would be:
Address:// user@server
Foldername: reponame (with or without .git on the end)

Seems simple stated this way but I was mislead due to other threads I read while working this out that seemed to state you need the full server path to the repo if you are using the ssh:// protocol. This appears not to be the case. I had been confused as I presumed others had a simpler server directory structure (my gitolite server is on a shared host, thus is under username/repositories/)

Thanks all who added to this thread and helped me get this working!

@hbons
Copy link
Owner

hbons commented Jun 27, 2011

Glad it worked. I'll reopen this so that it goes into the documentation.

@hbons hbons reopened this Jun 27, 2011
@nic-bertino
Copy link

Hmmm.. I'm testing sparkle on my Gitolite VM and not having any luck. Here's the folder from my config.xml:

sparkle gitolite/sparkle Git

ssh://gitolite/sparkle works for me in terminal if I use git clone, so I'm not quite sure what the issue is. Here's a dump from the console:

6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] Identity added: (snip)
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] 21:04:48 [Cmd] /usr/bin/git log -1 --format=%H
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] fatal: bad default revision 'HEAD'
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] 21:04:48 [Cmd] /usr/bin/git rev-list --reverse HEAD
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] Use '--' to separate paths from revisions
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] Unhandled Exception: System.ArgumentOutOfRangeException: startIndex + length > this.length
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] Parameter name: length
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at SparkleLib.SparkleRepoGit.get_Identifier () [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at SparkleLib.SparkleRepoBase.CreateListener () [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at SparkleLib.SparkleRepoBase..ctor (System.String path, SparkleLib.SparkleBackend backend) [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at SparkleLib.SparkleRepoGit..ctor (System.String path, SparkleLib.SparkleBackend backend) [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at SparkleShare.SparkleController.AddRepository (System.String folder_path) [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at SparkleShare.SparkleController.PopulateRepositories () [0x00000] in :0
6/28/11 9:04:48 PM [0x0-0x466466].org.sparkleshare.sparkleshare[87022] at System.Threading.Thread.StartUnsafe () [0x00000] in :0
6/28/11 9:04:48 PM com.apple.launchd.peruser.502199 Exited with exit code: 1

Where is it attempting to run /usr/bin/git log? Remotely? I'll have a pile of documentation ready when this is done :)

@hbons hbons closed this as completed Jun 29, 2011
@lgordon
Copy link

lgordon commented Jun 29, 2011

Can someone who has gotten gitolite+sparkleshare working create a small wiki article about how to do it?

@jeff-h
Copy link

jeff-h commented Jun 29, 2011

I've made a small start at https://github.com/hbons/SparkleShare/wiki/Using-Gitolite-repositories-with-Sparkleshare but I'm not sure how to move it into the appropriate section on https://github.com/hbons/SparkleShare/wiki — can someone do that for me?

@hbons
Copy link
Owner

hbons commented Jun 29, 2011

@jeff-h done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants