All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Greg A. Woods" <woods@planix.com>
To: The Git Mailing List <git@vger.kernel.org>
Cc: Dmitry Potapov <dpotapov@gmail.com>
Subject: Re: "git merge" merges too much!
Date: Mon, 30 Nov 2009 19:24:14 -0500	[thread overview]
Message-ID: <m1NFGXS-000kn2C@most.weird.com> (raw)
In-Reply-To: <20091130211744.GA27278@dpotapov.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 2349 bytes --]

At Tue, 1 Dec 2009 00:17:44 +0300, Dmitry Potapov <dpotapov@gmail.com> wrote:
Subject: Re: "git merge" merges too much!
> 
> It depends on the project and what tools are used, but using ccache and
> proper dependencies help a lot to reduce the cost of switching. In fact,
> it may be faster to switch to another branch and have to recompile a few
> files than to go into another working directory, because when you go to
> another working directory, you hit cold cache and things get very slow.

perhaps, sometimes, but at least with some tools that can more often
than not just end up with a confusing mess if you happen to change
something at exactly the wrong time, and with Git it seems almost too
easy to wildly change many files in the working directory, even if you
can get them back into their previous state relatively quickly

Things get even weirder if you happen to be playing with older branches
too -- most build tools don't have ability to follow files that go back
in time as they assume any product files newer than the sources are
already up-to-date, no matter how much older the sources might become on
a second build.

From a good software hygiene perspective the only safe way I can see to
build a Git working directory after manipulating any branches with Git
is to do a complete "make clean && make" cycle.  That is until Git also
incorporates, or integrates with, really good build tools....  :-)


> And then if a project is huge and takes a lot of time to compile and
> test everything, I do not think, it is a good idea to build that in your
> work tree. Instead, you make a shanshot using git-archive and then run
> full build and test on it. In this way, you know that you test exactly
> what you have committed (you can amend any commit later until you
> publish it).
 
I think this "git-new-workdir" script is the thing to try.  It probably
means keeping separate "configuration" branches, one for each build
working directory, but I think that's OK.

These source trees are big enough that one doesn't just go throwing
around entire copies of them willy-nilly.  Disk bandwidth is also a
limited resource we are very concerned about, not just disk space.

-- 
						Greg A. Woods
						Planix, Inc.

<woods@planix.com>       +1 416 218 0099        http://www.planix.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

  reply	other threads:[~2009-12-01  0:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-29  3:21 "git merge" merges too much! Greg A. Woods
2009-11-29  5:14 ` Jeff King
2009-11-30 18:12   ` Greg A. Woods
2009-11-30 19:22     ` Dmitry Potapov
2009-12-01 18:52       ` Greg A. Woods
2009-12-01 20:50         ` Dmitry Potapov
2009-12-01 21:58           ` Greg A. Woods
2009-12-02  0:22             ` Dmitry Potapov
2009-12-02 10:20         ` Nanako Shiraishi
2009-12-02 20:09     ` Jeff King
2009-12-03  1:21       ` Git documentation consistency (was: "git merge" merges too much!) Greg A. Woods
2009-12-03  1:34         ` Git documentation consistency Junio C Hamano
2009-12-03  7:22           ` Greg A. Woods
2009-12-03  7:45             ` Jeff King
2009-12-03 15:24               ` Uri Okrent
2009-12-03 16:22             ` Marko Kreen
2009-12-09 19:56               ` Greg A. Woods
2009-12-03  2:07         ` Git documentation consistency (was: "git merge" merges too much!) Jeff King
2009-11-29  5:15 ` "git merge" merges too much! Junio C Hamano
2009-11-30 18:40   ` Greg A. Woods
2009-11-30 20:50     ` Junio C Hamano
2009-11-30 21:17     ` Dmitry Potapov
2009-12-01  0:24       ` Greg A. Woods [this message]
2009-12-01  5:47         ` Dmitry Potapov
2009-12-01 17:59           ` multiple working directories for long-running builds (was: "git merge" merges too much!) Greg A. Woods
2009-12-01 18:51             ` Dmitry Potapov
2009-12-01 18:58               ` Greg A. Woods
2009-12-01 21:18                 ` Dmitry Potapov
2009-12-01 22:25                   ` Jeff Epler
2009-12-01 22:44                   ` Greg A. Woods
2009-12-02  0:10                     ` Dmitry Potapov
2009-12-03  5:11                       ` Greg A. Woods
2009-12-02  2:09                   ` multiple working directories for long-running builds Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1NFGXS-000kn2C@most.weird.com \
    --to=woods@planix.com \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.