git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Setting file timestamps to commit time (git-checkout)
@ 2013-12-09 11:25 Dominik Vogt
  2013-12-09 20:35 ` Junio C Hamano
  2013-12-09 20:48 ` Jonathan Nieder
  0 siblings, 2 replies; 11+ messages in thread
From: Dominik Vogt @ 2013-12-09 11:25 UTC (permalink / raw)
  To: git

Me and some colleagues work on gcc in lots of different branches.
For each branch there is a separate build directory for each
branch, e.g. build-a, build-b and build-c.  Let's assume that all
branches are identical at the moment.  If a file in branch a is
changed that triggers a complete rebuild of gcc (e.g.
<target>.opt), rebuilding in build-a takes about an hour.  Now,
 when I switch to one of the other branches, said file is not
identical anymore and stamped with the _current_ time during
checkout.  Although branch b and c have not changed at all, they
will now be rebuilt completely because the timestamp on that files
has changed.  I.e. a chance on one branch forces a rebuild on n
other branches, which can take many hours.

I think this situation could be improved with an option to
git-checkout with the following logic:

$ git checkout <new branch>
  FOR EACH <file> in working directory of <new branch>
    IF <file> is identical to the version in the <old branch>
      THEN leave the file untouched
    ELSE IF <commit timestamp> of the HEAD of the <new branch>
            is in the future
      THEN checkout the new version of <file> and stamp it with
           the current time
    ELSE (commit timestamp is current or in the past)
      THEN checkout the new version of <file> and stamp it with
           the commit timestamp of the current HEAD of <new branch>

Any comments?  Is there already a way to do this?

(Please do not cc me on replies, I'm subscribed to the list.)

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-12-11  7:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 11:25 Setting file timestamps to commit time (git-checkout) Dominik Vogt
2013-12-09 20:35 ` Junio C Hamano
2013-12-10  8:35   ` Dominik Vogt
2013-12-10 19:02     ` Andreas Schwab
2013-12-11  7:37       ` Dominik Vogt
2013-12-11  1:39     ` Constantine A. Murenin
2013-12-09 20:48 ` Jonathan Nieder
2013-12-10  8:46   ` Dominik Vogt
2013-12-10 10:34     ` Duy Nguyen
2013-12-11  1:08       ` Jonathan Nieder
2013-12-11  1:01     ` Jonathan Nieder

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).