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

Make user repo prefix customizable #561

Closed
gitblit opened this issue Aug 12, 2015 · 11 comments
Closed

Make user repo prefix customizable #561

gitblit opened this issue Aug 12, 2015 · 11 comments

Comments

@gitblit
Copy link
Collaborator

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 265

It would be nice if the prefix of user repositories would be customizable. Right now
user repositories are created under ~username/. 

I am trying this together with other web tools and most stumble over repository directories
with the tilde. It would be good if the prefix of the username could be changed. It
might even be a directory.

Possible configurations:

---
Prefix: ~

Repos: 
~userA/bla.git
~userZ/blubb.git

---
Prefix: 

Repos:
userA/bla.git
userZ/blubb.git


---
Prefix: _

Repos:
_userA/bla.git
_userZ/blubb.git


---
Prefix: user/

Repos:
user/userA/bla.git
user/userB/blubb.git

Reported by f.zschocke on 2013-07-03 18:51:22

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Hmmm.  This is an involved change, actually.

What sort of troubles are you having?

Reported by James.Moger on 2013-07-03 21:28:18

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I am in the process of setting up Git servers and am running mutliple tools on the same
repository space, i.e. directory. For one, in order to evaluate them against each other
and also to fulfill different tasks, like repository management and code review.

While some tools like cGit have no problems with directories with a tilde, pother like
GitLab have a problem importing repositories from directories with it. So in order
to get different tools to get along with each other, it would be beneficial if such
things as the namespace for user repositories could be configured by a setting.

Reported by f.zschocke on 2013-07-04 18:16:20

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Checking the code, it looks to me that it would only involve a change in UserModel,
altering getPersonalPath() and making sure this method is used as the only means to
get the personal path. When you say that is actually an involved change, what am I
missing? 
I was going to try and change that but wanted to check what trouble I'm in for beforehand.
=)

Reported by f.zschocke on 2013-07-08 19:40:34

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Okay, answering this myself, there are actually quite a few places where the "~" is
hard coded. Changing my question:
Is this only hard coded in Java sources or also in .js or .html files? (I know nothing
about web development so please excuse me if this is a stupid question.)

Reported by f.zschocke on 2013-07-09 12:15:04

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

It is only hard-coded in java files.  It is not difficult to change the prefix.  The
issue becomes making it a setting in an intelligent way since currently model class
methods rely on it being ~.

Reported by James.Moger on 2013-07-10 00:36:17

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Branching off of v1.2.1 I have now started to implement this. I have refactored the
code to gather all logic concerning the path of a user personal repository into one
place. 
Let me know if you are at all interested in this. If so, I would rebase this onto master
and send you a pull request for review. At least the refactoring part could be interesting.
Making it a setting is a bit more involved as I would have to cover cases like an empty
prefix or a directory prefix and test that.

Reported by f.zschocke on 2013-07-10 06:28:55

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I'll give this some thought.  I may be open to making it configurable - it will depend
on how cleanly (i.e. reasonable class dependencies) it can be done.  I'm not sure about
supporting the blank prefix.  Perhaps.

This week, however, I am not thinking about new features; just trying to get 1.3.0
finished.

Reported by James.Moger on 2013-07-11 12:19:31

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Hi James,

I have pushed some changes to GitHub concerning this issue. I would like your opinion
on this, to see if this is anything that you would be willing to go forward with and
that is worth developing into a pull request.

http://github.com/fzs/gitblit/commit/61a531375bce91dd2c8c8a5170542d2e800a8f67

Best regards,
Florian

Reported by f.zschocke on 2013-08-13 16:22:18

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Hi Florian,

We can move forward with this idea.  We are going to run into trouble, however, with
supporting an empty prefix.

-J

Reported by James.Moger on 2013-08-14 12:54:09

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Merged to master

Reported by James.Moger on 2013-09-17 21:57:42

  • Status changed: Queued
  • Labels added: Milestone-1.4.0

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

1.4.0 released.

Reported by James.Moger on 2014-03-09 18:06:21

  • Status changed: Done

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 1.4.0 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants