git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* rebase -X subtree
@ 2015-12-01  2:22 David A. Greene
  0 siblings, 0 replies; only message in thread
From: David A. Greene @ 2015-12-01  2:22 UTC (permalink / raw)
  To: git

Hi,

I had a particular notion of what rebase -X subtree would do but I am
apparently mistaken.  What should be the result of the script below?  I
expected commits to be replayed on top of master with their trees
adjusted to move files into a "files" directory.  In the first case, the
rebase seems to have done nothing.  In the second case I get an error:

First, rewinding head to replay your work on top of it...
fatal: Could not parse object '6c0826e4cf4b1f44ebafbd4084c1f0066a59d112^'
Unknown exit code (128) from command: git-merge-recursive 6c0826e4cf4b1f44ebafbd4084c1f0066a
59d112^ -- HEAD 6c0826e4cf4b1f44ebafbd4084c1f0066a59d112                                   

If "files" exists and I use rebase -X subtree it replays the commits,
moving trees out from under "files," as I would expect.  Is it not
possible to use git rebase to move trees under a new subdirectory?

I know that I can use filter-branch to accomplish what I want, I'm just
curious whether git rebase is expected to behave as I thought.  At the
very least, it seems a better error message in the orphan branch case
would be helpful.

Thanks for you help!

                      -David

#!/bin/bash

function addfile {
    name=$1
    echo ${name} > ${name}
    git add ${name}
    git commit -m "Add ${name}"
}

mkdir rebasetest1
cd rebasetest1
git init

addfile README

git checkout -b work

addfile file1

git rebase -X subtree=files --onto master master

cd ..

mkdir rebasetest2
cd rebasetest2
git init

addfile README

git checkout --orphan work

addfile file1

git rebase -X subtree=files --onto master --root

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-01  2:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  2:22 rebase -X subtree David A. Greene

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).