git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: 牛旭 <niuxu16@nudt.edu.cn>
Cc: git <git@vger.kernel.org>
Subject: Re: recommendations for log enhancement
Date: Tue, 30 Jan 2018 14:11:06 -0800	[thread overview]
Message-ID: <CAGZ79kbYgTVw0LH6w14Ho_g0yy7XBLhoZO_vP71GHYf4JdmfYA@mail.gmail.com> (raw)
In-Reply-To: <63a7d2b3.8dd7.1613d72ec2f.Coremail.niuxu16@nudt.edu.cn>

On Sun, Jan 28, 2018 at 7:46 AM, 牛旭 <niuxu16@nudt.edu.cn> 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

      reply	other threads:[~2018-01-30 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05  3:24 Patch recommendation for replace invoke of error() to that of error_errno() 牛旭
2018-01-05  7:04 ` Jeff King
2018-01-28 15:46 ` recommendations for log enhancement 牛旭
2018-01-30 22:11   ` Stefan Beller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGZ79kbYgTVw0LH6w14Ho_g0yy7XBLhoZO_vP71GHYf4JdmfYA@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=niuxu16@nudt.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).