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

subtree merges lose prefix after rebase

From
ZEZakaria ElQotbi <zakaria@elqotbi.com>
Date
Mar 1, 2012, 15:18 UTC
Message-ID
<CALtv3HqtdUrRaGWvrwo89r3y1RQ4wy1Bzt5=RhQHaJTXS3gk9A@mail.gmail.com>
In-Reply-To
<CALtv3HphaC7d0QyR1DUowHn0Wrmrsw4YGyU4rE8YzhZX3ea6dA@mail.gmail.com>

Hi, folks! why subtree merges lose prefix after an interactive rebase, is it a known issue ? or I'am missing somethings:

$ for project in a b c ; do
    mkdir $project
    ( cd $project ; git init; touch ${project^} ; git add ${project^}
; git commit -m "add ${project^}" )
   done
$ tree
.
|-- a
|   `-- A
|-- b
|   `-- B
`-- c
    `-- C
$ mkdir tree && cd tree && git init
$ touch README && git add README && git commit -m "add readme"
$ for project in a b c ; do
  mkdir -p projects/$project
  git remote add -f $project ../$project
  git merge -s ours --no-commit $project/master
  git read-tree --prefix=projects/$project -u $project/master
  git commit -m "merge $project into tree"
  git pull -s subtree $project master
 done
$ tree
.
|-- projects
|   |-- a
|   |   `-- A
|   |-- b
|   |   `-- B
|   `-- c
|       `-- C
`-- README
$ git rebase -i -p a6d4e8e # this the hash of "merge b" commit
$ git commit --amend -m "merge b edit"
$ git rebase --continue
$ tree
.
|-- C
|-- projects
|   |-- a
|   |   `-- A
|   `-- b
|       `-- B
`-- README

Best regards -- Zakaria ElQotbi 4096R/3DC2241A

"The secret of creativity is knowing how to hide your sources."
        - Albert Einstein
Next: Junio C Hamano
Message 1 of 2 in “subtree merges lose prefix after rebase”
  1. Zakaria ElQotbiMar 1, 2012
  2. Junio C HamanoMar 1, 2012

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.