{"thread":{"id":"5450","subject":"Joining a fixed archive with its continuation","startedAt":"2006-09-01T11:56:21Z","lastAt":"2006-09-01T14:37:50Z","messageCount":3,"participants":["Sergio Callegari","Jakub Narebski","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"26183","messageId":"44F81FE5.1040509@arces.unibo.it","threadId":"5450","inReplyTo":null,"subject":"Joining a fixed archive with its continuation","fromName":"Sergio Callegari","fromEmail":"scallegari@arces.unibo.it","sentAt":"2006-09-01T11:56:21Z","receivedAt":"2006-09-01T11:56:21Z","isPatch":false,"sender":{"key":"scallegari@arces.unibo.it","avatar":null},"body":"Hi,\n\nI am trying to follow Johannes (Dscho) suggestions to join a fixed\narchive with a new archive, that is its continuation from the latest\nworking tree.\nI am having some trouble with rebase, and any help would be appreciated.\n>\n> You can \"graft\" the new onto the old branch:\n>   \nYes, grafts are fine... however, if I am to use push/pull for\ntransferring data between two computers I am working on, I'd like better\na \"history rewriting\" approach, so that I do not need to manually copy\nthe grafts.\n\n> NOTE! This is the quickest way if you want to have the history _locally_.\n>\n> If you want to be able to distribute it (or synchronize it between your \n> laptop and PC _with git!_), you can rewrite the history by either \n> git-rebase, or by using cg-admin-rewritehist if you are using cogito.\n>\n>   \nI have tried using git-rebase (I do not have cg, at least not yet).\nHowever I am encountering some problems...\n\nEverything is fine with the master branch of my continuation archive doing\n\ngit rebase fixed-master master\n\n(where fixed-master is the master head of the recovered archive)\nThis does the trick nicely. I.e. I start with\n\nA---B---C---D    E---F---G---H---I\n\n\nwhere D is fixed-master and I is master, and I end up with\n\nA---B---C---D---E'---F'---G'---H'---I'\n\nplus the older tree E---...---I\n\nHowever I am then in trouble with the other branches of the continuation\narchive, which I simply cannot get right...\nIn fact, E...I has actually a branch, say at G, like in\n\nE---F---G---H---I\n         \\\n          --M---N\n\n\nAnd I cannot make an M'---N' based at G'... the best that I am\nsucceeding in is building an\n\nE''--F''--G''--M'--N'\n\n\nbased on D.\n\n> Ciao,\n> Dscho\n>\n> P.S.: Of course, if you do not insist on a super clean history, you can \n> fake a merge. Just put <40-hex-chars-old> into .git/MERGE_HEAD and commit. \n> This will pretend that your new head and your old head were merged, and \n> the result is the new head. This _should_ even work with git-bisect, but \n> it is slightly ugly.\n\nBefore I try, can you better explain me what shall go on in this case?\nThe man page of commit actually does not say much about commit behavior\nduring a merge (i.e. with MERGE_HEAD set).\n\nThanks,\n\nSergio\n"},{"id":"26185","messageId":"ed9f3e$cvm$1@sea.gmane.org","threadId":"5450","inReplyTo":"44F81FE5.1040509@arces.unibo.it","subject":"Re: Joining a fixed archive with its continuation","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-09-01T14:12:04Z","receivedAt":"2006-09-01T14:12:04Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Sergio Callegari wrote:\n\n>> If you want to be able to distribute it (or synchronize it between your \n>> laptop and PC _with git!_), you can rewrite the history by either \n>> git-rebase, or by using cg-admin-rewritehist if you are using cogito.\n>>\n>>   \n> I have tried using git-rebase (I do not have cg, at least not yet).\n> However I am encountering some problems...\n> \n> Everything is fine with the master branch of my continuation archive doing\n> \n> git rebase fixed-master master\n> \n> (where fixed-master is the master head of the recovered archive)\n> This does the trick nicely. I.e. I start with\n> \n> A---B---C---D    E---F---G---H---I\n> \n> \n> where D is fixed-master and I is master, and I end up with\n> \n> A---B---C---D---E'---F'---G'---H'---I'\n> \n> plus the older tree E---...---I\n> \n> However I am then in trouble with the other branches of the continuation\n> archive, which I simply cannot get right...\n> In fact, E...I has actually a branch, say at G, like in\n> \n> E---F---G---H---I\n>          \\\n>           --M---N\n> \n> \n> And I cannot make an M'---N' based at G'... the best that I am\n> succeeding in is building an\n> \n> E''--F''--G''--M'--N' \n> \n> based on D.\n\nIt is where --onto parameter of git-rebase is used. It means you use\n<upstream> parameter to identify main branch in the continuation archive,\n<branch> parameter being the branch you want to transplant into main\narchive (i.e. <upstream>..<branch> being the part you want to\ntransplant/rebase), and '--onto <newbase>' with <newbase> being the new\nfork point.\n\nSo in the abovementioned case, try\n\n        git rebase --onto G' I N \n\nand tell us if it works.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"26186","messageId":"Pine.LNX.4.63.0609011634370.28360@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5450","inReplyTo":"44F81FE5.1040509@arces.unibo.it","subject":"Re: Joining a fixed archive with its continuation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-09-01T14:37:50Z","receivedAt":"2006-09-01T14:37:50Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 1 Sep 2006, Sergio Callegari wrote:\n\n> > P.S.: Of course, if you do not insist on a super clean history, you can fake\n> > a merge. Just put <40-hex-chars-old> into .git/MERGE_HEAD and commit. This\n> > will pretend that your new head and your old head were merged, and the\n> > result is the new head. This _should_ even work with git-bisect, but it is\n> > slightly ugly.\n> \n> Before I try, can you better explain me what shall go on in this case?\n> The man page of commit actually does not say much about commit behavior\n> during a merge (i.e. with MERGE_HEAD set).\n\nA merge commit is almost the same as a regulaar commit; the only \ndifference is that you provide multiple parents to a merge commit. The \nfirst parent is always the current head. And the other parents are in \n.git/MERGE_HEAD (one commit SHA1 per line).\n\nSo, putting the fixed-master SHA1 into .git/MERGE_HEAD pretends that the \nfixed-master merged with the current master is the current master.\n\n>From a view point of correctness, this is _wrong_. _But_ it would work \ncorrectly with pull/push/bisect.\n\nCiao,\nDscho\n"}]}