# [DOCBUG] git subtree synopsis needs updating

7 messages from 2012-10-19 to 2013-01-19. Participants: Yann Dirson, Herman van Rink, greened@obbligato.org, Techlive Zheng.
Thread: https://gitlist.dev/t/31868

## Yann Dirson, 2012-10-19 13:21

Subject: [DOCBUG] git subtree synopsis needs updating
Message-ID: <20121019152158.4297707b@chalon.bertin.fr>
URL: https://gitlist.dev/e/20121019152158.4297707b%40chalon.bertin.fr

```

As the examples in git-subtree.txt show, the synopsis in the same file should
surely get a patch along the lines of:

-'git subtree' add   -P <prefix> <commit>
+'git subtree' add   -P <prefix> <repository> <commit>

Failure to specify the repository (by just specifying a local commit) fails with
the cryptic:

 warning: read-tree: emptying the index with no arguments is deprecated; use --empty
 fatal: just how do you expect me to merge 0 trees?


Furthermore, the doc paragraph for add, aside from mentionning <repository>, also
mentions a <refspec> which the synopsis does not show either.


As a sidenote it someone wants to do some maintainance, using "." as repository when
the branch to subtree-add is already locally available does not work well either
(fails with "could not find ref myremote/myhead").

-- 
Yann Dirson - Bertin Technologies

```

## Herman van Rink, 2012-10-20 19:40

Subject: Re: [DOCBUG] git subtree synopsis needs updating
Message-ID: <5082FE13.2000003@initfour.nl>
URL: https://gitlist.dev/e/5082FE13.2000003%40initfour.nl
In-Reply-To: <20121019152158.4297707b@chalon.bertin.fr>

```
On 10/19/2012 03:21 PM, Yann Dirson wrote:
> As the examples in git-subtree.txt show, the synopsis in the same file should
> surely get a patch along the lines of:
>
> -'git subtree' add   -P <prefix> <commit>
> +'git subtree' add   -P <prefix> <repository> <commit>
>
> Failure to specify the repository (by just specifying a local commit) fails with
> the cryptic:
>
>  warning: read-tree: emptying the index with no arguments is deprecated; use --empty
>  fatal: just how do you expect me to merge 0 trees?
>
>
> Furthermore, the doc paragraph for add, aside from mentionning <repository>, also
> mentions a <refspec> which the synopsis does not show either.
>
>
> As a sidenote it someone wants to do some maintainance, using "." as repository when
> the branch to subtree-add is already locally available does not work well either
> (fails with "could not find ref myremote/myhead").
>

The version of subtree in contrib is rather out-dated unfortunately.

I've collected a bunch of patches in
https://github.com/helmo/git/tree/subtree-updates

The documentation issue is also fixed in there.

-- 

Met vriendelijke groet / Regards,

Herman van Rink
Initfour websolutions

```

## Yann Dirson, 2012-10-24 14:29

Subject: Re: [DOCBUG] git subtree synopsis needs updating
Message-ID: <20121024162947.2c1edc50@chalon.bertin.fr>
URL: https://gitlist.dev/e/20121024162947.2c1edc50%40chalon.bertin.fr
In-Reply-To: <5082FE13.2000003@initfour.nl>

```
On Sat, 20 Oct 2012 21:40:03 +0200
Herman van Rink <rink@initfour.nl> wrote:

> On 10/19/2012 03:21 PM, Yann Dirson wrote:
> > As the examples in git-subtree.txt show, the synopsis in the same file should
> > surely get a patch along the lines of:
> >
> > -'git subtree' add   -P <prefix> <commit>
> > +'git subtree' add   -P <prefix> <repository> <commit>
> >
> > Failure to specify the repository (by just specifying a local commit) fails with
> > the cryptic:
> >
> >  warning: read-tree: emptying the index with no arguments is deprecated; use --empty
> >  fatal: just how do you expect me to merge 0 trees?
> >
> >
> > Furthermore, the doc paragraph for add, aside from mentionning <repository>, also
> > mentions a <refspec> which the synopsis does not show either.
> >
> >
> > As a sidenote it someone wants to do some maintainance, using "." as repository when
> > the branch to subtree-add is already locally available does not work well either
> > (fails with "could not find ref myremote/myhead").
> >
> 
> The version of subtree in contrib is rather out-dated unfortunately.
> 
> I've collected a bunch of patches in
> https://github.com/helmo/git/tree/subtree-updates

Ah, it's nice to see subtree updates.  Any plans to get them merged anytime soon ?

I guess you may want to rebase the patches from https://github.com/helmo/git-subtree,
the subtree-updates patch looks like a "subtree merge --squash" result, and is not really
suitable for reviewing on the list.

> The documentation issue is also fixed in there.
> 


-- 
Yann Dirson - Bertin Technologies

```

## greened@obbligato.org, 2013-01-01 01:47

Subject: Re: [DOCBUG] git subtree synopsis needs updating
Message-ID: <87pq1p3c8v.fsf@waller.obbligato.org>
URL: https://gitlist.dev/e/87pq1p3c8v.fsf%40waller.obbligato.org
In-Reply-To: <20121024162947.2c1edc50@chalon.bertin.fr>

```
Yann Dirson <dirson@bertin.fr> writes:

> Ah, it's nice to see subtree updates.  Any plans to get them merged anytime soon ?

As soon as there is one patch per feature that applies cleanly to
contrib/ and testcases use the native git test facility.

These patches should be submitted to the mailing list for review.

                            -David

```

