[vtk-developers] git stupid question #4

Mark Olesen Mark.Olesen at faurecia.com
Fri Apr 30 03:08:32 EDT 2010


On Fri, 2010-04-30 at 08:29 +0200, Biddiscombe, John A. wrote:
> > Subject: Re: [Paraview-developers] strange linker error
> > 
> > Do a submodule update. It should be fixed.
> 
> OK. All is well with my build, but 
> 
> cd VTK
> git checkout master
> 	(touches every file which is different)
> git pull kitware master  
> 	(retrieve a couple of changes)
> git checkout cscs-pv
> 	(touches every file which is different + new ones)
> git merge master
> 
> make 
> now make rebuilds practically all of VTK again even though only a
> couple of files were pulled. Imagine if vtkSetGet.h were different on
> the branches, now we'd really be in trouble!
> 
> Is there a way of saying
> I'm on branch cscs-pv, please pull on the master branch from kitware,
> so that I can do a merge in a minute, without swapping my active
> branch?

I rarely (actually never) use "git pull".
I much prefer to use "git fetch NAME" and then use "git merge" later
when I feel like it or have time.

Here are a few aliases (for your global ~/.gitconfig or for the
local .git/config) that I find useful:

[alias]
  getrepo = fetch kitware
  logrepo = log --stat --no-merges kitware/master ^HEAD
  loghere = log --stat --no-merges HEAD ^kitware/master
  log1 = log --pretty=oneline
  logs = log --stat
  grepc = grep --cached


With these aliases, I would then do this:

git getrepo   # fetch the latest from kitware
git logrepo   # see which commits are new (ie, that I don't have merged
it)


I can thus wait until enough new commits have accumulated before
bothering to merge with my local branch. Or, if a particular commit is
really important, I can git cherry-pick it into my local branch.


If you have a local branch 'master' that *exactly* tracks the
kitware/master, you can also cheat a little bit and just update your
reference directly with "git update-ref"

/mark


DISCLAIMER:
This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited. Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.




More information about the vtk-developers mailing list