From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Moffett Subject: Re: Branches & directories Date: Mon, 22 Aug 2011 15:31:26 -0400 Message-ID: References: <7vvctvdf5r.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Michael Witten , Junio C Hamano , Evan Shelhamer , Git Mailing List To: Hilco Wijbenga X-From: git-owner@vger.kernel.org Mon Aug 22 21:31:59 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QvaE2-0006tW-CC for gcvg-git-2@lo.gmane.org; Mon, 22 Aug 2011 21:31:58 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753547Ab1HVTbu (ORCPT ); Mon, 22 Aug 2011 15:31:50 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:63502 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753189Ab1HVTbt (ORCPT ); Mon, 22 Aug 2011 15:31:49 -0400 Received: by wyg24 with SMTP id 24so3726078wyg.19 for ; Mon, 22 Aug 2011 12:31:48 -0700 (PDT) Received: by 10.216.165.18 with SMTP id d18mr2253142wel.99.1314041506648; Mon, 22 Aug 2011 12:31:46 -0700 (PDT) Received: by 10.216.87.138 with HTTP; Mon, 22 Aug 2011 12:31:26 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Mon, Aug 22, 2011 at 14:49, Hilco Wijbenga wrote: > On 22 August 2011 05:46, Kyle Moffett wrote: >> On Mon, Aug 22, 2011 at 01:36, Hilco Wijbenga wrote: >>> On 21 August 2011 20:01, Kyle Moffett wrote: >>>> Obviously the easiest way to work around that issue is "git clean", >>>> which has options to select all untracked files or just ignored ones. >>> >>> As I mentioned above, I don't want to *delete* untracked/ignored >>> files, I just want them to stick to the branch I was working on. So if >>> I change to a different branch I get the appropriate build artifacts. >>> >>> Something like: git stash --everything "All artifacts for >>> this-branch." && git checkout other-branch && git stash apply >>> stash-for-other-branch. >> >> When I am in those sorts of situations I generally just use separate >> working directories or separate checkouts entirely; if you really prefer >> to have everything in one directory you would be better served by >> integrating "ccache" into your workflow. > > Unfortunately, that seems for C/C++ code only. I use Java. Besides, > it's not the Java compilation that takes most of the time. Hm, that sounds like a very serious Eclipse limitation with almost all forms of source control. What is done with other VCSes (IE: Subversion, etc)? >>From this I believe the best option is to just make use of multiple separate checkouts or worktrees. >> In particular, even "git stash" intentionally does not preserve file times, >> so you would end up rebuilding everything anyways because all of your >> source files would be as new as your object files. > > Yes, I just noticed that. Why do you say "intentionally"? Is extra > work being done to make it so? If yes, then shouldn't that be > configurable? Well, there's 2 reasons: (1) The GIT data-structures simply have no place for file timestamps, and "git stash" is simply a special way of dumping files into a temporary commit. This is exactly the same as the (2) You almost always *don't* want to preserve timestamps. For example: $ git checkout -b my-feature origin/master $ vim some-file.c $ make $ git add some-file.c && git commit -m "A new feature" $ git checkout -b my-bugfix origin/master $ vim other-file.c $ make If GIT preserved timestamps, the second "make" would fail to rebuild the product "some-file.o" because "some-file.c" is still older than it, even though "some-file.c" has changed since the last build!!! Really, GIT is only intended for storing source code. If you want to store other kinds of things (like timestamps, permissions, etc), then you need to turn them into source code (IE: a text file and a "make install" target) and then store them that way. Cheers, Kyle Moffett