Hi All
Git Commit Logs is a simple module which pull git logs (date, author, email, message, hash fields) from the provided git project URL in a node and store them in database against node nid.
This can be used if one want to see his/her module/project logs automatically pulled and stored into database. This module has views integration so one can show logs in any format and place.
Dependencies : Git should be installed on machine and accessible from command line.
Steps to take to make it working
1. Install GIT if not
2. Install this module
3. Edit any content type, then enable git logs from there.
4. Here you go, create a node and provide git project url
A live demo can be found at: http://www.srijan.in/resources/modules/typo3-migrate-module
Project Sandbox (Drupal 6) : http://drupal.org/project/1293404/git-instructions
Thanks
Kuldev
Comments
Comment #1
elc commentedIt appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Comment #2
devtherock commentedHi ELC
Thank you very much for the review, regarding
There should be no space after the opening "(" of a control structurewhile coder module suggest to give space around statements and values, Could you please suggest which one should follow ?Thanks
Comment #3
elc commentedThe above errors are straight out of coder I think .. or maybe soemthing separate. The Coding Standards are what everything is based off. http://drupal.org/coding-standards
Basically, if you have a control statement like this
It is fixed like this
and here
to this
Comment #4
devtherock commentedThank you so much ELC
So I here is list what I have done
1. Created a 6.x branch and committed my latest code in it
2. README.txt: removed unnecessary text from the file
3. Fixed all errors in the above report
Thanks
Kuldev
Comment #5
elc commentedUpdating status.
Comment #6
doitDave commentedHi,
Automated review (Please keep in mind that this is primarily a high level check that does not replace but, after all, eases the review process. There is no guarantee that no other issues could show up in a more in-depth manual follow-up review.)
Review of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Manual review:
hth, dave
Comment #7
misc commented@devtherock has been contacted to ask if the application is abandoned.
http://drupal.org/node/894256
Comment #8
misc commentedThe application has been closed. If you would like to reopen it, you are free to do so.
See http://drupal.org/node/894256#abandonedtwoweekscontact
Comment #9
crazyrohila commentedI am co-maintainer of this project. Last days were quite busy. Now This project is under active maintaining. All Above errors are resolved. Now I am putting this issue on "needs review".
Comment #10
firebird commentedIn the install file, line 33: " 'description' => 'Email address of auther',"
I think that should be "author", as in the field above it.
In the module file:
Line 84, the header labels should be wrapped in t().
Line 91, the line adding the submit handler is commented out. Why?
Line 116, "Project URL can't contains invalid character." would be better
something like this: "Project URL may not contain invalid characters."
Function function git_commit_logs_read_gitlogs(): Have you made certain that
it's not possible to alter directories other than the intended ones on the
server? This might be possible by entering an invalid git repository URL, for
example by adding "../../" in the URL. What about adding semicolons and
arbitrary commands in the URL string? In any case, code that alters the server
directory structure based on user input is something that you should triple
check.
Automated check at http://ventral.org/pareview revealed quite a few coding
standard violations:
Comment #11
crazyrohila commentedsolved above errors. That was because of new code to pull logs from all branches rather than master branch.
Comment #12
soncco commentedThe last one :)
Comment #13
crobinson commentedThis looks like a very useful module, and I look forward to it becoming a full project. If/when it does, if you would like a collaborator to work on the Drupal 7 port, please let me know - I would be happy to help.
1. Language suggestion for checkbox "Check if you want to use this content type for git logs" could be just "Import Git Logs".
2. Make git_commit_logs path configurable. The risk of conflict here is lower than with some modules but it still exists.
3. There is a security risk here that you need to address. You are cloning the Git project into a public files directory. What if the project is not public code? The user might assume that by not publishing the node, or using content access control, that this information will not be available to everybody. But an anonymous user could access this directory with no protections. There are many possible solutions but all have trade-offs: I cannot say what is right here. .htaccess? Removing the directory once processed?
4. Another security risk: You are using user-generated input in very dangerous ways such as in exec commands. You must sanitize these inputs. ($folder, $project_url, etc.) It is not enough to call check_url() here. That only prepares URLs for embedding into an HTML page, not for passing to exec().
You should also review the language input filters and similar modules display to users when configuring them. This module could be just as dangerous as php_filter if not used correctly.
I see that you are doing some sanitizing in the form _validate() handler but you should also do it in the actual callback because there are many ways (like through Drush, other add-on modules, possible mistakes in code, or perhaps you improve the rules but an existing site already has a bad URL) that this check can be bypassed.
You should also note that you are doing this in your README.txt:
a. That you require "git" to be in the Web server processes' path.
b. That you use exec() to call it. Sites with safe_mode, limited lists of PHP functions, restrictions against calling out-of-directory binaries, etc. may not be able to use this module.
5. git_commit_logs_git_user_email() has a confusing name because it operates on both author and email fields. Consider renaming it. Also, it looks like it's doing double work because it's always called twice in a row. Why not return an array with both values?
becomes:
6. SUGGESTION: Provide a setting to pass to git clone to control --depth. On very large Git projects this tool takes a LONG time to clone. My browser timed out and the node save failed. It would help to also be able to limit the git log command to N entries.
7. SUGGESTION: Provide control over the branches tracked. It looks like you're reading them all. On a test project with 5,000 commits and 25 branches my CRON used 100% CPU for several minutes. The user should at least me warned about this possibility, or allowed control.
8. There is still one error in automated review: http://ventral.org/pareview/httpgitdrupalorgsandboxdevtherock1293404git. But actually you have many moer that the tool is not picking up because you are using so many delimiters that I think it cannot keep track. For example, in line 148 you have a block of code indented an extra level. It is below an exec with a command chain and I think this is throwing off the checker, but it should still be fixed.
Comment #14
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.