From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hilco Wijbenga Subject: Re: Branches & directories Date: Mon, 22 Aug 2011 13:10:18 -0700 Message-ID: References: <7vvctvdf5r.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Michael Witten , Junio C Hamano , Evan Shelhamer , Git Mailing List To: Kyle Moffett X-From: git-owner@vger.kernel.org Mon Aug 22 22:10:48 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 1Qvapa-0005do-B0 for gcvg-git-2@lo.gmane.org; Mon, 22 Aug 2011 22:10:46 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753490Ab1HVUKl convert rfc822-to-quoted-printable (ORCPT ); Mon, 22 Aug 2011 16:10:41 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:52689 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588Ab1HVUKk convert rfc822-to-8bit (ORCPT ); Mon, 22 Aug 2011 16:10:40 -0400 Received: by ywf7 with SMTP id 7so3781481ywf.19 for ; Mon, 22 Aug 2011 13:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=kN+73cmtOGiZQF2d5GFZRkHQmROe+CW/FCJST6DIUVQ=; b=kxgXOnqbh2pNi/CI0jcWN/TBN4Bieu+bifcKNKCl29Jth0dCzwAVtXUzsvXlEy0PQM 1lwfu+GVHdezqqe4uzdO0604oRJ2Wsy4NWSlh/lvMps7ASJLq/J5OkMKLLpB3h0btKwx XJXtmBgd7Tsikkm1mXGygYm5gNh1QrENq80TY= Received: by 10.236.181.135 with SMTP id l7mr17540976yhm.85.1314043818646; Mon, 22 Aug 2011 13:10:18 -0700 (PDT) Received: by 10.236.207.67 with HTTP; Mon, 22 Aug 2011 13:10:18 -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 22 August 2011 12:31, Kyle Moffett wrote: > 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 o= nes. >>>> >>>> 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. S= o if >>>> I change to a different branch I get the appropriate build artifac= ts. >>>> >>>> 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 separat= e >>> working directories or separate checkouts entirely; if you really p= refer >>> 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 al= l forms > of source control. =C2=A0What is done with other VCSes (IE: Subversio= n, etc)? It has nothing to do with Eclipse. There is just a lot going on in the = build. > From this I believe the best option is to just make use of multiple s= eparate > checkouts or worktrees. Sounds like it. >>> In particular, even "git stash" intentionally does not preserve fil= e times, >>> so you would end up rebuilding everything anyways because all of yo= ur >>> 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. That's what I thought. The "intentionally" threw me off. It's not intentional, it's just a side effect. > This is exactly the same as the There seems to be some text missing here? > (2) You almost always *don't* want to preserve timestamps. =C2=A0For = 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, e= ven > though "some-file.c" has changed since the last build!!! > > Really, GIT is only intended for storing source code. =C2=A0If you wa= nt to store > other kinds of things (like timestamps, permissions, etc), then you n= eed to > turn them into source code (IE: a text file and a "make install" targ= et) and > then store them that way. Yep, that all makes sense. I just wish there was at least an option to keep the timestamp (and possibly other such things). Even Subversion can do that... ;-) After all, not everybody uses C & make. Cheers, Hilco