summaryrefslogtreecommitdiff
path: root/t/t3412-rebase-root.sh
AgeCommit message (Collapse)Author
2009-02-04t3412: further simplify setting of GIT_EDITORJunio C Hamano
2182896 (t3412: clean up GIT_EDITOR usage, 2009-01-30) tried to clean up the script's use of GIT_EDITOR, but it can further be simplified, because that is how test-lib.sh sets things up already. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-02t3412: use log|name-rev instead of log --graphThomas Rast
Replace all 'git log --graph' calls for history verification with the combination of 'git log ...| git name-rev' first introduced by a6c7a27 (rebase -i: correctly remember --root flag across --continue, 2009-01-26). This should be less susceptible to format changes than the --graph code. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31t3412: clean up GIT_EDITOR usageThomas Rast
a6c7a27 (rebase -i: correctly remember --root flag across --continue, 2009-01-26) introduced a more portable GIT_EDITOR usage, but left the old tests unchanged. Since we never use the editor (all tests run the rebase script as proposed by rebase -i), just disable it outright, which simplifies the tests. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-29Simplify t3412Johannes Schindelin
Use the newly introduced test_commit() and test_merge() helpers. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-27tests: Avoid single-shot environment export for shell function invocationJunio C Hamano
Some shells have issues with a single-shot environment variable export when invoking a shell function. This fixes the ones I found that invoke test_must_fail that way. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-27rebase -i: correctly remember --root flag across --continueJunio C Hamano
d911d14 (rebase -i: learn to rebase root commit, 2009-01-02) tried to remember the --root flag across a merge conflict in a broken way. Introduce a flag file $DOTEST/rebase-root to fix and clarify. While at it, also make sure $UPSTREAM is always initialized to guard against existing values in the environment. [tr: added tests] Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-12rebase -i: learn to rebase root commitThomas Rast
Teach git-rebase -i a new option --root, which instructs it to rebase the entire history leading up to <branch>. This is mainly for symmetry with ordinary git-rebase; it cannot be used to edit the root commit in-place (it requires --onto <newbase>). Commits that already exist in <newbase> are skipped. In the normal mode of operation, this is fairly straightforward. We run cherry-pick in a loop, and cherry-pick has supported picking the root commit since f95ebf7 (Allow cherry-picking root commits, 2008-07-04). In --preserve-merges mode, we track the mapping from old to rewritten commits and use it to update the parent list of each commit. In this case, we define 'rebase -i -p --root --onto $onto $branch' to rewrite the parent list of all root commit(s) on $branch to contain $onto instead. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-12rebase: learn to rebase root commitThomas Rast
Teach git-rebase a new option --root, which instructs it to rebase the entire history leading up to <branch>. This option must be used with --onto <newbase>, and causes commits that already exist in <newbase> to be skipped. (Normal operation skips commits that already exist in <upstream> instead.) One possible use-case is with git-svn: suppose you start hacking (perhaps offline) on a new project, but later notice you want to commit this work to SVN. You will have to rebase the entire history, including the root commit, on a (possibly empty) commit coming from git-svn, to establish a history connection. This previously had to be done by cherry-picking the root commit manually. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>