threads / discuss / 31868

[DOCBUG] git subtree synopsis needs updating

Subject: [DOCBUG] git subtree synopsis needs updating

## tl;dr

7 messages between Oct 19, 2012 and Jan 19, 2013.

replies: 6people: 4as markdown or json

Yann Dirson· Oct 19, 2012, 13:21 UTC · lore

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· Oct 20, 2012, 19:40 UTC · re: Yann Dirson · lore

Re: [DOCBUG] git subtree synopsis needs updating

On 10/19/2012 03:21 PM, Yann Dirson wrote:
Show 21 quoted lines
> 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· Oct 24, 2012, 14:29 UTC · re: Herman van Rink · lore

Re: [DOCBUG] git subtree synopsis needs updating

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

Show 27 quoted lines
> 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· Jan 1, 2013, 01:47 UTC · re: Yann Dirson · lore

Re: [DOCBUG] git subtree synopsis needs updating

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
Techlive Zheng· Jan 19, 2013, 05:48 UTC · re: Herman van Rink · lore

Re: [DOCBUG] git subtree synopsis needs updating

On 12-10-20, Herman van Rink wrote:
Show 24 quoted lines
> 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.

Show 17 quoted lines
> 
> 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
greened@obbligato.org· Jan 1, 2013, 02:51 UTC · re: Yann Dirson · lore

Re: [DOCBUG] git subtree synopsis needs updating

Yann Dirson <dirson@bertin.fr> writes:
Show 11 quoted lines
> 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· Jan 18, 2013, 14:37 UTC · re: greened@obbligato.org · lore

Re: [DOCBUG] git subtree synopsis needs updating

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

Show 16 quoted lines
> 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.

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

← back to recent threads