[racket-dev] Git

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jan 7 16:15:45 EST 2011

5 hours ago, Robby Findler wrote:
> Another question: what if I commit something just for the purpose of
> moving to another machine and I don't want that commit to show up in
> the main repository? Is that possible? (My tree is currently in that
> state; it is one commit ahead of plt/master but that commit message
> is a lie-- I've just started to do that job; ordinarily I'd do git
> commit --amend to add more stuff to it, but now I'm worried about
> that.)

See my git text, look for "squash" and "fixup" -- I also have a
description of such "checkpoint commits" and how they can be squashed
away before you push the final product.  (And I wrote that description
mainly because I had your use case in mind.)


5 hours ago, Jay McCarthy wrote:
> I like to do an interactive rebase and squash commits together:
> 
> git rebase -i HEAD^^10
> 
> where 10 is how many commits ahead of the master I am

You probably mean "HEAD~10".

But again, see my text -- you don't need to count commits, instead
just use

  git rebase -i origin

which will show you all of the commits you have over the origin/master
branch for reorganization.


5 hours ago, Robby Findler wrote:
> Can I do that once I've pushed to robby/plt? What happens to other
> machines that have unsquashed versions of those commits?

Looks like you know what to do with that now, but just to summarize:
any kind of history rewriting means that people will have problems
updating -- in the case of robby/plt this is easy since "people" is
only you, and you never need to worry about combining stuff if you do
it only when you move between machines.

It's only when you want others to use it that you need to be careful.
(For example, Matthew warning people that he's occasionally rebasing
the gr2 repo.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.