git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elazar Leibovich <elazar.leibovich@oracle.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git mailing list <git@vger.kernel.org>,
	idan brown <idan.brown@oracle.com>,
	Liran Alon <liran.alon@oracle.com>,
	Eyal Moscovici <eyal.moscovici@oracle.com>,
	nikita.leshchenko@oracle.com
Subject: Re: Unfortunate interaction between git diff-index and fakeroot
Date: Fri, 8 Dec 2017 11:48:40 +0200	[thread overview]
Message-ID: <a770d158-c472-206f-dcdc-55cea0cf308f@oracle.com> (raw)
In-Reply-To: <xmqqzi6ueern.fsf@gitster.mtv.corp.google.com>


On 12/07/2017 05:31 PM, Junio C Hamano wrote:
> Correct.  fakeroot would report that the files that are actually
> owned by the user who is running fakeroot are owned by root; the
> cached stat information in the index would be "corrected" to say
> that they are owned by root.  So once the index is refreshed like
> so, things will become consistent.
I still fail to understand, what's the benefit of storing the owner ID in
the index, where no one seems to use this information.
I mean, one could store many other meta information in the index, such as
ACL lists,  number of blocks allocated, etc, but the code seems to
ignore unused information, such as commit 
2cb45e95438c113871fbbea5b4f629f9463034e7
which ignores st_dev, because it doesn't actually matter, or
commit e44794706eeb57f2ee38ed1604821aa38b8ad9d2 which ignores
mode changes not relevant to the owner.

In which situation does anyone care about the owner UID?
What's the difference between that, and, e.g., st_dev?
> If you are using "diff-index" for the "is the tree dirty?" check
> without running "update-index --refresh", then you are not using
> the command correctly.
Just want to clarify. It seems like the linux kernel is using diff-index
to do just that, in scripts/setlocalversion

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/setlocalversion#n77

Do I understand correctly that linux should update the index
first, or better, use porcelain "git diff --name-only" instead?

It seems to be the case previously, but in commit 
cdf2bc632ebc9ef512345fe8e6015edfd367e256
git update-index was removed, to prevent error messages on
read-only linux tree.

Do I understand correctly that the more correct solution
for modern git, is to use git diff --name-only instead? It should
work on read-only as well as on read-write trees, and
would not break if anyone uses git under fakeroot.

Did I understand you correctly?

  reply	other threads:[~2017-12-08  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  9:03 Unfortunate interaction between git diff-index and fakeroot Elazar Leibovich
2017-12-07 15:31 ` Junio C Hamano
2017-12-08  9:48   ` Elazar Leibovich [this message]
2017-12-08 15:38     ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a770d158-c472-206f-dcdc-55cea0cf308f@oracle.com \
    --to=elazar.leibovich@oracle.com \
    --cc=eyal.moscovici@oracle.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=idan.brown@oracle.com \
    --cc=liran.alon@oracle.com \
    --cc=nikita.leshchenko@oracle.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).