All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Callegari <sergio.callegari@gmail.com>
To: git@vger.kernel.org
Subject: Re: Interaction between clean/smudge and git status
Date: Mon, 14 Apr 2008 08:18:32 +0000 (UTC)	[thread overview]
Message-ID: <loom.20080414T074356-925@post.gmane.org> (raw)
In-Reply-To: loom.20080414T072615-85@post.gmane.org

Sergio Callegari <scallegari <at> arces.unibo.it> writes:

> 
> Junio C Hamano <gitster <at> pobox.com> writes:
> 
> 
> > Are you recreating the .zip file in the filter in such a way that a file
> > with the same contents results in byte-to-byte identical .zip file?
> > Otherwise as far as git is concerned you have changed the file in the work
> > tree.
> 
> And here you are right!!!
> I thought that re-zip script was repeatable in behaviour, but it is not
> (probably because things like file dates change when files are unpacked in the
> temporary dir and dates get stored).
> 
> I absolutely overlooked that.
> 

OK, here is a testcase too...

mkdir TEST
git init
# create zip file x.zip
git add x.zip
git commit

In this git commit the clean filter runs.

rm x.zip

git checkout x.zip

or 

git reset --hard

In this checkout the smudge filter runs

git status

It says that x.zip is changed

And yes, in some sense it is changed, because it is a different file than the
one I had before the check in. But no, in some other sense it is not changed,
because it is the file that I have just checked out (it has not been touched
after the checkout).

Not that if I had only the clean filter and not the smudge one, then the same
would have happened. 


So I think that I see your point: if the clean/smudge filters always provide the
same output independently from when they are run, then I get the message about
the changed file at most once, when I check in for the first time the "cleaned"
file.  

And this behaviour makes sense: to say that nothing has changed, git wants
things to be identical.  However it is a bit counterintuitive, because one would
think that something that has just been freshly checked out should not be
considered as changed anyway.

I wonder if this comes from the fact that when git status is run, git compares
the workdir file with the index and the index contains information on the file
as it was before the last checkin.  When filters exist, wouldn't it make sense
to have the index hold information on the files as they are after the checkout?

Sergio 

      reply	other threads:[~2008-04-14  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-13 23:25 Interaction between clean/smudge and git status Sergio Callegari
2008-04-14  6:48 ` Johannes Sixt
2008-04-14  7:04   ` Junio C Hamano
2008-04-14  7:21     ` Johannes Sixt
2008-04-14  7:38     ` Sergio Callegari
2008-04-14  8:18       ` Sergio Callegari [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=loom.20080414T074356-925@post.gmane.org \
    --to=sergio.callegari@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.