# How to merge git://repo.or.cz/git-gui into git.git

10 messages from 2007-10-28 to 2007-10-30. Participants: Yin Ping, Peter Baumann, Miklos Vajna, Shawn O. Pearce, Junio C Hamano.
Thread: https://gitlist.dev/t/10500

## Yin Ping, 2007-10-28 10:57

Subject: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <46dff0320710280357u23927960hd204760b3d664ce2@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710280357u23927960hd204760b3d664ce2%40mail.gmail.com

```
I'm reading code of git.

When I type
gtlg --topo-order --pretty=oneline --abbrev-commit e92ea624 -p
in directory git cloned from git.git, I get

e92ea62... Merge branch 'master' of git://repo.or.cz/git-gui
c80d25d... git-gui: Correct 'git gui blame' in a subdirectory
diff --git a/git-gui.sh b/git-gui.sh
index 743b7d4..fa30ccc 100755
--- a/git-gui.sh
+++ b/git-gui.sh
...

git-gui.sh is in the git-gui directory but we see a/git-gui.sh here
other than a/git-gui/git-gui.sh.
And in git://repo.or.cz/git-gui, I see git-gui.sh in the top directory

I just wonder how does this happen and how to merge
git://repo.or.cz/git-gui into git.git this way?


-- 
franky

```

## Yin Ping, 2007-10-28 11:00

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <46dff0320710280400v523e2130nd3286a88a4920a9c@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710280400v523e2130nd3286a88a4920a9c%40mail.gmail.com
In-Reply-To: <46dff0320710280357u23927960hd204760b3d664ce2@mail.gmail.com>

```
On 10/28/07, Yin Ping <pkufranky@gmail.com> wrote:

> When I type
> gtlg --topo-order --pretty=oneline --abbrev-commit e92ea624 -p
Sorry, my fault. gtlg is an alias for git-log

> franky
>


-- 
franky

```

## Peter Baumann, 2007-10-28 11:14

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <20071028111443.GA29183@xp.machine.xx>
URL: https://gitlist.dev/e/20071028111443.GA29183%40xp.machine.xx
In-Reply-To: <46dff0320710280400v523e2130nd3286a88a4920a9c@mail.gmail.com>

```
On Sun, Oct 28, 2007 at 07:00:54PM +0800, Yin Ping wrote:
> On 10/28/07, Yin Ping <pkufranky@gmail.com> wrote:
> 
> > When I type
> > gtlg --topo-order --pretty=oneline --abbrev-commit e92ea624 -p
> Sorry, my fault. gtlg is an alias for git-log
> 
> > franky
> >
> 

Have a look at the subtree merge strategy [1] and at the following
explanations how git-gui got initally merged.

-Peter

[1]: http://www.gelato.unsw.edu.au/archives/git/0702/40139.html
[2]: http://www.gelato.unsw.edu.au/archives/git/0702/39661.html

```

## Yin Ping, 2007-10-28 12:44

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <46dff0320710280544r7f99ddf7xfd5aa7cefb39a9fe@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710280544r7f99ddf7xfd5aa7cefb39a9fe%40mail.gmail.com
In-Reply-To: <20071028111443.GA29183@xp.machine.xx>

```
On 10/28/07, Peter Baumann <waste.manager@gmx.de> wrote:

> Have a look at the subtree merge strategy [1] and at the following
> explanations how git-gui got initally merged.
>
> -Peter
>
> [1]: http://www.gelato.unsw.edu.au/archives/git/0702/40139.html
> [2]: http://www.gelato.unsw.edu.au/archives/git/0702/39661.html
>

3x. I have seen that subtree stategy is introduced in commit 68fa.
However, I don't find any description in manual of git-merge. Should
this be added to this manual or any other document?


-- 
franky

```

## Miklos Vajna, 2007-10-28 18:13

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <20071028181305.GL23810@genesis.frugalware.org>
URL: https://gitlist.dev/e/20071028181305.GL23810%40genesis.frugalware.org
In-Reply-To: <46dff0320710280544r7f99ddf7xfd5aa7cefb39a9fe@mail.gmail.com>

```
On Sun, Oct 28, 2007 at 08:44:44PM +0800, Yin Ping <pkufranky@gmail.com> wrote:
> 3x. I have seen that subtree stategy is introduced in commit 68fa.
> However, I don't find any description in manual of git-merge. Should
> this be added to this manual or any other document?

i think the git-merge manpage should mention it.

- VMiklos

```

## Yin Ping, 2007-10-29 06:45

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <46dff0320710282345r2922ac7dj9c7a4eb3e20fd011@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710282345r2922ac7dj9c7a4eb3e20fd011%40mail.gmail.com
In-Reply-To: <20071028111443.GA29183@xp.machine.xx>

```
On 10/28/07, Peter Baumann <waste.manager@gmx.de> wrote:
>
> Have a look at the subtree merge strategy [1] and at the following
> explanations how git-gui got initally merged.
>
> -Peter
>
> [1]: http://www.gelato.unsw.edu.au/archives/git/0702/40139.html
> [2]: http://www.gelato.unsw.edu.au/archives/git/0702/39661.html
>
>

When i merged git.git into git-gui with subtree strategy, I found all
histories of git.git merged into histories of git-gui (from 584
history entries to 11985). Is it possible that only histories related
to git-gui subdirectory in git.git(i.e. histories displayed by git-log
git-gui) are  merged into?

1. my configuration:
~/git-gui$ git-remote show git
* remote git
  URL: git://git.kernel.org/pub/scm/git/git.git
  Tracked remote branches
    master
~/git-gui$ git-remote show origin
* remote origin
  URL: git://repo.or.cz/git-gui
    Remote branch(es) merged with 'git pull' while on branch master
      master
    Tracked remote branches
      master
~/git-gui$ gtlg --pretty=oneline --topo-order --first-parent | wc -l
584

2. pull with subtree strategy
~/git-gui$  git-pull -s subtree git master:master

3. after pull, all logs of git comes into git-gui (584->11985)
~/git-gui$ gtlg --pretty=oneline --topo-order | wc -l
11985

4. histories of git can be hiden by --first-parent
gtlg --pretty=oneline --topo-order --first-parent | wc -l
585

-- 
franky

```

## Shawn O. Pearce, 2007-10-30 00:52

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <20071030005217.GT14735@spearce.org>
URL: https://gitlist.dev/e/20071030005217.GT14735%40spearce.org
In-Reply-To: <46dff0320710282345r2922ac7dj9c7a4eb3e20fd011@mail.gmail.com>

```
Yin Ping <pkufranky@gmail.com> wrote:
> On 10/28/07, Peter Baumann <waste.manager@gmx.de> wrote:
> >
> > Have a look at the subtree merge strategy [1] and at the following
> > explanations how git-gui got initally merged.
> >
> > -Peter
> >
> > [1]: http://www.gelato.unsw.edu.au/archives/git/0702/40139.html
> > [2]: http://www.gelato.unsw.edu.au/archives/git/0702/39661.html
> 
> When i merged git.git into git-gui with subtree strategy, I found all
> histories of git.git merged into histories of git-gui (from 584
> history entries to 11985). Is it possible that only histories related
> to git-gui subdirectory in git.git(i.e. histories displayed by git-log
> git-gui) are  merged into?
> 
> 2. pull with subtree strategy
> ~/git-gui$  git-pull -s subtree git master:master

You are merging in the wrong direction.  You want to merge git-gui
into git.git:

	git clone git://repo.or.cz/alt-git.git mygit
	cd mygit
	git pull -s subtree git://repo.or.cz/git-gui.git master

So you are pulling git-gui into git, not the reverse.  But yes,
when this happens the entire history of the pulled project (in the
above case git-gui) suddenly appears in the history of the parent
project (in this case git).  If you don't want this to happen then
you need to make git-gui into a submodule.  That has been talked
about being done, but hasn't happened yet in the main git repository.
git-gui is currently still being subtree merged in.

-- 
Shawn.

```

## Yin Ping, 2007-10-30 02:12

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <46dff0320710291912p36d7c83j8564ff0afc6c7b79@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710291912p36d7c83j8564ff0afc6c7b79%40mail.gmail.com
In-Reply-To: <20071030005217.GT14735@spearce.org>

```
> You are merging in the wrong direction.  You want to merge git-gui
> into git.git:
>
>         git clone git://repo.or.cz/alt-git.git mygit
>         cd mygit
>         git pull -s subtree git://repo.or.cz/git-gui.git master
>
> So you are pulling git-gui into git, not the reverse.  But yes,
> when this happens the entire history of the pulled project (in the
> above case git-gui) suddenly appears in the history of the parent
> project (in this case git).  If you don't want this to happen then
> you need to make git-gui into a submodule.  That has been talked
> about being done, but hasn't happened yet in the main git repository.
> git-gui is currently still being subtree merged in.
>
> --
> Shawn.
>
Ok, I see. I'm just be interested in the subtree strategy and try a
few ways and different directions to merge. And also i'm trying to
figure out which one of subtree merge and submodule is more suitable
for my project. However, the conclusion havn't come.

-- 
franky

```

## Junio C Hamano, 2007-10-30 03:46

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <7vmyu1s1qt.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vmyu1s1qt.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20071030005217.GT14735@spearce.org>

```
"Shawn O. Pearce" <spearce@spearce.org> writes:

>> 2. pull with subtree strategy
>> ~/git-gui$  git-pull -s subtree git master:master
>
> You are merging in the wrong direction.  You want to merge git-gui
> into git.git:
>
> 	git clone git://repo.or.cz/alt-git.git mygit
> 	cd mygit
> 	git pull -s subtree git://repo.or.cz/git-gui.git master
>
> So you are pulling git-gui into git, not the reverse.

Actually, subtree strategy was designed to allow merging back
and forth.  But the result, as it _is_ a merge, will not omit
any commit from the history from both branches.

```

## Yin Ping, 2007-10-30 08:51

Subject: Re: How to merge git://repo.or.cz/git-gui into git.git
Message-ID: <46dff0320710300151k56cdf8a9o77e163e3167e73e@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710300151k56cdf8a9o77e163e3167e73e%40mail.gmail.com
In-Reply-To: <7vmyu1s1qt.fsf@gitster.siamese.dyndns.org>

```
>
> Actually, subtree strategy was designed to allow merging back
> and forth.  But the result, as it _is_ a merge, will not omit
> any commit from the history from both branches.
>
>
Can git-log be more clever so that it can recognize a subtree merge
and show only logs related to the subtree?

Another suggestion is that the commit msg for subtree merge should be
more accurate such as " Merge branch master of <repos> into direcotry
<dir> of branch <branch>"


-- 
franky

```
