git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Setting file timestamps to commit time (git-checkout)

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 9, 2013, 20:35 UTC
Message-ID
<xmqqsiu1yd7p.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20131209112528.GA5309@linux.vnet.ibm.com>
Dominik Vogt <vogt@linux.vnet.ibm.com> writes:
Show 11 quoted lines
> 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 am not quite sure I follow your set-up. Do you have three working trees connected to a repository (via contrib/workdir/git-new-workdir perhaps), each having a checkout of its own branch? And in one working directory that has build-a checked out, a new commit touches one file, <target>.opt, to make a new commit:

Before:
    ---o---o---X
               ^ refs/heads/build-a
                 refs/heads/build-b
                 refs/heads/build-c
After:
                   v refs/heads/build-a
    ---o---o---X---Y
               ^ refs/heads/build-b
                 refs/heads/build-c

Because you said that branch b and c hasn't changed at all, I do not see how your build-b and/or build-c directories become dirty.

Previous: Dominik VogtNext: Dominik Vogt
Message 2 of 11 in “Setting file timestamps to commit time (git-checkout)”
  1. Dominik VogtDec 9, 2013
  2. Junio C HamanoDec 9, 2013
  3. Dominik VogtDec 10, 2013
  4. Andreas SchwabDec 10, 2013
  5. Dominik VogtDec 11, 2013
  6. Constantine A. MureninDec 11, 2013
  7. Jonathan NiederDec 9, 2013
  8. Dominik VogtDec 10, 2013
  9. Duy NguyenDec 10, 2013
  10. Jonathan NiederDec 11, 2013
  11. Jonathan NiederDec 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.