Re: recommendations for log enhancement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 28, 2018 at 7:46 AM, 牛旭 <niuxu16@xxxxxxxxxxx> wrote:
> Our team studies the consistent edits of git during evolution. And we find several missed edits in the latest release of git. For example, there are two consist edits we have figured out from historical commits:

Thanks for studying the code of Git. It will help the project in
bettering the code.
Welcome to the Git community!
Which version do you mean by "latest release" ?


> 1) . Version: git 2.3.9 – git-2.3.10
>        File: builtin/merge-tree.c
>
>         dst.size = size;
> -       xdi_diff(&src, &dst, &xpp, &xecfg, &ecb);
> +       if (xdi_diff(&src, &dst, &xpp, &xecfg, &ecb))
> +               die("unable to generate diff");
>         free(src.ptr);
>         free(dst.ptr);
>  }
>
> 2) .Version: git 2.3.9 – git-2.3.10
>       File: combine-diff.c
>
> -       xdi_diff_outf(&parent_file, result_file, consume_line, &state,
> -                     &xpp, &xecfg);
> +       if (xdi_diff_outf(&parent_file, result_file, consume_line, &state,
> +                         &xpp, &xecfg))
> +               die("unable to generate combined diff for %s",
> +                   sha1_to_hex(parent));
>         free(parent_file.ptr);
>
> Those two commits both add if structure and log messages for handling the return value of xdi_diff_outf().
> And in the latest release, we find one candidate that may also need log statements inserted:
> 1)  File: git-2.14.2/builtin/rerere.c
>
>      1  static int diff_two(const char *file1, const char *label1,
>      2                  const char *file2, const char *label2)
>      3  {
> ….
>     20          ret = xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
>     21
>     22          free(minus.ptr);
>     23          free(plus.ptr);
>     24          return ret;
>     25  }
> ...
> }
>
> There are more examples of consistent update and corresponding suggestions in attachment. It is so nice of you to read them and share me with your opinion on the correctness of our suggestion. Thanks a lot.

Thanks a lot for this suggestion and the suggestions in the attachment.

However these are less than optimal to consume for the project.
Care to make these changes as actual commits in your local repository
and then send patches?

See Documentation/SubmittingPatches
https://github.com/git/git/blob/master/Documentation/SubmittingPatches

Thanks,
Stefan




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux