Skip to contentSkip to conversation

git subtree synopsis needs updating

DOCBUG Yann Dirson 4 participants 7 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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").

Signature · 1 line
Yann Dirson - Bertin Technologies
#1 lore raw
Quoted 13 lines · Yann Dirson

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?

Quoted 8 lines

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.

Signature · 4 lines
Met vriendelijke groet / Regards,

Herman van Rink
Initfour websolutions
#2 lore raw
Quoted 23 lines · On Sat, 20 Oct 2012 21:40:03 +0200 Herman van Rink <[email protected]> wrote:
Quoted 13 lines · Yann Dirson

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?

Quoted 8 lines

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").

Quoted 4 lines

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.

Quoted 2 lines

The documentation issue is also fixed in there.

Signature · 1 line
Yann Dirson - Bertin Technologies
#3 lore raw
Quoted 1 line · Yann Dirson

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

#4 lore raw
In reply to Herman van Rink
Quoted 18 lines · Herman van Rink
Quoted 17 lines · Yann Dirson

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.

Quoted 6 lines
Quoted 4 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").

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.

Quoted 17 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.

Signature · 9 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw
In reply to Yann Dirson
Quoted 11 lines · Yann Dirson

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.

Quoted 2 lines

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

Fixed.

Quoted 3 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?

Thanks for the report!

-David

#6 lore raw
Quoted 8 lines · On Mon, 31 Dec 2012 20:51:41 -0600 [email protected] wrote:
Quoted 6 lines · Yann Dirson

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>

Quoted 8 lines
Quoted 5 lines

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.

Quoted 6 lines
Quoted 3 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

Signature · 1 line
Yann Dirson - Bertin Technologies