git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Unexpected behavior of git-subtree

From
Steffen Jaeckel <steffen.jaeckel@stzedn.de>
Date
Apr 30, 2013, 11:13 UTC
Message-ID
<10210336576.20130430131354@stzedn.de>
In-Reply-To
<20130429182052.GN472@serenity.lan>
On Monday, April 29, 2013, 20:20, John Keeping, <john@keeping.me.uk> wrote:
Show 5 quoted lines
> On Mon, Apr 29, 2013 at 07:34:27PM +0200, Steffen Jaeckel wrote:
>>
>> ---- snip ----
>> sjaeckel@T7400-003 /h/projects/my_project (develop)
>> $ GIT_TRACE=2 git subtree push --prefix=lib/com_lib/ git@git.local:com_lib develop -b develop
> Without knowing much about git-subtree, this looks like the culprit.  A
> quick look at cmd_push in git-subtree.sh indicates that it doesn't check
> for an error return from 'git subtree split --prefix=$prefix', so if
> that goes wrong you end up doing:
>     git push $repository :refs/heads/$refspec
> which deletes the branch.
> Can you try running this:
>     git subtree split --prefix=lib/com_lib/
> and see if that gives the same "fatal: bad object" message as above?

John, thanks for testing! I just found out that it's all about the slashes....

The solution was:
> git subtree push --prefix=lib/com_lib git@git.local:com_lib develop
look at the missing '/' at the end of the prefix.
Steffen
-- 
Steffen Jaeckel
Previous: John Keeping
Message 3 of 3 in “Unexpected behavior of git-subtree”
  1. Steffen JaeckelApr 29, 2013
  2. John KeepingApr 29, 2013
  3. Steffen JaeckelApr 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.