git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
To: GIT <git@vger.kernel.org>
Subject: git-diff-cache uses checked-out-working-directory-files if files are newer than the cache entry
Date: Fri, 6 May 2005 00:37:27 +0200	[thread overview]
Message-ID: <20050505223727.GR20994@cip.informatik.uni-erlangen.de> (raw)

Hello,
I have trouble with git-diff-cache, because it uses the file from the
working directory instead of the cache file if the working directory is
newer than the entry in the cache:

	(faui01) [~/work/git/git] echo 1 > 1
	(faui01) [~/work/git/git] ./git-update-cache --add 1
	(faui01) [~/work/git/git] ./git-diff-cache -r HEAD
	+100644 blob    d00491fd7e5bb6fa28c517a0bb32b8b506539d4d        1
	(faui01) [~/work/git/git] echo 2 > 1
	(faui01) [~/work/git/git] ./git-diff-cache -r HEAD
	+100644 blob    0000000000000000000000000000000000000000        1
	(faui01) [~/work/git/git] ./git-diff-cache -p -r HEAD
	Created: 1 (mode:100644)
	--- /dev/null
	+++ b/1
	@@ -0,0 +1 @@
	+2

Note this Output is wrong because the '1' get committed, if I call write-tree

	(faui01) [~/work/git/git] write-tree
	5a38ca90309671c5029f32f67e1aba970a4f1e08
	(faui01) [~/work/git/git] ./git-ls-tree 5a38ca90309671c5029f32f67e1aba970a4f1e08 | grep 1\$
	100644  blob    d00491fd7e5bb6fa28c517a0bb32b8b506539d4d        1
	040000  tree    9823f134bfb89097ce796f931d3efc92aadfcfbf        mozilla-sha1

Same for modification:

	(faui01) [~/work/git/git] echo 1 >> COPYING
	(faui01) [~/work/git/git] update-cache COPYING
	(faui01) [~/work/git/git] ./git-diff-cache -r HEAD
	*100644->100644 blob    6ff87c4664981e4397625791c8ea3bbb5f2279a3->c17665dc78a012a55b11d083bfa065d8cd2b0df1      COPYING
	(faui01) [~/work/git/git] echo 2 >> COPYING
	(faui01) [~/work/git/git] ./git-diff-cache -r HEAD
	*100644->100644 blob    6ff87c4664981e4397625791c8ea3bbb5f2279a3->0000000000000000000000000000000000000000      COPYING
	(faui01) [~/work/git/git] write
	write       write-tree  writevt
	(faui01) [~/work/git/git] write-tree
	a3f88e4c7c6818ee880d97bf3293ea56fe12c478
	(faui01) [~/work/git/git] ./git-ls-tree a3f88e4c7c6818ee880d97bf3293ea56fe12c478 | grep COPYING\$
	100644  blob    c17665dc78a012a55b11d083bfa065d8cd2b0df1        COPYING

Is this behaviour intended? I would like to see that git-diff-cache
doesn't even look at the working directory but only operates on the
cache.

Greetings,
	Thomas

             reply	other threads:[~2005-05-05 22:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 22:37 Thomas Glanzmann [this message]
2005-05-05 22:58 ` git-diff-cache uses checked-out-working-directory-files if files are newer than the cache entry Thomas Glanzmann

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=20050505223727.GR20994@cip.informatik.uni-erlangen.de \
    --to=sithglan@stud.uni-erlangen.de \
    --cc=git@vger.kernel.org \
    /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).