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

Re: Git enhancement request - checkout (clone) set modified dates to commit date

From
Andrew Wolfe <andrew@schemaczar.com>
Date
Apr 23, 2018, 00:23 UTC
Message-ID
<3BCD276C-BC6B-47BD-A27C-05D7C0C07280@schemaczar.com>
In-Reply-To
<20180422195923.GA10082@alpha>
Kevin, thanks for your feedback.
You have a reasonable point, because usually you don't put the outputs of a build into version control, but the build script checks them for being current.
On the other hand, when you change branches, your existing output directories are worthless problems anyway — even if you have all the interdependencies correct.  Because of this, I'm inclined to consider this use case as intrinsically hazardous.  When I do a checkout, I always want to purge all the intermediate and end targets regardless.
When doing a build, it's often useful to put the current commit/branch into the output directories as documentation; I usually do this in my build scripts.  This also makes it simple to detect when the branch is changed and clean the outputs.
- Andrew
Show 22 quoted lines
> On Apr 22, 2018, at 3:59 PM, Kevin Daudt <me@ikke.info> wrote:
> 
> On Sun, Apr 22, 2018 at 03:01:10PM -0400, Andrew Wolfe wrote:
>> Hi Brian,
>> 
>> Not completely sure what you're saying.  If the files on master are
>> not changed, the changed files' commit timestamps will be older than
>> the branch commit timestamps.
>> 
>> However, if I check out master after committing to a branch, the
>> modifications will necessarily disappear because they haven't been
>> committed to master.  Instead, under my proposal, each will get the
>> timestamp of its prior commit.
>> 
> 
> Say I build the project while on a certain branch. Then I checkout a
> different branch and build again. You would expect that the targets of
> every source file that have changed are rebuilt.
> 
> When you would restore the timestamp back to the commit timestamp, the
> timestamp will be older then the target, and make will not rebuild it,
> leaving you with outdated build targets.
Previous: Kevin DaudtNext: Jacob Keller
Message 5 of 6 in “Git enhancement request - checkout (clone) set modified dates to commit date”
  1. Andrew WolfeApr 22, 2018
  2. brian m. carlsonApr 22, 2018
  3. Andrew WolfeApr 22, 2018
  4. Kevin DaudtApr 22, 2018
  5. Andrew WolfeApr 23, 2018
  6. Jacob KellerApr 23, 2018

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.