threads / discuss / 10500

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

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

## tl;dr

10 messages between Oct 28, 2007 and Oct 30, 2007.

replies: 9people: 5as markdown or json

Yin Ping· Oct 28, 2007, 10:57 UTC · lore
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· Oct 28, 2007, 11:00 UTC · re: Yin Ping · lore

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

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· Oct 28, 2007, 11:14 UTC · re: Yin Ping · lore

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

On Sun, Oct 28, 2007 at 07:00:54PM +0800, Yin Ping wrote:
Show 9 quoted lines
> 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· Oct 28, 2007, 12:44 UTC · re: Peter Baumann · lore

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

On 10/28/07, Peter Baumann <waste.manager@gmx.de> wrote:
Show 8 quoted lines
> 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· Oct 28, 2007, 18:13 UTC · re: Yin Ping · lore

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

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· Oct 29, 2007, 06:45 UTC · re: Peter Baumann · lore

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

On 10/28/07, Peter Baumann <waste.manager@gmx.de> wrote:
Show 10 quoted lines
>
> 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· Oct 30, 2007, 00:52 UTC · re: Yin Ping · lore

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

Yin Ping <pkufranky@gmail.com> wrote:
Show 18 quoted lines
> 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· Oct 30, 2007, 02:12 UTC · re: Shawn O. Pearce · lore

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

Show 18 quoted lines
> 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· Oct 30, 2007, 03:46 UTC · re: Shawn O. Pearce · lore

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

"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 11 quoted lines
>> 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· Oct 30, 2007, 08:51 UTC · re: Junio C Hamano · lore

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

Show 6 quoted lines
>
> 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

← back to recent threads