Re: [PATCH] git-shell and git-cvsserver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Sunday, October 7, 2007 - 9:51 pm

Hi,

On Fri, 5 Oct 2007, Jan Wielemaker wrote:


I think this is a valuable contribution.  That's why I comment...

Please put a useful commit message (less like an email, more like 
something you want to read in git-log) at the beginning of the email, then 
a line containing _just_ "---", and after that some comments that are not 
meant to be stored in the history, like (I know this does not belong 
to...)

After that, there should be a diffstat, and then the patch.

The easiest to have this layout is to do a proper commit in git, use "git 
format-patch" to produce the patch, and then insert what you want to say 
in addition to the commit message between the "---" marker and the 
diffstat.

I strongly disagree (as you yourself, probably) with the notion that this 
does not belong into git-shell.



This is definitely wrong.  Use git_exec_path() instead.


Maybe rename this to cvsserver_args?


Please lose the spaces after the opening and before the closing brackets.  
And put spaces around the "=" sign.

It is really distracting to read different styles of code in the same 
project, and that's why we're pretty anal about coding styles.  Just have 
a look (in the same file) how we write things, and imitate it as closely 
as possible.


You have redundant "putenv(newpath);" in both clauses.  AFAICT putenv() is 
deprecated, too, and we use setenv() elsewhere.

In addition, I strongly suggest using strbuf:

	struct strbuf newpath = STRBUF_INIT;

	strbuf_addstr(&newpath, git_exec_path());
	if ((oldpath = getenv("PATH"))) {
		strbuf_addch(&newpath, ':');
		strbuf_addstr(&newpath, oldpath);
	}

	setenv("PATH", strbuf_detach(&newpath, NULL), 1);


... and then you call execv_git_cmd(), which already does all the details 
of setting up the exec dir correctly AFAIR.


And this is ugly.  If you want to support "cvs server", then just check 
for that string, and if it matches, return execl_git_cmd("cvsserver");

Otherwise proceed as in the original code.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git-shell and git-cvsserver, Jan Wielemaker, (Fri Oct 5, 5:53 am)
Re: [PATCH] git-shell and git-cvsserver, Miklos Vajna, (Fri Oct 5, 7:31 am)
Re: [PATCH] git-shell and git-cvsserver, Frank Lichtenheld, (Fri Oct 5, 8:07 am)
Re: [PATCH] git-shell and git-cvsserver, Johannes Schindelin, (Sun Oct 7, 9:51 pm)
Re: [PATCH] git-shell and git-cvsserver, Jan Wielemaker, (Mon Oct 8, 7:22 am)
Re: [PATCH] git-shell and git-cvsserver, Johannes Schindelin, (Tue Oct 9, 4:51 am)
[PATCH] Support cvs via git-shell, Johannes Schindelin, (Tue Oct 9, 7:33 am)
Re: [PATCH] Support cvs via git-shell, Frank Lichtenheld, (Tue Oct 9, 3:35 pm)
Re: [PATCH] Support cvs via git-shell, Johannes Schindelin, (Wed Oct 10, 6:29 am)
Re: [PATCH] Support cvs via git-shell, Frank Lichtenheld, (Wed Oct 10, 12:10 pm)