git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Alex Riesen <raa.lkml@gmail.com>, Jeff King <peff@peff.net>,
	layer <layer@known.net>,
	git@vger.kernel.org
Subject: Re: [PATCH] Define a version of lstat(2) specially for copy operation
Date: Wed, 18 Mar 2009 11:56:31 -0700	[thread overview]
Message-ID: <7vprgeek2o.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 49C0C983.5060602@viscovery.net

Johannes Sixt <j.sixt@viscovery.net> writes:

> Sorry that I skip your elaboration on this. First, I barely understand
> read-cache.c; and second, I have the feeling that this is
> over-engineering: It introduces a genericity that we don't need in
> practice.

That's Ok.  The whole speculation depended on your answer to (2) being
"yes", and because it is not the case, you can safely skip it.

I just wanted to see if we can sprinkle a handful of lstat_remainder()
calls that disappear on POSIX side without changing anything else, which
would be the least impact solution from my point of view.

> But that wouldn't be different in principle from Alex's patch that
> introduced lstat_for_copy(), would it? Since it would be used in exactly
> the same strategic places.

Hm, I sort of agree.

If you imagine somebody with POSIX background who is new to git's codebase
and is trying understand the resulting code, I thought lstat() followed by
lstat_remainder() is conceptually slightly easier to explain ("'remainder'
is needed on platforms whose lstat() do not get the x-bit right, and we
use it only where it matters"), but I do not think the difference is that
great.

You need to explain when to add the "remainder" one after an existing
lstat() call in this API, or you need to explain when to replace an
existing lstat() with "for copy" in the Alex's API.  Either way you need
to contaminate the generic codepath with the distasteful concept that "On
some platforms, you lstat() may not do what you asked it to do".

And that was what I was unhappy about Alex's patch to begin with.  Not the
"patch" nor "Alex", but the fact that we have to deal with the "issue".

And lstat() followed by lstat_remainder() does not solve that issue at
all.  So let's scrap this lstat_fast()/lstat_remainder().

  reply	other threads:[~2009-03-18 18:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 16:26 [PATCH] disable post-checkout test on Cygwin Alex Riesen
2009-03-17 16:52 ` Junio C Hamano
2009-03-17 16:59   ` Johannes Sixt
2009-03-17 20:28     ` Alex Riesen
2009-03-17 20:42       ` Junio C Hamano
2009-03-17 21:38         ` [PATCH] Define a version of lstat(2) specially for copy operation Alex Riesen
2009-03-18  3:17           ` Mark Levedahl
2009-03-18  7:22           ` Alex Riesen
2009-03-18  7:41           ` Junio C Hamano
2009-03-18  7:56             ` Johannes Sixt
2009-03-18  9:30               ` Junio C Hamano
2009-03-18 10:14                 ` Johannes Sixt
2009-03-18 18:56                   ` Junio C Hamano [this message]
2009-03-17 20:34   ` [PATCH] disable post-checkout test on Cygwin Alex Riesen

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=7vprgeek2o.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=layer@known.net \
    --cc=peff@peff.net \
    --cc=raa.lkml@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).