git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/4] Refactoring: remove duplicated code from transport.c and builtin-send-pack.c

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Feb 15, 2010, 03:29 UTC
Message-ID
<be6fef0d1002141929x1c0f48eekb7112463110cd275@mail.gmail.com>
In-Reply-To
<1266182863-5048-1-git-send-email-michael.lukashov@gmail.com>
Hi,

On Mon, Feb 15, 2010 at 5:27 AM, Michael Lukashov <michael.lukashov@gmail.com> wrote:

Show 12 quoted lines
> The following functions are duplicated:
>
>  verify_remote_names
>  update_tracking_ref
>  print_ref_status
>  status_abbrev
>  print_ok_ref_status
>  print_one_push_status
>  refs_pushed
>  print_push_status
>
> Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>

strictly speaking, the implementation for these functions are different. Perhaps you could advertise in the commit message that some of the functions from builtin-send-pack.c learnt porcelain, even though it's always off (0).

Show 10 quoted lines
> diff --git a/builtin-send-pack.c b/builtin-send-pack.c
> index 76c7206..616811a 100644
> --- a/builtin-send-pack.c
> +++ b/builtin-send-pack.c
> [snip]
> @@ -191,37 +191,47 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref)
>        }
>  }
>
> -#define SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)

hmm, since this is only used internally by print_ref_status, can't this stay here rather than being made public in send-pack.h?

-- 
Cheers,
Ray Chuan
Previous: Michael LukashovNext: Jeff King
Message 6 of 12 in “Refactoring: remove duplicated code from transport.c and builtin-send-pack.c”
  1. 1/4 Refactoring: remove duplicated code from transport.c and builtin-send-pack.cMichael Lukashov, Feb 14, 2010
  2. 2/4 Refactoring: connect.c: move duplicated code to get_host_and_portMichael Lukashov, Feb 14, 2010
  3. Johannes SixtFeb 15, 2010
  4. 3/4 Refactoring: move duplicated code from builtin-pack-objects.c and fast-import.c to object.cMichael Lukashov, Feb 14, 2010
  5. 4/4 Refactoring: remove duplicated code from builtin-checkout.c and merge-recursive.cMichael Lukashov, Feb 14, 2010
  6. Tay Ray ChuanFeb 15, 2010
  7. Jeff KingFeb 15, 2010
  8. Junio C HamanoFeb 15, 2010
  9. Jeff KingFeb 15, 2010
  10. Ilari LiusvaaraFeb 15, 2010
  11. Daniel BarkalowFeb 15, 2010
  12. Larry D'AnnaFeb 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.