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

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

From
Jeff King <peff@peff.net>
Date
Feb 16, 2010, 07:29 UTC
Message-ID
<20100216072958.GH2169@coredump.intra.peff.net>
In-Reply-To
<1266276411-5796-2-git-send-email-michael.lukashov@gmail.com>
On Mon, Feb 15, 2010 at 11:26:47PM +0000, Michael Lukashov wrote:
Show 13 quoted lines
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index 8654fa7..d3b9d8a 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> [...]
> @@ -224,7 +224,7 @@ static int update_local_ref(struct ref *ref,
>  
>  	if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
>  		if (verbosity > 0)
> -			sprintf(display, "= %-*s %-*s -> %s", SUMMARY_WIDTH,
> +			sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
>  				"[up to date]", REFCOL_WIDTH, remote,
>  				pretty_ref);

If you are refactoring, can all of these fetch lines just call print_ref_status, which handles the summary width stuff itself? The push and fetch formats are meant to be quite similar.

-Peff
Previous: Tay Ray ChuanNext: Michael Lukashov
Message 4 of 10 in “Refactoring: remove duplicated code”
  1. 0/4 Refactoring: remove duplicated codeMichael Lukashov, Feb 15, 2010
  2. 1/4 Refactoring: remove duplicated code from builtin-send-pack.c and transport.cMichael Lukashov, Feb 15, 2010
  3. Tay Ray ChuanFeb 16, 2010
  4. Jeff KingFeb 16, 2010
  5. 2/4 Refactoring: connect.c: move duplicated code to get_host_and_portMichael Lukashov, Feb 15, 2010
  6. Larry D'AnnaFeb 16, 2010
  7. 3/4 Refactoring: move duplicated code from builtin-pack-objects.c and fast-import.c to object.cMichael Lukashov, Feb 15, 2010
  8. Junio C HamanoFeb 16, 2010
  9. 4/4 Refactoring: remove duplicated code from builtin-checkout.c and merge-recursive.cMichael Lukashov, Feb 15, 2010
  10. Junio C HamanoFeb 16, 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.