commit log accounts not linking to drupal users
konsumer - October 30, 2008 - 09:58
| Project: | Version Control API |
| Version: | 6.x-1.0-beta5 |
| Component: | API module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | CorniI |
| Status: | closed |
Description
I can't seem to get my git accounts to sync to a drupal account.
Here is an example commit log:
Commit cf4c450d53c7077a57cbd6e759df1a0d1463da61 by David Konsumer at 23:26 in Drupal 5 Base: (154 lines added, 0 lines removed)
master: /
* asset_source/borders.svg (added)
Added asset for making rounded corners/shadows in base themeAs you can see, the user is "David Konsumer" the user account used to submit it was "konsumer", and I am tying to link it to the drupal account "konsumer".
I created a link from konsumer to konsumer, and that didn't show my commit logs, so I attempted to link to "David Konsumer" and I get:
The specified Git username is invalid.
I'm not sure where to submit the issue (is this a Git sub-module) issue, or if I am even using the module correctly (is this a support issue? I'm not sure.)

#1
Version Control API seems to be responsible for that: in versioncontrol.pages.inc, versioncontrol_account_edit_form_validate(), it restricts user name registrations to alphanumeric characters only. That makes a lot of sense for CVS and SVN, but might not be such a good idea when considering arbitrary (email-display-name-based) user names like in Git. I wonder how to best delegate that decision to the backends, hm...
#2
Still not solved in 5.x-2.0, sorry.
#3
I am currently working on a stand-alone Git read/write class. I have implemented a basic manager for git repos (much like ViewGit) in Drupal module, using email to cross-link users. It works really well, but I would like for it to be a part of the Version control API. Any help that anyone can provide would be much appreciated. What is needed to combine these efforts with the other Git/VCS stuff?
#4
First step, I'd say, is looking at the git vcs project, since that's where such things would live. Write operations aren't much supported at the moment, though; it's something that I VERY much want to work on in the future, but there are steps between here and there.
#5
Much of the git backend's code might be obsolete though when it's updated to the 5.x-2.x API, it doesn't need to be that complex anymore. Also, a git interface class might help implementing the git backend's repository browsing support (get_item(), get_directory_contents(), get_file_copy() & Co.). Repoview should even be able to display the basic repository contents without having the existing git log parser ported as a prerequisite.
This belongs in a separate issue though, I would think that the git backend's issue queue would be the best place to continue this discussion, it's just a bit off-topic in here.
#6
Had the same problem with svn. Resolved by hacking versioncontrol.pages.inc
#7
@neptunix: Aren't SVN usernames required to be lowercased and stuff? Anyways, seems like it's high time to split this check off into an optional backend function.
#8
Moving to 6.x-1.x, won't be backported to 5.x-* (at least not by myself, and any patch should target the current version first).
#9
I think this should be a backend-specific API function, like
versioncontrol_is_valid_username($repository, $username)respectivelyversioncontrol_[backend]_is_valid_username($repository, $username). versioncontrol.pages.inc should then just use that function to check whether it should set an error or not....any takers?
#10
it's me :)
#11
here's a patch adding the usage of a new api call, is_invalid_username($repo, $username) for cheking if a username is ok for a specific backend.
#12
patch was crap, another try...
#13
Looks great! The only thing I forgot to mention in IRC (sorry) is that backend-implementable API functions should be documented in the FakeVCS backend by provding apidox for the function, and a short example implementation. (The ereg() version from versioncontrol.pages.inc would be totally sufficient... apart from PHP suggesting preg_match() instead, maybe we should switch to that one altogether?)
#14
ok
i still have to practise with git-format-patch, now i offer you two patches...
#15
I added a lot more to your patch (felt like solving the whole problem area surrounding this issue), fixed a bug in the patch and a bug that existed previously, and committed all of it in commit #192592. Thanks for getting involved, I'm glad this is fixed now :)
#16
Note: Of course, other backends with different needs than CVS still need to implement stuff (versioncontrol_[vcs]_is_account_username_valid() and versioncontrol_[vcs]_account_username_suggestion()) if they want to improve the current situation. Both are documented in versioncontrol_fakevcs.module.
#17
Automatically closed -- issue fixed for 2 weeks with no activity.