From: Alex Riesen Date: Thu, 01 Mar 2007 21:48:39 GMT Subject: Re: Git checkout preserve timestamp? Message-ID: <81b0412b0703011348q7f3e71f3qb1f207178c496668@mail.gmail.com> In-Reply-To: <17895.18265.710811.536526@lisa.zopyra.com> On 3/1/07, Bill Lear wrote: > I wonder if it would be possible or desirable to have a config flag > that told git to restore the timestamps across branch checkouts in > order to prevent this perturbation. Almost every SCM has such a flag. And every one of them warn against using it. > So, when git does a checkout of a branch, it would look to see which > files in the current branch are changed, tuck away the timestamps for > those, and switch to the new branch. On return to the former, the > same would be done for the new branch, then after the changed files > were restored, the timestamps would be reset. For instance, timestamp of which machine do you want to restore? How do you know if they are synchronized? > One thing this would enable is to be able to hold the compilation > products of multiple branches at the same time in the same working > tree, switch back and forth between branches, and only have to compile > code that you actually modify. Currently, we store compilation > products in a directory that is composed of the architecture, compiler, > compiler options, and so forth, among which also could be the branch > name. Usually, you will just screw up the build process beyond all repair. > Anyway, just an idea I thought worth batting about. Consider separating build and working repositories. Merge things into build repo, switch the branches freely in your working repo. Works just fine for me.