Re: Git checkout preserve timestamp?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 5 Mar 2007, Bill Lear wrote:

> On Monday, March 5, 2007 at 14:37:15 (-0800) Linus Torvalds writes:
> >On Mon, 5 Mar 2007, Bill Lear wrote:
> >> I edit sourcefile.c, compile it, then commit it with
> >> N=timestamp(sourcefile.c) on master.  N is <
> >> timestamp(.master/sourcefile.o).  I then switch to branchX.  N is
> >> stored by git for master:sourcefile.c.  No stored timestamp are on
> >> this branch, so the file gets the timestamp it gets on checkout
> >> M=timestamp(sourcefile.c).  I compile the file again, all is well.  I
> >> move back to master branch.  Git stores M as branchX:sourcefile.c Git
> >> checks out the file, and stamps it with N.  I do a make.  No
> >> recompilation happens.
> >
> >WHICH IS WRONG! You need to recompile, since the compile you did on the 
> >other branch DOES NOT MATCH in "sourcefile.c" any more. 
> 
> Well, I'll let it drop after this, but I think you're wrong.  I do NOT
> need it to recompile when I do the third make above.

Bill, maybe you don't want to hear it, but for all those following this 
thread, here is why you are wrong:

"make" does _not_ match the time stamps of xyz.c and xyz.o. After you 
"make", the only thing which is guaranteed is that if xyz.c is _newer_ 
than xyz.o, the compiler is started.

Example:

00:05 you pull upstream into your master branch, which has a newer xzy.c
00:07 you type make. xyz.o is built, because make sees that xyz.c is 
      newer than xyz.o
00:12 you checkout your side branch, xyz.c is updated.
00:13 you type make, and again xzy.o is built, because xyz.c is newer than 
      xyz.o
00:25 you switch back to your master branch.

Now, if your wish would be granted, and xyz.c has the same timestamp as 
before, then it _still_ is older than xyz.o. So make will not rebuild it.

BUT xyz.o is actually compiled from the side branch's version of xyz.c!

Hth,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]