[TopGit PATCH] tg import: fix + make more robust

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



a5bf892d0900cbf9949f628c3e05db599341a02c (tg import: Check out new files
as we go) broke tg-import. This is how it fails after that change:

    $ tg import Z~~..Z
    tg: ---- Importing e3e8c1382fe4cedca31e955910914ae0033455eb to t/Z
    tg: Automatically marking dependency on master
    tg: Creating t/Z base from master...
    Switched to a new branch "t/Z"
    tg: Topic branch t/Z set up. Please fill .topmsg now and make initial commit.
    tg: To abort: git rm -f .top* && git checkout master && tg delete t/Z
    fatal: pathspec '.topdeps' did not match any files

That's why, when we do git read-tree -u -m it _kills_ .topmsg and
.topdep both in index and in working tree!

Also, imagine that we are going to import patch C onto A

o---B---A
     \
      C

With read-tree we'll *override* any change in common files between A and
B, so I think read-tree is wrong here (it was ok if we are importing
on top of B).

What is right it seems, is to work on diff level -- to use cherry-pick.
And since cherry-pick does not kill our already-in-index .topmsg and
.topdeps we automatically fix the breakage.

Signed-off-by: Kirill Smelkov <kirr@xxxxxxxxxxxxxxxxxxx>
---
 tg-import.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tg-import.sh b/tg-import.sh
index 68477f0..799efc9 100644
--- a/tg-import.sh
+++ b/tg-import.sh
@@ -61,7 +61,7 @@ process_commit()
 	branch_name=$(get_branch_name "$commit")
 	info "---- Importing $commit to $branch_prefix$branch_name"
 	tg create "$branch_prefix""$branch_name"
-	git read-tree -u -m "$commit"
+	git cherry-pick --no-commit "$commit"
 	get_commit_msg "$commit" > .topmsg
 	git add -f .topmsg .topdeps
 	git commit -C "$commit"
-- 
1.6.0.2.250.g965aa

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux