Re: Some git related questions

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Some git related questions
Date: 2010-08-21 13:39:08
Message-ID: AANLkTi=CG=i3k=LU8BWWqm7Y0F8xqMvsZGQ9tyzk3U5p@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Sat, Aug 21, 2010 at 15:30, Guillaume Lelarge <guillaume(at)lelarge(dot)info> wrote:
> Hi,
>
> More than questions, I want to be sure I get it right.
>
> So, since a few days, we have a mirror of the pgadmin3 git repo on
> github. That's great. Anyone can fork it. I did
> (http://github.com/gleu/pgadmin3) I'm working on my fork till then.
>
> I have two new branches, ticket225 that takes care of the work I need to
> do to make Luis's GSoC patch commitable, and ticket227 that I use as an
> exercice for my git-fu.
>
> Ticket 227 is a simple patch to handle the new columns Magnus added this
> afternoon on the pg_stat_all_tables. Great feature, BTW. Anyway, here is
> what I did:

Kewl. I was just about to start working on that myself :-)

> git checkout -b ticket227 (from master on a clone of my github repo)
> vim, make, tests, etc
> git add pgadmin/schema/pgTable.cpp
> git commit
> git push origin ticket227 (which uploaded my new branch on github)

Yup, so far so good.

> Now, when I'll need to commit it, I think I understand how to do this,
> but I want to make sure before making any mistakes. Here is what I think
> I should do:
>
> from a clone of the pgadmin3 repo (not the github one, the one from
> git.postgresql.org)
>
> git remote add github git://github.com/gleu/pgadmin3.git
> git fetch github
> git checkout master
> git merge ticket227
>
> But, if I do this, I see my commit from ticket227 and I see another
> commit, a merge commit. Is there a way to not have this merge commit? I
> can probably use git rebase to squash them, but I was wondering if there
> was something better).

Yes, you are correct. For the PostgreSQL project, we have a no-merge
policy. I don't recall what we said about pgadmin?

Anyway, what you want to do is use "git rebase -i", and then squash it
together to a single commit (or to more than one if you want, but not
all of them at least).

> Last question. How can I pull the new commits from the the github mirror
> onto my github fork?

You'll need to add the "postgres/pgadmin3" repository as well, say:

git remote add postgres git://github.com/postgres/pgadmin3.git

Then do a "git fetch postgres" and rebase on top of that.

Yes, it's an extra step on everything since we have the master
repository elsewhere from the "master github" one.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message pgAdmin Trac 2010-08-21 13:45:32 Re: [pgAdmin III] #211: close a connection without closing the SQL editor window
Previous Message Guillaume Lelarge 2010-08-21 13:38:26 Re: Some git related questions