{"thread":{"id":"15806","subject":"merge -s ffonly","startedAt":"2008-10-06T23:56:11Z","lastAt":"2008-10-08T15:41:06Z","messageCount":5,"participants":["Shawn O. Pearce","Uwe Kleine-König","Andreas Ericsson","Deskin Miller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"92464","messageId":"20081006235611.GA17662@spearce.org","threadId":"15806","inReplyTo":null,"subject":"merge -s ffonly","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-06T23:56:11Z","receivedAt":"2008-10-06T23:56:11Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"I really don't care about this feature.  But Randal's whining on\n#git made me stop what I was doing and write something that might\nturn into it.\n\nTotally untested code.  It might reformat your C:\\ drive and install\nWindows ME.  Install as $(git --exec-path)/git-merge-ffonly and\ncall as `git merge -s ffonly`.\n\nIf you care about this sort of feature, test it, write tests for it,\nmake a formal patch, and send it for review.  No, I will not do this\nfor you.  As I said, I don't care about this as a feature.\n\n--8<--\ndiff --git a/git-merge-ffonly.sh b/git-merge-ffonly.sh\nnew file mode 100644\nindex 0000000..24363b5\n--- /dev/null\n+++ b/git-merge-ffonly.sh\n@@ -0,0 +1,20 @@\n+#!/bin/sh\n+while test $# -gt 0\n+do\n+\tif test \"z$1\" = z--\n+\tthen\n+\t\tshift\n+\t\tbreak\n+\telse\n+\t\tshift\n+\tfi\n+done\n+\n+while test $# -gt 0\n+do\n+\tif test -n \"$(git rev-list $1..HEAD)\"\n+\tthen\n+\t\texit 2\n+\tfi\n+\tshift\n+done\n\n-- \nShawn.\n"},{"id":"92562","messageId":"20081007185815.GA10744@strlen.de","threadId":"15806","inReplyTo":"20081006235611.GA17662@spearce.org","subject":"[RFC] git rev-contains [Was: merge -s ffonly]","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@strlen.de","sentAt":"2008-10-07T18:58:15Z","receivedAt":"2008-10-07T18:58:15Z","isPatch":false,"sender":{"key":"ukleinek@strlen.de","avatar":"https://gravatar.com/avatar/71e008a89bd4c9d95c03e4823fa14b01e7f658bfc746c8a735286b945417f2d6?d=mp&s=160"},"body":"Hello,\n\n> +\tif test -n \"$(git rev-list $1..HEAD)\"\nI already wrote similar tests and I wonder if this couldn't be done in a\nnew builtin command more effectively.  Something like\n\n\tgit rev-contains HEAD \"$1\"\n\n.  I expect it to be faster and maybe it prevents a command line\noverflow?!  (I remember something like 32000 chars max in a command, but\nI could not trigger that with bash.)\n\nBest regards\nUwe\n"},{"id":"92583","messageId":"48EC50C8.4000603@op5.se","threadId":"15806","inReplyTo":"20081007185815.GA10744@strlen.de","subject":"Re: [RFC] git rev-contains [Was: merge -s ffonly]","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-10-08T06:18:48Z","receivedAt":"2008-10-08T06:18:48Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Uwe Kleine-König wrote:\n> Hello,\n> \n>> +\tif test -n \"$(git rev-list $1..HEAD)\"\n> I already wrote similar tests and I wonder if this couldn't be done in a\n> new builtin command more effectively.  Something like\n> \n> \tgit rev-contains HEAD \"$1\"\n> \n> .  I expect it to be faster and maybe it prevents a command line\n> overflow?!  (I remember something like 32000 chars max in a command, but\n> I could not trigger that with bash.)\n> \n\nOn Linux (well, on my system anyways), it's 128K for arguments and\nenvironment combined.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"92621","messageId":"20081008143050.GG3052@riemann.deskinm.fdns.net","threadId":"15806","inReplyTo":"20081007185815.GA10744@strlen.de","subject":"Re: [RFC] git rev-contains [Was: merge -s ffonly]","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-10-08T14:30:50Z","receivedAt":"2008-10-08T14:30:50Z","isPatch":false,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"On Tue, Oct 07, 2008 at 08:58:15PM +0200, =?ISO-8859-1?Q?Uwe_Kleine-K=F6nig_ wrote:\n> > +\tif test -n \"$(git rev-list $1..HEAD)\"\n> I already wrote similar tests and I wonder if this couldn't be done in a\n> new builtin command more effectively.  Something like\n> \n> \tgit rev-contains HEAD \"$1\"\n> \n> .  I expect it to be faster and maybe it prevents a command line\n> overflow?! [...]\n \nI'm not sure this warrants a builtin; seems like test is perfectly capable of\ndoing what you want:\n\nif test '(' -n \"$(git rev-list --max-count=1 $1..HEAD)\" ')' -a \\\n\t'(' -z \"$(git rev-list --max-count=1 HEAD..$1)\" ')'\n\nThe second check is needed to ensure that the commits actually have an\nancestor-descendant relationship.  And --max-count means your command line\nwon't overflow.\n\nOr what about this:\n\nif test \"$(git merge-base $1 HEAD)\" = \"$(git rev-parse $1)\"\n\nMy $0.02,\nDeskin Miller\n"},{"id":"92623","messageId":"20081008154106.GA18549@strlen.de","threadId":"15806","inReplyTo":"20081008143050.GG3052@riemann.deskinm.fdns.net","subject":"Re: [RFC] git rev-contains [Was: merge -s ffonly]","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@strlen.de","sentAt":"2008-10-08T15:41:06Z","receivedAt":"2008-10-08T15:41:06Z","isPatch":false,"sender":{"key":"ukleinek@strlen.de","avatar":"https://gravatar.com/avatar/71e008a89bd4c9d95c03e4823fa14b01e7f658bfc746c8a735286b945417f2d6?d=mp&s=160"},"body":"Hello Deskin,\n\nOn Wed, Oct 08, 2008 at 10:30:50AM -0400, Deskin Miller wrote:\n> On Tue, Oct 07, 2008 at 08:58:15PM +0200, =?ISO-8859-1?Q?Uwe_Kleine-K=F6nig_ wrote:\n> > > +\tif test -n \"$(git rev-list $1..HEAD)\"\n> > I already wrote similar tests and I wonder if this couldn't be done in a\n> > new builtin command more effectively.  Something like\n> > \n> > \tgit rev-contains HEAD \"$1\"\n> > \n> > .  I expect it to be faster and maybe it prevents a command line\n> > overflow?! [...]\n>  \n> I'm not sure this warrants a builtin; seems like test is perfectly capable of\n> doing what you want:\n> \n> if test '(' -n \"$(git rev-list --max-count=1 $1..HEAD)\" ')' -a \\\n> \t'(' -z \"$(git rev-list --max-count=1 HEAD..$1)\" ')'\n> \n> The second check is needed to ensure that the commits actually have an\n> ancestor-descendant relationship.\nThis is needed for the original patch, too, isn't it.\n\n>                                    And --max-count means your command line\n> won't overflow.\nah, --max-count is a nice idea.  Topgit could benefit from it.\n \n> Or what about this:\n> \n> if test \"$(git merge-base $1 HEAD)\" = \"$(git rev-parse $1)\"\n\nIt's not entirely clear to me, this works in general, because a\nmerge-base isn't unique.  It should work in this case, though.\n\nBest regards\nUwe\n"}]}