From: Tay Ray Chuan <rctay89@gmail.com>
To: Michael Lukashov <michael.lukashov@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/4] Refactoring: remove duplicated code from builtin-send-pack.c and transport.c
Date: Tue, 16 Feb 2010 10:16:13 +0800 [thread overview]
Message-ID: <20100216101613.4ce36ee1.rctay89@gmail.com> (raw)
In-Reply-To: <1266276411-5796-2-git-send-email-michael.lukashov@gmail.com>
Hi,
On Mon, 15 Feb 2010 23:26:47 +0000
Michael Lukashov <michael.lukashov@gmail.com> wrote:
> The following functions are (almost) identical:
>
> verify_remote_names
> update_tracking_ref
> print_ref_status
> status_abbrev
> print_ok_ref_status
> print_one_push_status
> refs_pushed
> print_push_status
>
> Move common versions of these functions to transport.c and rename them,
> as suggested by Jeff King and Junio C Hamano
this is misleading. This list should the 4 functions added to
transport.h. Some of the functions have been removed entirely from
builtin-send-pack.c and aren't renamed at all (eg. print_ref_status,
print_one_push_status).
For these, you could put them in another list, and say that "they have
been removed entirely and will not be made public, since they are only
used internally by print_push_status()."
> diff --git a/transport.c b/transport.c
> index 3846aac..0924288 100644
> --- a/transport.c
> +++ b/transport.c
> [snip]
> @@ -609,9 +609,8 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref, int verb
> }
> }
>
> -#define SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)
> -
> -static void print_ref_status(char flag, const char *summary, struct ref *to, struct ref *from, const char *msg, int porcelain)
> +static void print_ref_status(char flag, const char *summary, struct ref *to,
> + struct ref *from, const char *msg, int porcelain)
> {
> if (porcelain) {
> if (from)
Unrelated whitespace change in the method signature.
> @@ -687,7 +686,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
> break;
> case REF_STATUS_UPTODATE:
> print_ref_status('=', "[up to date]", ref,
> - ref->peer_ref, NULL, porcelain);
> + ref->peer_ref, NULL, porcelain);
> break;
> case REF_STATUS_REJECT_NONFASTFORWARD:
> print_ref_status('!', "[rejected]", ref, ref->peer_ref,
Unrelated whitespace change.
> @@ -711,8 +710,8 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
> return 1;
> }
>
> -static void print_push_status(const char *dest, struct ref *refs,
> - int verbose, int porcelain, int * nonfastforward)
> +void transport_print_push_status(const char *dest, struct ref *refs,
> + int verbose, int porcelain, int *nonfastforward)
> {
> struct ref *ref;
> int n = 0;
Unrelated whitespace change for the second line of the signature.
--
Cheers,
Ray Chuan
next prev parent reply other threads:[~2010-02-16 2:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-15 23:26 [PATCH v2 0/4] Refactoring: remove duplicated code Michael Lukashov
2010-02-15 23:26 ` [PATCH v2 1/4] Refactoring: remove duplicated code from builtin-send-pack.c and transport.c Michael Lukashov
2010-02-16 2:16 ` Tay Ray Chuan [this message]
2010-02-16 7:29 ` Jeff King
2010-02-15 23:26 ` [PATCH v2 2/4] Refactoring: connect.c: move duplicated code to get_host_and_port Michael Lukashov
2010-02-16 4:10 ` Larry D'Anna
2010-02-15 23:26 ` [PATCH v2 3/4] Refactoring: move duplicated code from builtin-pack-objects.c and fast-import.c to object.c Michael Lukashov
2010-02-16 19:35 ` Junio C Hamano
2010-02-15 23:26 ` [PATCH v2 4/4] Refactoring: remove duplicated code from builtin-checkout.c and merge-recursive.c Michael Lukashov
2010-02-16 19:41 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100216101613.4ce36ee1.rctay89@gmail.com \
--to=rctay89@gmail.com \
--cc=git@vger.kernel.org \
--cc=michael.lukashov@gmail.com \
/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.
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 NNTP newsgroup(s).