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

Re: [PATCH/RFC v1 3/6] cleanup of write_entry() in entry.c

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 28, 2009, 21:31 UTC
Message-ID
<7vy6wvkth1.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1233004637-15112-4-git-send-email-barvik@broadpark.no>
Kjetil Barvik <barvik@broadpark.no> writes:
Show 14 quoted lines
> The switch-cases for S_IFREG and S_IFLNK was so similar that it will
> be better to do some cleanup and use the common parts of it.
>
> Also fold the longest lines such that no line is longer then 80 chars
> or so.
>
> And the entry.c file should now be clean for 'gcc -Wextra' warnings.
>
> Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
> ---
>
> If people do not like this approach I can be willing to drop it from
> this patch-series, but then I get some source code duplication from
> the next patch (4/6).

Merging of the two similar codepaths looked good from a cursory reading, but if you have doubts about one patch, it usually is easier for other people to work with you if the series is reordered to have it near the end, iow, undisputably good ones first.

Show 5 quoted lines
> -			return error("git checkout-index: unable to read sha1 file of %s (%s)",
> -				path, sha1_to_hex(ce->sha1));
> +			return error("git checkout-index: "\
> +				     "unable to read sha1 file of %s (%s)",
> +				     path, sha1_to_hex(ce->sha1));

You lost greppability when somebody calls for help saying "I am getting an error message that says 'git checkout-index: unable to read sha1 file'".

Previous: Kjetil BarvikNext: Kjetil Barvik
Message 8 of 16 in “git checkout: more cleanups, optimisation, less lstat() calls”
  1. 0/6 git checkout: more cleanups, optimisation, less lstat() callsKjetil Barvik, Jan 26, 2009
  2. 1/6 symlinks.c: small cleanup and optimisationKjetil Barvik, Jan 26, 2009
  3. ??? Re: [PATCH/RFC v1 1/6] symlinks.c: small cleanup and optimisationJunio C Hamano, Jan 28, 2009
  4. Kjetil BarvikJan 29, 2009
  5. 2/6 remove some memcpy() and strchr() calls inside create_directories()Kjetil Barvik, Jan 26, 2009
  6. Junio C HamanoJan 28, 2009
  7. 3/6 cleanup of write_entry() in entry.cKjetil Barvik, Jan 26, 2009
  8. Junio C HamanoJan 28, 2009
  9. 4/6 use fstat() instead of lstat() when we have an opened fileKjetil Barvik, Jan 26, 2009
  10. 5/6 combine-diff.c: remove a call to fstat() inside show_patch_diff()Kjetil Barvik, Jan 26, 2009
  11. Mike RalphsonJan 27, 2009
  12. Kjetil BarvikJan 27, 2009
  13. Mike RalphsonJan 27, 2009
  14. Junio C HamanoJan 28, 2009
  15. Junio C HamanoJan 29, 2009
  16. Kjetil BarvikJan 29, 2009

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.