git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Buchacher <drizzd@aon.at>
To: Junio C Hamano <gitster@pobox.com>
Cc: Avery Pennarun <apenwarr@gmail.com>, git@vger.kernel.org
Subject: Re: update-index --really-refresh unsets assume-unchanged bit
Date: Wed, 5 May 2010 17:44:59 +0200	[thread overview]
Message-ID: <20100505154459.GA24447@localhost> (raw)
In-Reply-To: <7v39y7mglb.fsf@alter.siamese.dyndns.org>

On Tue, May 04, 2010 at 03:45:20PM -0700, Junio C Hamano wrote:
> Clemens Buchacher <drizzd@aon.at> writes:
> 
> > On the contrary. I _want_ git to assume the file is unchanged, even though I
> > know it changed. This is an intended and documented use case (from the
> > git-update-index manpage):
> 
> The intended use of *really* one is to ignore the assume unchanged bit and
> make the bit reflect reality.

Yes, and right below the part you are quoting I explained why this is not
what it does either.

> The bit was originally invented back when
> the machinery was too lstat(2) heavy so that people on slow filesystems
> can say "I haven't changed these paths, and I promise I won't, so you can
> trust this and assume that the working tree file exactly matches what is
> recorded in the index."  Obviously we needed to give such users an way to
> tell git that they broke their promise, and that is what *really* refresh
> meant to give.

Yes, but after the index is refreshed, the file is now, again, unchanged.
Yet, the assume-unchanged bit is unset.

But there is no reason presume that the user will break their promise again
in the future. If they plan to do so, they can always use git update-index
--no-assume-unchanged.

> Note that the promise is _different_ from telling "I may or may not have
> changed the work tree files, but don't bother telling me that I did".  The
> promise you make by "assume unchanged" bit allows git to read from the
> working tree file when it needs the contents of blob recorded in the index
> and the bit is set, as you promised that you will never change it.

And in what case does git do that? I can only find commands which read from
the object store and not from the work tree. This would also break the
"ignore changes to tracked files" use case.

Clemens

      reply	other threads:[~2010-05-05 15:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-01  9:25 [PATCH 1/2] do not overwrite files marked "assume unchanged" Clemens Buchacher
2010-05-01  9:27 ` [PATCH 2/2] Documentation: git-add does not update " Clemens Buchacher
2010-05-04  8:57   ` update-index --really-refresh unsets assume-unchanged bit Clemens Buchacher
2010-05-04 16:41     ` Avery Pennarun
2010-05-04 19:41       ` Clemens Buchacher
2010-05-04 22:45         ` Junio C Hamano
2010-05-05 15:44           ` Clemens Buchacher [this message]

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=20100505154459.GA24447@localhost \
    --to=drizzd@aon.at \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).