From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: "Konrád Lőrinczi" <klorinczi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Git doesn't detect change, if file modification time is restored to original one
Date: Thu, 23 Jul 2015 16:17:08 +0200 [thread overview]
Message-ID: <ae5d01d5685d9db4cedcada1ce58f71d@www.dscho.org> (raw)
In-Reply-To: <CABEDGg8zixeab-CsviAU-fNE1Jmi0ZWbN6=e6Q+-XK3eFv6djA@mail.gmail.com>
Hi,
On 2015-07-23 09:29, Konrád Lőrinczi wrote:
> I wrote a search & replace perl script, which recursively searches
> files and replaces text in them. After replace, it restores original
> modification time (mtime) of file.
Since this is almost identical to https://github.com/msysgit/git/issues/312#issuecomment-124030520 I assume that you wrote that.
In my answer on the (already closed) GitHub ticket, I wrote this:
-- snipsnap --
I wrote a search & replace perl script, which recursively searches
files and replaces text in them. After replace, it restores original
modification time (mtime) of file.
By this "restoring" of the original modification time you broke the contract: the mtime should reflect the time of the latest change. You replaced something, i.e. changed the file contents. Git expects the mtime to be adjusted in that case. By painstakingly faking it back to its original value you essentially told Git: don't worry, this file has not changed since you last saw it.
There is nothing Git can do to outguess you when you go out of your way to break the most fundamental promise of the mtime value.
prev parent reply other threads:[~2015-07-23 14:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 7:29 Git doesn't detect change, if file modification time is restored to original one Konrád Lőrinczi
2015-07-23 7:58 ` Sebastian Schuberth
2015-07-23 9:14 ` Konrád Lőrinczi
2015-07-23 14:53 ` Konstantin Khomoutov
2015-07-23 15:16 ` Karsten Blees
2015-07-23 17:32 ` Junio C Hamano
2015-07-23 14:17 ` Johannes Schindelin [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=ae5d01d5685d9db4cedcada1ce58f71d@www.dscho.org \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=klorinczi@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).