git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git fast-import : How to change parent during import?
@ 2011-03-08  1:21 Vitor Antunes
  2011-03-08  2:44 ` Jonathan Nieder
  0 siblings, 1 reply; 9+ messages in thread
From: Vitor Antunes @ 2011-03-08  1:21 UTC (permalink / raw)
  To: git

Hi everyone,

Is it possible to change the parent of a commit during fast import?
I've tried using "reset" command and making a new commit pointing to a
new parent, but in both cases I get a "new tip ... does not contain
..." error message.

Providing a bit of context. I'm trying to improve git-p4 to detect the
parent commit of a new branch. Unfortunately, in Perforce a branch is
nothing more than a copy of a bunch of files into a new location.
Because the origin of the copy can be any past commit and there is no
information about which commit was used it is very difficult to
identify a parent of a new branch. But if we assume that in this copy
process no file is modified then it should be possible to identify the
parent commit simply by comparing their SHA-1.
To achieve this I used the checkpoint command to flush the list of
imported commits to disk and then used standard rev-list and diff-tree
commands to make find the parent commit. I am now at a point where I
am able to correctly identify the parent commit, but when trying to
update the from information I get the above message.

Thanks in advance for your help,
-- 
Vitor Antunes

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-29  1:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08  1:21 git fast-import : How to change parent during import? Vitor Antunes
2011-03-08  2:44 ` Jonathan Nieder
2011-03-08 21:19   ` Vitor Antunes
2011-03-08 22:23     ` Jonathan Nieder
2011-03-09 14:21       ` Vitor Antunes
2011-03-30 17:25       ` Vitor Antunes
2011-08-28 15:23   ` Vitor Antunes
2011-08-28 23:39     ` Jonathan Nieder
2011-08-29  1:13       ` Sverre Rabbelier

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 NNTP newsgroup(s).