Subject: Re: [GSOC] Contributing to git.

From: Jakub Narebski <[email-masked]>
Date: Fri, 30 Mar 2012 12:05:22 +0100

On Fri, 30 Mar 2012, Jeff King wrote:
> On Fri, Mar 30, 2012 at 08:19:29AM +0530, jaseem abid wrote:
> 
> > 	1. Where can I find general instructions on "Contributing to git? "
> > more specifically, gitweb?
> 
> Documentation/SubmittingPatches in the git.git repository.

For GSoC we prefer if you had a public git repository with your stuff
(GitHub, repo.or.cz or wherever), and that patches were Cc-ed to mentor.

> > 	2. Where can I find coding standards for git? I am looking for the
> > git version of this document.
> 
> Documentation/CodingGuidelines

There are no special rules for JavaScript (and neither for that matter
for Perl), but:

  "As for more concrete guidelines, just imitate the existing code
   (this is a good guideline, no matter which project you are
   contributing to). It is always preferable to match the _local_
   convention. New code added to git suite is expected to match
   the overall style of existing code. Modifications to existing
   code is expected to match the style the surrounding code already
   uses (even if it doesn't match the overall style of existing code)."

For JavaScript this includes using subset of JSDoc in comments.

> > 	3. Is JavaScript code unit tested? I cant find much docs regarding
> > this anywhere.

No, there are no JavaScript tests at all, neither unit tests
nor procedural (integration) tests.

> Jakub can answer this much better than I can, but I suspect the answer
> is "no". We hardly have any javascript at all, and I doubt the gitweb
> tests cover the javascript bits.
> 
> If there is going to be a javascript-heavy SoC project, I think part
> of that should probably be adding some automated testing
> infrastructure. 

The problem with automated testing of JavaScript is integrating it with
our testsuite, which is run from command line and outputs TAP (Test 
Anything Protocol), so it can e.g. be run by 'prove'.

But even if the JavaScript tests would have to be run in browser (like
most of all of them seems to), having any automated test for gitweb's 
JavaScript code would be a very good idea.

P.S. I wonder how JavaScript-scriptable Veracity DVCS solved that...
-- 
Jakub Narebski
Poland