{"thread":{"id":"43104","subject":"Re: Struggling with tangled","startedAt":"2006-11-22T10:37:19Z","lastAt":"2006-11-22T19:40:00Z","messageCount":7,"participants":["Alan Chandler","Junio C Hamano","Jakub Narebski","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"295132","messageId":"E1GmpTj-000235-2n@home.chandlerfamily.org.uk","threadId":"43104","inReplyTo":null,"subject":"Struggling with tangled","fromName":"Alan Chandler","fromEmail":"alan@chandlerfamily.org.uk","sentAt":"2006-11-22T10:37:19Z","receivedAt":"2006-11-22T10:37:19Z","isPatch":false,"sender":{"key":"alan@chandlerfamily.org.uk","avatar":"https://gravatar.com/avatar/1862247e5ea8eac114c842f9dc3a5db6253754e24ef7171757cf97eedce48b8c?d=mp&s=160"},"body":"I am trying to sort out a tangled (in the sense that I several branches that \nsplit a long time ago, but are reasonably close subsets of each other) \nrepository of mine using git rebase.  I want to isolate the commits that \ncause the key differences so that I can then easily enhance the code but \ncarry forward the variants (using git-rebase again probably). \n\nI have some questions which are causing me some grief after merge conflicts. \nCan someone help me. \n\n1) I often edit a merge conflicted file to the state I expect it to be in at \nthe end.  This sometimes means that I edit it to a state where no change is \nseen.  git-update-index notices this and doesn't do anything, but when I try \ngit-rebase --continue it won't because it says git-update-index has not been \nrun.  What am I supposed to do then? [Is the answer git-rebase --skip ?] \n\n2) Some files get completely munged with conflict resolution markers every \nfew lines.  Is there a simple way to say \"don't use this file, but use the \n[stage2/stage3] sources of the merge\". (ie one of the original inputs to the \nmerge - and if so, which one is which) \n\n3) I sometime hit a merge conflict in a file which I know will actually be \ndeleted at the tip of the topic I am rebasing.  Is there a way at this point \nto just tell the conflict resolution to say make this file go away. \n\n4) I repeat the question I asked in a thread above.  What is the --merge \nswitch on git-rebase actually do.  The man page starts talking about merge \nstrategies, but there already is a -s switch for that. \n\n --\nAlan Chandler\nalan@chandlerfamily.org.uk\n"},{"id":"298354","messageId":"ek1aj0$u09$1@sea.gmane.org","threadId":"43104","inReplyTo":"E1GmpTj-000235-2n@home.chandlerfamily.org.uk","subject":"Re: Struggling with tangled","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-22T11:01:15Z","receivedAt":"2006-11-22T11:01:15Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Alan Chandler wrote:\n\n> I am trying to sort out a tangled (in the sense that I several branches that \n> split a long time ago, but are reasonably close subsets of each other) \n> repository of mine using git rebase.  I want to isolate the commits that \n> cause the key differences so that I can then easily enhance the code but \n> carry forward the variants (using git-rebase again probably). \n> \n> I have some questions which are causing me some grief after merge conflicts. \n> Can someone help me. \n> \n> 1) I often edit a merge conflicted file to the state I expect it to be in at \n> the end.  This sometimes means that I edit it to a state where no change is \n> seen.  git-update-index notices this and doesn't do anything, but when I try \n> git-rebase --continue it won't because it says git-update-index has not been \n> run.  What am I supposed to do then? [Is the answer git-rebase --skip ?] \n\nIf you resolve conflict to the state where no change is seen, it means that\nthe commit you currently are rebasing doesn't bring any changes; it was\napplied. So you have to do \"git rebase --skip\".\n\nSidenote: with git version 1.4.3.4 you cannot \"git rebase --skip\" while\nthere are conflict in the index. It is most annoying - I'd like to skip\nthe resolving. I bring the files in conflict to the \"base\" version and run\n\"git update-index\" before \"git rebase --skip\", but I'd like to skip that part.\n\n> 2) Some files get completely munged with conflict resolution markers every \n> few lines.  Is there a simple way to say \"don't use this file, but use the \n> [stage2/stage3] sources of the merge\". (ie one of the original inputs to the \n> merge - and if so, which one is which) \n\n\"git cat-file -p :<stage>: <filename> > <filename>\", where stage = 1 means\nversion from the ancestor, stage = 2 means version from the HEAD (from the\nbase), and stage = 3 means version from the remote/other branch (from the\nbranch being rebased).  \n\n> 3) I sometime hit a merge conflict in a file which I know will actually be \n> deleted at the tip of the topic I am rebasing.  Is there a way at this point \n> to just tell the conflict resolution to say make this file go away. \n\n\"git rm <filename>\" plus \"git update-index <filename>\" doesn't work?\n\n> 4) I repeat the question I asked in a thread above.  What is the --merge \n> switch on git-rebase actually do.  The man page starts talking about merge \n> strategies, but there already is a -s switch for that. \n\n\"git rebase\" uses \"git format-patch\" + \"git-am --3way\" machinery by default.\nThe --merge option makes it use merge machinery instead (similar to the way \n\"git checkout -m\" uses merge strategy IIRC).\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"296215","messageId":"Pine.LNX.4.63.0611221233370.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43104","inReplyTo":"E1GmpTj-000235-2n@home.chandlerfamily.org.uk","subject":"Re: Struggling with tangled","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-22T11:35:52Z","receivedAt":"2006-11-22T11:35:52Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 22 Nov 2006, Alan Chandler wrote:\n\n> 2) Some files get completely munged with conflict resolution markers \n> every few lines.  Is there a simple way to say \"don't use this file, but \n> use the [stage2/stage3] sources of the merge\". (ie one of the original \n> inputs to the merge - and if so, which one is which)\n\nI find myself using\n\n\tgit diff --ours <file>\n\nand\n\n\tgit diff --theirs <file>\n\nin such a case sometimes. If I _know_ my version is good, I do\n\n\tgit diff --ours <file> | git apply -R\n\nThis also updates the index.\n\nHth,\nDscho\n"},{"id":"294414","messageId":"7vu00rsnho.fsf@assigned-by-dhcp.cox.net","threadId":"43104","inReplyTo":"Pine.LNX.4.63.0611221233370.30004@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Struggling with tangled","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-22T11:57:07Z","receivedAt":"2006-11-22T11:57:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi,\n>\n> On Wed, 22 Nov 2006, Alan Chandler wrote:\n>\n>> 2) Some files get completely munged with conflict resolution markers \n>> every few lines.  Is there a simple way to say \"don't use this file, but \n>> use the [stage2/stage3] sources of the merge\". (ie one of the original \n>> inputs to the merge - and if so, which one is which)\n>\n> I find myself using\n>\n> \tgit diff --ours <file>\n>\n> and\n>\n> \tgit diff --theirs <file>\n>\n> in such a case sometimes. If I _know_ my version is good, I do\n>\n> \tgit diff --ours <file> | git apply -R\n>\n> This also updates the index.\n\nGood suggestion, but apply does not update the index without\nbeing told to do so with --index, so I think the commandline\nshould be:\n\n\tgit diff --ours <path> | git apply -R --index\n"},{"id":"295959","messageId":"Pine.LNX.4.63.0611221429470.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43104","inReplyTo":"7vu00rsnho.fsf@assigned-by-dhcp.cox.net","subject":"Re: Struggling with tangled","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-22T13:30:16Z","receivedAt":"2006-11-22T13:30:16Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 22 Nov 2006, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > \tgit diff --ours <file> | git apply -R\n> >\n> > This also updates the index.\n> \n> Good suggestion, but apply does not update the index without\n> being told to do so with --index, so I think the commandline\n> should be:\n> \n> \tgit diff --ours <path> | git apply -R --index\n\nOops. Thanks!\nDscho\n"},{"id":"293849","messageId":"200611221915.59073.alan@chandlerfamily.org.uk","threadId":"43104","inReplyTo":"ek1aj0$u09$1@sea.gmane.org","subject":"Re: Struggling with tangled","fromName":"Alan Chandler","fromEmail":"alan@chandlerfamily.org.uk","sentAt":"2006-11-22T19:15:58Z","receivedAt":"2006-11-22T19:15:58Z","isPatch":false,"sender":{"key":"alan@chandlerfamily.org.uk","avatar":"https://gravatar.com/avatar/1862247e5ea8eac114c842f9dc3a5db6253754e24ef7171757cf97eedce48b8c?d=mp&s=160"},"body":"On Wednesday 22 November 2006 11:01, Jakub Narebski wrote:\n> Alan Chandler wrote:\n...\n> > 2) Some files get completely munged with conflict resolution markers\n> > every few lines.  Is there a simple way to say \"don't use this file, but\n> > use the [stage2/stage3] sources of the merge\". (ie one of the original\n> > inputs to the merge - and if so, which one is which)\n>\n> \"git cat-file -p :<stage>: <filename> > <filename>\", where stage = 1 means\n> version from the ancestor, stage = 2 means version from the HEAD (from the\n> base), and stage = 3 means version from the remote/other branch (from the\n> branch being rebased).\n\nJust a comment for the list.  There have been lots of documentation ideas \nfloating around recently.  One thing that could be done is to cross reference \nthe key sections in the man pages somewhat.  I read the man page for \ngit-cat-file, and that just says the non flag parameter is <object> and its \nan SHA1.\n\nOnce I saw this, I was puzzled and eventually found a reference to in in \ngit-rev-parse.\n\n\n>\n> > 3) I sometime hit a merge conflict in a file which I know will actually\n> > be deleted at the tip of the topic I am rebasing.  Is there a way at this\n> > point to just tell the conflict resolution to say make this file go away.\n>\n> \"git rm <filename>\" plus \"git update-index <filename>\" doesn't work?\n\nWell I _thought_ I tried git-update-index --remove and that hadn't worked.\n\n>\n> > 4) I repeat the question I asked in a thread above.  What is the --merge\n> > switch on git-rebase actually do.  The man page starts talking about\n> > merge strategies, but there already is a -s switch for that.\n>\n> \"git rebase\" uses \"git format-patch\" + \"git-am --3way\" machinery by\n> default. The --merge option makes it use merge machinery instead (similar\n> to the way \"git checkout -m\" uses merge strategy IIRC).\n\nYes but ...\n\n... what does that mean in usage terms?\n\nWhy would I want to use one rather than the other?\n\n\n\n-- \nAlan Chandler\n"},{"id":"294902","messageId":"ek28vh$f6f$1@sea.gmane.org","threadId":"43104","inReplyTo":"200611221915.59073.alan@chandlerfamily.org.uk","subject":"Re: Struggling with tangled","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-22T19:40:00Z","receivedAt":"2006-11-22T19:40:00Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Alan Chandler wrote:\n\n> On Wednesday 22 November 2006 11:01, Jakub Narebski wrote:\n>> Alan Chandler wrote:\n\n>>> 3) I sometime hit a merge conflict in a file which I know will actually\n>>> be deleted at the tip of the topic I am rebasing.  Is there a way at this\n>>> point to just tell the conflict resolution to say make this file go away.\n>>\n>> \"git rm <filename>\" plus \"git update-index <filename>\" doesn't work?\n> \n> Well I _thought_ I tried git-update-index --remove and that hadn't worked.\n\nI think \"git update-index --force-remove\" might be needed here.\n\n>>> 4) I repeat the question I asked in a thread above.  What is the --merge\n>>> switch on git-rebase actually do.  The man page starts talking about\n>>> merge strategies, but there already is a -s switch for that.\n>>\n>> \"git rebase\" uses \"git format-patch\" + \"git-am --3way\" machinery by\n>> default. The --merge option makes it use merge machinery instead (similar\n>> to the way \"git checkout -m\" uses merge strategy IIRC).\n> \n> Yes but ...\n> \n> ... what does that mean in usage terms?\n> \n> Why would I want to use one rather than the other?\n\nMerge machinery can detect renames. I don't know if merge machinery supports\nskipping over commits. The format-patch/am --3way machinery was first (and\nis default).\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"}]}