From: Kristian Høgsberg Date: Fri, 20 Jul 2007 14:45:24 GMT Subject: Re: [PATCH] Implement git commit as a builtin. Message-ID: <1184942724.26967.105.camel@hinata.boston.redhat.com> In-Reply-To: <1b46aba20707181427y12bd8b62pe30df61219e7c1f7@mail.gmail.com> On Wed, 2007-07-18 at 23:27 +0200, Carlos Rica wrote: > 2007/7/18, Kristian Høgsberg : > > + if (buffer) { > > + len = strip_lines(buffer, len); > > + > > + if (fwrite(buffer, 1, len, fp) < len) > > + die("could not write commit template: %s\n", > > + strerror(errno)); > > + } > .... > > + len = strip_lines(buffer, len); > > + > > + if (message_is_empty(buffer, len)) > > + die("* no commit message? aborting commit."); > > + > > Hi Kristian, you could call to the new stripspace() function > in builtin-stripspace.c, to reduce code in your file. The only > thing you should consider is that the new stripspace() > removes always the last '\n' in the file (if any), so you have to > add it when you need. Yup, I'm keeping an eye on all your changes, and it looks like it's all falling in place nicely. Once I have the last few pieces of functionality ported over I'll rebase and update builtin-commit to use the new functionality you've landed. A couple of things that might be interesting right now is: 1) pick out the test case I made for commit and get it upstream, and 2) take the changes I did to wt-status.c (making it able to run on a different index and output to a specified FILE pointer) and get that upstream. cheers, Kristian