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

Re: [PATCH v2 3/4] Refactoring: move duplicated code from builtin-pack-objects.c and fast-import.c to object.c

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2010, 19:35 UTC
Message-ID
<7vhbphm0rn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1266276411-5796-4-git-send-email-michael.lukashov@gmail.com>
Michael Lukashov <michael.lukashov@gmail.com> writes:
> The following functions are duplicated:
>
>   encode_header
what are the other duplicated ones ;-)?
> Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
> ---
Two comments:
 - encode_header() was a perfectly good name for a static function in
   these two contexts, but when lifted into public namespace, it is not
   clear enough anymore.  It is not clear "header" in what context you are
   talking about.  At least it should be encode_in_pack_object_header();
 - Look at what are in object.[ch]; they are all about "object" layer,
   that sits one level higher in the abstraction on top of the raw object
   data layer (e.g. read_sha1_file() and friends).  This function belongs
   to a layer that is even lower level than the raw object data (i.e. one
   particular implementation of the raw object data representations among
   others).
   It looks very out of place.  I would say that cache.h and sha1_file.c
   would probably be a better place, if nobody else finds a better
   alternative.

Other than that, I agree with the patch, including its choice of types involved.

Previous: Michael LukashovNext: Michael Lukashov
Message 8 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.