git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: "Оля Тележная" <olyatelezhnaya@gmail.com>
Cc: git <git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] [Outreachy] cleanup: use list.h in mru.h and mru.c
Date: Wed, 27 Sep 2017 13:30:00 +0200	[thread overview]
Message-ID: <CAP8UFD24A8rxMfLMFmSStWnBMMeB58SqUdNoo3niQuc7LqRMMg@mail.gmail.com> (raw)
In-Reply-To: <CAL21BmnvJSaN+Tnw7Hdc5P5biAnM5dfWR7gX5FrAG1r_D8th=A@mail.gmail.com>

About the title, we don't usually start with "fix:" or "cleanup:" or
"feature:". We usually start with the (main) area of the code that is
changed.

So maybe something like "mru: use double-linked list implementation
from list.h" would be better.

On Wed, Sep 27, 2017 at 12:18 PM, Оля Тележная <olyatelezhnaya@gmail.com> wrote:
> Remove implementation of double-linked list in mru.c and mru.h and use
> implementation from list.h.

It is important in the commit message to get a good idea of the reason
why the patch is a good thing.
So for example "Simplify mru.c, mru.h and related code by reusing the
double-linked list implementation from list.h instead of a custom
one." could be a bit better.

> Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
> Mentored-by: Christian Couder <christian.couder@gmail.com>, Jeff King
> <peff@peff.net>

I think it's better if Peff is on another "Mentored-by: ..." line.

> ---
>  builtin/pack-objects.c |  5 +++--
>  mru.c                  | 51 +++++++++++++++-----------------------------------
>  mru.h                  | 31 +++++++++++++-----------------
>  packfile.c             |  6 ++++--
>  4 files changed, 35 insertions(+), 58 deletions(-)

Here we can see that saying that we simplify things is probably true
as the patch deletes more lines than it adds.

> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index f721137ea..fb4c9be89 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -995,8 +995,8 @@ static int want_object_in_pack(const unsigned char *sha1,
>          struct packed_git **found_pack,
>          off_t *found_offset)
>  {
> - struct mru_entry *entry;
>   int want;
> +        struct list_head *pos;

It looks like there are indentation problems in the patch.

Did you try to send it to you and apply what you received?

When I try to apply it to master I get:

> git am ~/Downloads/original_msg.txt
Applying: cleanup: use list.h in mru.h and mru.c
.git/rebase-apply/patch:18: indent with spaces.
        struct list_head *pos;
.git/rebase-apply/patch:152: indent with spaces.
        void *item;
error: patch failed: builtin/pack-objects.c:995
error: builtin/pack-objects.c: patch does not apply
error: patch failed: mru.c:1
error: mru.c: patch does not apply
error: patch failed: mru.h:8
error: mru.h: patch does not apply
error: patch failed: packfile.c:876
error: packfile.c: patch does not apply
Patch failed at 0001 cleanup: use list.h in mru.h and mru.c
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

I am stopping here as it's quite difficult to read patches that have
indentation problems.

  reply	other threads:[~2017-09-27 11:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 10:18 [PATCH] [Outreachy] cleanup: use list.h in mru.h and mru.c Оля Тележная
2017-09-27 11:30 ` Christian Couder [this message]
2017-09-28  8:38   ` [PATCH Outreachy] mru: use double-linked list from list.h Olga Telezhnaya
2017-09-28 11:03     ` Junio C Hamano
2017-09-28 20:47       ` Jeff King
2017-09-28 21:56         ` Junio C Hamano
2017-09-28 22:19           ` Jeff King
2017-09-28 21:04     ` Jeff King
2017-09-28 22:42     ` Jeff King
2017-09-29  7:18       ` Christian Couder
2017-09-29  7:23         ` Jeff King
2017-09-29 11:50           ` Christian Couder
2017-09-29 16:08             ` Оля Тележная
2017-09-29 20:38               ` Оля Тележная
2017-09-29 23:40                 ` Jeff King
2017-09-30 18:09                   ` Оля Тележная
2017-10-02  8:22                     ` Jeff King
2017-09-29 23:37               ` Jeff King
2017-09-30  0:07                 ` Junio C Hamano
2017-09-30 17:51     ` [PATCH v2 " Olga Telezhnaya
2017-10-02  8:20       ` Jeff King
2017-10-02  9:37         ` Оля Тележная
2017-10-03 10:10           ` Jeff King
2017-11-08  1:44         ` Junio C Hamano
2017-11-08  4:22           ` Jeff King
2017-11-10 11:51             ` Оля Тележная

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=CAP8UFD24A8rxMfLMFmSStWnBMMeB58SqUdNoo3niQuc7LqRMMg@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=olyatelezhnaya@gmail.com \
    --cc=peff@peff.net \
    /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).