{"thread":{"id":"4833","subject":"can I get only the list of merges?","startedAt":"2006-07-10T17:26:22Z","lastAt":"2006-07-10T22:37:33Z","messageCount":6,"participants":["Diego Calleja","Matthias Lederhofer","Linus Torvalds","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"23556","messageId":"20060710192622.70c51a81.diegocg@gmail.com","threadId":"4833","inReplyTo":null,"subject":"can I get only the list of merges?","fromName":"Diego Calleja","fromEmail":"diegocg@gmail.com","sentAt":"2006-07-10T17:26:22Z","receivedAt":"2006-07-10T17:26:22Z","isPatch":false,"sender":{"key":"diegocg@gmail.com","avatar":null},"body":"Hi, git-log and git-rev-list and friends have a --no-merges option. However,\nI need the contrary functionality: a sort of \"--only-merges\" way of getting\nthe log? (that is, without parsing manually the git-log output)\n"},{"id":"23557","messageId":"E1FzzlS-0003JE-9C@moooo.ath.cx","threadId":"4833","inReplyTo":"20060710192622.70c51a81.diegocg@gmail.com","subject":"Re: can I get only the list of merges?","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-07-10T17:41:46Z","receivedAt":"2006-07-10T17:41:46Z","isPatch":false,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Diego Calleja <diegocg@gmail.com> wrote:\n> Hi, git-log and git-rev-list and friends have a --no-merges option. However,\n> I need the contrary functionality: a sort of \"--only-merges\" way of getting\n> the log? (that is, without parsing manually the git-log output)\n\nPerhaps something like this?  It finds all commits with more than one\nparent (I dunno if there are any other commits that have more than one\nparent)\ngit-rev-list --parents HEAD | \\\ngrep -E '^([a-z0-9]{40} ){2}[a-z0-9]{40}' | \\\ncut -d ' ' -f 1\n"},{"id":"23558","messageId":"E1G000X-0004om-A0@moooo.ath.cx","threadId":"4833","inReplyTo":"20060710192622.70c51a81.diegocg@gmail.com","subject":"[PATCH] git-rev-list: add documentation for --parents, --no-merges","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-07-10T17:57:21Z","receivedAt":"2006-07-10T17:57:21Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"---\nBtw: grep -E ' .* ' should work too.\n\n Documentation/git-rev-list.txt |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex e220842..f60eacd 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -56,6 +56,9 @@ OPTIONS\n \tPrint the contents of the commit in raw-format; each\n \trecord is separated with a NUL character.\n \n+--parents::\n+\tPrint the parents of the commit.\n+\n --objects::\n \tPrint the object IDs of any object referenced by the listed commits.\n \t'git-rev-list --objects foo ^bar' thus means \"send me all object IDs\n@@ -102,6 +105,9 @@ OPTIONS\n --remove-empty::\n \tStop when a given path disappears from the tree.\n \n+--no-merges::\n+\tDo not print commits with more than one parent.\n+\n --not::\n \tReverses the meaning of the '{caret}' prefix (or lack\n \tthereof) for all following revision specifiers, up to\n-- \n1.4.1.gf157-dirty\n"},{"id":"23559","messageId":"Pine.LNX.4.64.0607101103160.5623@g5.osdl.org","threadId":"4833","inReplyTo":"E1FzzlS-0003JE-9C@moooo.ath.cx","subject":"Re: can I get only the list of merges?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-10T18:09:21Z","receivedAt":"2006-07-10T18:09:21Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 10 Jul 2006, Matthias Lederhofer wrote:\n\n> Diego Calleja <diegocg@gmail.com> wrote:\n> > Hi, git-log and git-rev-list and friends have a --no-merges option. However,\n> > I need the contrary functionality: a sort of \"--only-merges\" way of getting\n> > the log? (that is, without parsing manually the git-log output)\n> \n> Perhaps something like this?  It finds all commits with more than one\n> parent (I dunno if there are any other commits that have more than one\n> parent)\n> git-rev-list --parents HEAD | \\\n> grep -E '^([a-z0-9]{40} ){2}[a-z0-9]{40}' | \\\n> cut -d ' ' -f 1\n\nWell, the above is the \"proper\" way of doing things, and is efficient and \ngives the right answer. However, if you want a _sneaky_ way of doing it, \nand want a graphical result, and have a recent version of git, you can \nalso just do something like\n\n\tgitk --full-history -- %%nonexistant-file%%\n\nwhich will give you each commit that changes that nonexistant file (there \nshould be none ;), and the full commit history for those (ie all the \nmerges).\n\n(If you use \"git log\", you also need to add \"--parents\" while gitk will do \nit for you).\n\n\t\t\tLinus\n"},{"id":"23564","messageId":"Pine.LNX.4.64.0607101145590.5623@g5.osdl.org","threadId":"4833","inReplyTo":"Pine.LNX.4.64.0607101103160.5623@g5.osdl.org","subject":"Re: can I get only the list of merges?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-10T18:51:08Z","receivedAt":"2006-07-10T18:51:08Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 10 Jul 2006, Linus Torvalds wrote:\n>\n> However, if you want a _sneaky_ way of doing it, and want a graphical \n> result, and have a recent version of git, you can also just do something \n> like\n> \n> \tgitk --full-history -- %%nonexistant-file%%\n> \n> which will give you each commit that changes that nonexistant file (there \n> should be none ;), and the full commit history for those (ie all the \n> merges).\n\nBtw, a better way to do the same is probably\n\n\tgitk --full-history -- a//b\n\nwhich is guaranteed to not match any files and doesn't depend on just an \n_unlikely_ filename. Instead, it depends on the fact that a name with a \ndouble slash should not exist in a git archive.\n\n(There are other possibilities too - instead of \"a//a\", you can just use \nthe filename \".git\", for the same reasons - it definitely won't be tracked \nby git).\n\n\t\tLinus\n"},{"id":"23590","messageId":"Pine.LNX.4.63.0607110035390.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4833","inReplyTo":"E1FzzlS-0003JE-9C@moooo.ath.cx","subject":"Re: can I get only the list of merges?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-10T22:37:33Z","receivedAt":"2006-07-10T22:37:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 10 Jul 2006, Matthias Lederhofer wrote:\n\n> git-rev-list --parents HEAD | \\\n> grep -E '^([a-z0-9]{40} ){2}[a-z0-9]{40}' | \\\n\nSince the output of git-rev-list is well-defined, you could say\n\n\tgrep  '.{121}'\n\ninstead. (Instead of 121, you could take any number between 83 and 122.)\n\nCiao,\nDscho\n"}]}