Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-24 Thread Paul Tan
On Mon, Mar 23, 2015 at 6:18 PM, Duy Nguyen wrote: > Could you share these changes? I'm just wondering if we can add kcov > support to the test suite. In this case it's more of an embarrassing hack, as I just needed a way to make git run "kcov outdir git-pull.sh" whenever git pull is called since

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-23 Thread Duy Nguyen
On Sat, Mar 21, 2015 at 8:23 PM, Paul Tan wrote: > I see git already has gcov support. For shell scripts, maybe kcov[1] > could be used. With some slight code changes, I managed to generate a > report for the git-pull tests[2] which should at least provide a good > starting point for how the tests

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-23 Thread Johannes Schindelin
Hi Paul, On 2015-03-22 18:39, Paul Tan wrote: > The code coverage tools can help here as well. The kcov output clearly > shows which options of git-pull are currently not being tested. But > yes, I agree that the test suite shouldn't be relied too much on > compared to code inspection and review.

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-22 Thread Paul Tan
Hi, On Sun, Mar 22, 2015 at 1:35 AM, Johannes Schindelin wrote: >> Maybe code coverage tools could help here so we only need to focus on >> the code paths that are untested by the test suite. At the minimum, >> all of the non-trivial code paths in both the shell script and the >> converted builti

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-21 Thread Johannes Schindelin
Hi Paul, On 2015-03-21 14:23, Paul Tan wrote: > Thanks for the review, though I would like to work on the proposal now > before the deadline passes :) That makes sense. > On Thu, Mar 19, 2015 at 1:52 AM, Matthieu Moy > wrote: >> Paul Tan writes: >> >>> Ideally, I think the solution is to >>>

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-21 Thread Johannes Schindelin
Hi Paul, On 2015-03-21 15:00, Paul Tan wrote: > Thanks for your suggestions, I agree with most of them :). > > On Wed, Mar 18, 2015 at 5:00 PM, Johannes Schindelin > wrote: >>> +static int parse_opt_rebase(const struct option *opt, const char >>> *arg, int unset) >>> +{ >>> + if (arg) >>> +

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-21 Thread Paul Tan
Hi, Thanks for your suggestions, I agree with most of them :). On Wed, Mar 18, 2015 at 5:00 PM, Johannes Schindelin wrote: >> +static int parse_opt_rebase(const struct option *opt, const char >> *arg, int unset) >> +{ >> + if (arg) >> + *(int *)opt->value = parse_rebase(arg); >>

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-21 Thread Paul Tan
Hi, On Thu, Mar 19, 2015 at 6:26 AM, Junio C Hamano wrote: > Paul Tan writes: > >> +/* Global vars since they are used often */ >> +static char *head_name; >> +static const char *head_name_short; >> +static unsigned char head_sha1[20]; >> +static int head_flags; >> + >> +enum rebase_type { >> +

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-21 Thread Paul Tan
Hi, Thanks for the review, though I would like to work on the proposal now before the deadline passes :) On Thu, Mar 19, 2015 at 1:52 AM, Matthieu Moy wrote: > Paul Tan writes: > >> Ideally, I think the solution is to >> improve the test suite and make it as comprehensive as possible, but >> wr

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-18 Thread Junio C Hamano
Paul Tan writes: > +/* Global vars since they are used often */ > +static char *head_name; > +static const char *head_name_short; > +static unsigned char head_sha1[20]; > +static int head_flags; > + > +enum rebase_type { > + REBASE_FALSE = 0, > + REBASE_TRUE = 1, > + REBASE_PRESERVE =

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-18 Thread Matthieu Moy
Hi, First of all, thanks a lot for working on this. I'm rather impressed to see a working proof of concept so soon! And impressed by the quality for a "first draft". A few minor remaks below after a very quick look. Paul Tan writes: > Ideally, I think the solution is to > improve the test suit

RE: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-18 Thread Johannes Schindelin
Hi Stephen, On 2015-03-18 09:38, Stephen Robin wrote: >> Paul Tan writes: >> I would like to share this very rough prototype with everyone. > ... >> I started this as a just-for-fun exercise to learn about the git internal > API > > I started to rewrite git-pull for similar reasons a couple of mo

Re: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-18 Thread Johannes Schindelin
Hi Paul, thank you for this very detailed mail. It was a real pleasure to read this well-researched document. In the following, I will pick out only parts from the mail, in the interest of both of our time. Please assume that I agree with everything that I do not quote below (and even the with

RE: [PATCH/RFC/GSOC] make git-pull a builtin

2015-03-18 Thread Stephen Robin
> Paul Tan writes: > I would like to share this very rough prototype with everyone. ... > I started this as a just-for-fun exercise to learn about the git internal API I started to rewrite git-pull for similar reasons a couple of months ago, but I haven't had time to complete it. It looks like

[PATCH/RFC/GSOC] make git-pull a builtin

2015-03-17 Thread Paul Tan
The git-pull command is currently implemented by the shell script git-pull.sh. However, git-pull.sh suffers from some problems: * Inconsistent command line interface: since git-pull.sh does not use git's internal parse-options API, it's command line interface is inconsistent with other git bui