## greened@obbligato.org, 2013-01-01 02:51

Subject: Re: [DOCBUG] git subtree synopsis needs updating
Message-ID: <877gnx39aa.fsf@waller.obbligato.org>
URL: https://gitlist.dev/e/877gnx39aa.fsf%40waller.obbligato.org
In-Reply-To: <20121019152158.4297707b@chalon.bertin.fr>

```
Yann Dirson <dirson@bertin.fr> writes:

> As the examples in git-subtree.txt show, the synopsis in the same file should
> surely get a patch along the lines of:
>
> -'git subtree' add   -P <prefix> <commit>
> +'git subtree' add   -P <prefix> <repository> <commit>
>
> Failure to specify the repository (by just specifying a local commit) fails with
> the cryptic:
>
>  warning: read-tree: emptying the index with no arguments is deprecated; use --empty
>  fatal: just how do you expect me to merge 0 trees?

Specifying a local branch works fine, though, as does a raw commit
hash.  What do you mean by "local commit?"

I have updated the documentation and will submit it tonight or tomorrow.

Any invalid refspec should be caught early and a more useful message
will be displayed.

> Furthermore, the doc paragraph for add, aside from mentionning <repository>, also
> mentions a <refspec> which the synopsis does not show either.

Fixed.

> As a sidenote it someone wants to do some maintainance, using "." as repository when
> the branch to subtree-add is already locally available does not work well either
> (fails with "could not find ref myremote/myhead").

Seems to work for me.  Can you give me the command you're using when you
see the problem?

Thanks for the report!

                          -David

```

## Yann Dirson, 2013-01-18 14:37

Subject: Re: [DOCBUG] git subtree synopsis needs updating
Message-ID: <20130118153734.54640b2d@chalon.bertin.fr>
URL: https://gitlist.dev/e/20130118153734.54640b2d%40chalon.bertin.fr
In-Reply-To: <877gnx39aa.fsf@waller.obbligato.org>

```
On Mon, 31 Dec 2012 20:51:41 -0600
greened@obbligato.org wrote:

> Yann Dirson <dirson@bertin.fr> writes:
> 
> > As the examples in git-subtree.txt show, the synopsis in the same file should
> > surely get a patch along the lines of:
> >
> > -'git subtree' add   -P <prefix> <commit>
> > +'git subtree' add   -P <prefix> <repository> <commit>
> >
> > Failure to specify the repository (by just specifying a local commit) fails with
> > the cryptic:
> >
> >  warning: read-tree: emptying the index with no arguments is deprecated; use --empty
> >  fatal: just how do you expect me to merge 0 trees?
> 
> Specifying a local branch works fine, though, as does a raw commit
> hash.  What do you mean by "local commit?"

With no <repository> arg documented, my understanding was that I should first 
"git remote add" and fetch the repo in which the branch to be added as subtree
lived.  This when running "git subtree add", the commit was indeed existing
locally.

> > As a sidenote it someone wants to do some maintainance, using "." as repository when
> > the branch to subtree-add is already locally available does not work well either
> > (fails with "could not find ref myremote/myhead").
> 
> Seems to work for me.  Can you give me the command you're using when you
> see the problem?

Hm, can't remember exactly how I reached that.  But when experimenting to
reproduce:

$ contrib/subtree/git-subtree.sh add -P foo . origin/maint
git fetch . origin/maint
From .
 * remote-tracking branch origin/maint -> FETCH_HEAD
Added dir 'foo'

=> OK

$ contrib/subtree/git-subtree.sh add -P fooo . origin/maint^0
git fetch . origin/maint^0
fatal: Invalid refspec 'origin/maint^0'

=> a commit is advertised, but in fact it seems to require a refspec

-- 
Yann Dirson - Bertin Technologies

```

## Techlive Zheng, 2013-01-19 05:48

Subject: Re: [DOCBUG] git subtree synopsis needs updating
Message-ID: <20130119054801.GA1218@gmail.com>
URL: https://gitlist.dev/e/20130119054801.GA1218%40gmail.com
In-Reply-To: <5082FE13.2000003@initfour.nl>

```
On 12-10-20, Herman van Rink wrote:
> On 10/19/2012 03:21 PM, Yann Dirson wrote:
> > As the examples in git-subtree.txt show, the synopsis in the same file should
> > surely get a patch along the lines of:
> >
> > -'git subtree' add   -P <prefix> <commit>
> > +'git subtree' add   -P <prefix> <repository> <commit>
> >
> > Failure to specify the repository (by just specifying a local commit) fails with
> > the cryptic:
> >
> >  warning: read-tree: emptying the index with no arguments is deprecated; use --empty
> >  fatal: just how do you expect me to merge 0 trees?
> >
> >
> > Furthermore, the doc paragraph for add, aside from mentionning <repository>, also
> > mentions a <refspec> which the synopsis does not show either.
> >
> >
> > As a sidenote it someone wants to do some maintainance, using "." as repository when
> > the branch to subtree-add is already locally available does not work well either
> > (fails with "could not find ref myremote/myhead").
> >
> 
> The version of subtree in contrib is rather out-dated unfortunately.
You should really submit these patches here for reviewing, David is
actively maintaining this tool here.
> 
> I've collected a bunch of patches in
> https://github.com/helmo/git/tree/subtree-updates
> 
> The documentation issue is also fixed in there.
> 
> -- 
> 
> Met vriendelijke groet / Regards,
> 
> Herman van Rink
> Initfour websolutions
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

```
