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

Re: bug report on update-index --assume-unchanged

From
Philip Oakley <philipoakley@iee.org>
Date
Dec 5, 2014, 20:04 UTC
Message-ID
<12536C063959480083CC2D4CBA0BA38E@PhilipOakley>
In-Reply-To
<xmqq1toeq79b.fsf@gitster.dls.corp.google.com>
From: "Junio C Hamano" <gitster@pobox.com>
Show 30 quoted lines
> Sérgio Basto <sergio@serjux.com> writes:
>
>
>> On Sex, 2014-12-05 at 17:52 +0700, Duy Nguyen wrote:
>>> On Fri, Dec 5, 2014 at 1:55 PM, Johannes Sixt <j6t@kdbg.org> wrote:
>>> > Actually, it's a user error. When you set --assume-unchanged, then
>>> > you give
>>> > a promise to git that you do not change the files, and git does
>>> > not have to
>>> > check itself whether there is a change.
>>> >
>>> > But since you did not keep your promise, you get what you deserve.
>>> > ;-)
>>
>>
>> No, I marked with assume-unchanged *after* change the file , and not
>> before. Else don't see what is the point of assume-unchanged if you
>> really don't change the file.
>
> That "unchanged" is relative to what is in the index.
>
> Your promise is "these paths I will not modify" and in return you
> gain performance in "git status" as the promise allows Git not to
> check with lstat() if the files in the workng tree was modified and
> instead assume that you didn't change them.  That is the point of
> assume-unchanged bit.
>
> If however you did something that made Git notice that you changed
> these paths marked with assume-unchanged bit anyway, then Git will,
> well, notice that they are not "unchanged" as you promised.

The problem here is that there is no guidance on what those actions are that may make git 'notice'. The man page git-update-index isn't as clear as it could be. Using --really-refresh being one option that would make git notice, but I wouldn't know when that is used.

Part of the implied question is why "git commit ." would notice when when "git commit -a" didn't appear to. So it's unclear as to what the user should have expected.

(Note, I don't use assume-unchanged myself so this is more about supporting the user/manual clarification. It is mentioned moderately often on stackoverflow etc.)

-- Philip

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 19 in “GIT: ignoring changes in tracked files and bug report”
  1. Sérgio BastoDec 4, 2014
  2. bug report on update-index --assume-unchangedSérgio Basto, Dec 5, 2014
  3. Johannes SixtDec 5, 2014
  4. Duy NguyenDec 5, 2014
  5. Sérgio BastoDec 5, 2014
  6. Junio C HamanoDec 5, 2014
  7. Philip OakleyDec 5, 2014
  8. Junio C HamanoDec 5, 2014
  9. Philip OakleyDec 5, 2014
  10. Andreas SchwabDec 5, 2014
  11. Sérgio BastoDec 6, 2014
  12. Philip OakleyDec 6, 2014
  13. Junio C HamanoDec 5, 2014
  14. Sérgio BastoDec 5, 2014
  15. Junio C HamanoDec 5, 2014
  16. Junio C HamanoDec 5, 2014
  17. commit: ignore assume-unchanged files in "commmit <file>" modeNguyễn Thái Ngọc Duy, Dec 5, 2014
  18. Sérgio BastoDec 9, 2014
  19. Philip OakleyDec 11, 2014

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.