{"thread":{"id":"25109","subject":"git log --pretty=format joins lines in the subject of commit message","startedAt":"2010-09-15T12:55:20Z","lastAt":"2010-09-17T14:55:22Z","messageCount":7,"participants":["Kirill Likhodedov","Ævar Arnfjörð Bjarmason","nolan.ring@emc.com","Daniel Johnson","Torgny Nyblom","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150735","messageId":"DDB24DEE-934B-4C8D-8DAA-595905035AC4@jetbrains.com","threadId":"25109","inReplyTo":null,"subject":"git log --pretty=format joins lines in the subject of commit message","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2010-09-15T12:55:20Z","receivedAt":"2010-09-15T12:55:20Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":"Commit something to a git repository with a commit message with several newlines like this:\n\n==== commit message starts below ===\nfirst line\nsecond line\nthird line\n\nfifth line\n=== commit message ends above ===\n\nGit treats the first 3 lines as commit message subject and the last line as its body.\n\n'git log' shows the commit message correctly - exactly like I've entered. So does 'git log --pretty=raw'\n\nBut 'git log --pretty=format:%s#%b' joins the first three lines:\nfirst line second line third line#fifth line\n\nIs it a bug or a feature?\nIf it is a feature how can I acquire the original subject of the commit message by using custom format?\n\nThanks a lot.\n\n----------------------------------\nKirill Likhodedov\nJetBrains, Inc\nhttp://www.jetbrains.com\n\"Develop with pleasure!\"\n"},{"id":"150736","messageId":"AANLkTikXwKBUKvrNs3ezKWjBh35Y87q6gZKSyZ=1cZyG@mail.gmail.com","threadId":"25109","inReplyTo":"DDB24DEE-934B-4C8D-8DAA-595905035AC4@jetbrains.com","subject":"Re: git log --pretty=format joins lines in the subject of commit message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-15T13:01:28Z","receivedAt":"2010-09-15T13:01:28Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 15, 2010 at 12:55, Kirill Likhodedov\n<Kirill.Likhodedov@jetbrains.com> wrote:\n> Commit something to a git repository with a commit message with several newlines like this:\n>\n> ==== commit message starts below ===\n> first line\n> second line\n> third line\n>\n> fifth line\n> === commit message ends above ===\n>\n> Git treats the first 3 lines as commit message subject and the last line as its body.\n>\n> 'git log' shows the commit message correctly - exactly like I've entered. So does 'git log --pretty=raw'\n>\n> But 'git log --pretty=format:%s#%b' joins the first three lines:\n> first line second line third line#fifth line\n>\n> Is it a bug or a feature?\n\nIt's probably a feature. We delimit the subject by \"\\n\\n\", not\n\"\\n\". And IIRC subjects in E-Mail can contain \\n.\n\n> If it is a feature how can I acquire the original subject of the commit message by using custom format?\n\nUse a log format that gives you the complete message, then pipe it\nthrough perl or something to parse it?\n"},{"id":"150737","messageId":"4E10ACF241081344B9702AA8C6440440C5B13F2162@MX01A.corp.emc.com","threadId":"25109","inReplyTo":"DDB24DEE-934B-4C8D-8DAA-595905035AC4@jetbrains.com","subject":"svn2git question: Build directory inserted at top level?","fromName":"","fromEmail":"nolan.ring@emc.com","sentAt":"2010-09-15T13:47:42Z","receivedAt":"2010-09-15T13:47:42Z","isPatch":false,"sender":{"key":"nolan.ring@emc.com","avatar":null},"body":"All,\n\nI'm converting repositories from svn to git using svn2git.  I have a repo with the following hierarchy:\n\ntrunk/\ndist/\ntags/\nbranches/\nREbranches/\n\nUltimately I want to convert everything except the dist directory but am trying to understand what svn2git is doing and why.\n\nI ran the command to see what I would get just importing trunk:\n\nsvn2git -v --nobranches --notags  http://poc.emc.com/repos/POCcs\n\nAfter the conversion completed I had the following:\n\nbuildadm@suse-s11:/work/POCcs> ls \nAutomation  build_cs_rpm.pl  ControlStation  depends.properties\n\nThen I ran the following command because I wanted to include the branches as well as the trunk in the conversion:\n\nsvn2git -v --notags  http://poc.emc.com/repos/POCcs\n\nWhen I include the branches in the conversion I get a Build directory at the top level and then the usual directory structure of the repo.  Where is the Build dir coming from?  Is svn2git doing that?  Or is it finding that somewhere somehow in the repo?\n\nbuildadm@suse-s11:/work/POCcs> ls\nBuild\nbuildadm@suse-s11:/work/POCcs/Build> ls\nAutomation  build_cs_rpm.pl  ControlStation  depends.properties\n\nThanks for any help.\n\nNolan\n"},{"id":"150741","messageId":"201009151344.17066.ComputerDruid@gmail.com","threadId":"25109","inReplyTo":"4E10ACF241081344B9702AA8C6440440C5B13F2162@MX01A.corp.emc.com","subject":"Re: svn2git question: Build directory inserted at top level?","fromName":"Daniel Johnson","fromEmail":"computerdruid@gmail.com","sentAt":"2010-09-15T17:44:03Z","receivedAt":"2010-09-15T17:44:03Z","isPatch":false,"sender":{"key":"computerdruid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/34696?v=4"},"body":"Sidenote: You shouldn't reply to unrelated messages when starting a new \nthread. In my mail client this shows up as a reply to \"git log --pretty=format \njoins lines in the subject of commit message\" which doesn't seem to have \nanything to do with your question.\n\nOn Wednesday 15 September 2010 09:47:42 nolan.ring@emc.com wrote:\n> When I include the branches in the conversion I get a Build directory at\n> the top level and then the usual directory structure of the repo.  Where\n> is the Build dir coming from?  Is svn2git doing that?  Or is it finding\n> that somewhere somehow in the repo?\n> \n> buildadm@suse-s11:/work/POCcs> ls\n> Build\n> buildadm@suse-s11:/work/POCcs/Build> ls\n> Automation  build_cs_rpm.pl  ControlStation  depends.properties\n\nAssuming the files are tracked by git, you might want to try running \"git log \n-- $filename\" over them to see which commits touched them.\n"},{"id":"150742","messageId":"20100915200950.50a22b36@explosive.nyblom.org","threadId":"25109","inReplyTo":"201009151344.17066.ComputerDruid@gmail.com","subject":"Re: svn2git question: Build directory inserted at top level?","fromName":"Torgny Nyblom","fromEmail":"kde@nyblom.org","sentAt":"2010-09-15T18:09:50Z","receivedAt":"2010-09-15T18:09:50Z","isPatch":false,"sender":{"key":"kde@nyblom.org","avatar":null},"body":"I'm replying here as I just joined the list and missed the original\nmessage.\n\n> On Wednesday 15 September 2010 09:47:42 nolan.ring@emc.com wrote:\n> > When I include the branches in the conversion I get a Build\n> > directory at the top level and then the usual directory structure\n> > of the repo.  Where is the Build dir coming from?  Is svn2git doing\n> > that?  Or is it finding that somewhere somehow in the repo?\n> > \n> > buildadm@suse-s11:/work/POCcs> ls\n> > Build\n> > buildadm@suse-s11:/work/POCcs/Build> ls\n> > Automation  build_cs_rpm.pl  ControlStation  depends.properties\n\nThis is an error in your rule files.\n\n/Regards\nTorgny\n"},{"id":"150872","messageId":"4D8D88A4-FEBF-4FA9-A39F-410D76289E4B@jetbrains.com","threadId":"25109","inReplyTo":"AANLkTikXwKBUKvrNs3ezKWjBh35Y87q6gZKSyZ=1cZyG@mail.gmail.com","subject":"Re: git log --pretty=format joins lines in the subject of commit message","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2010-09-17T11:56:53Z","receivedAt":"2010-09-17T11:56:53Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":"I think that if it is a feature, it should be reflected in the documentation for custom pretty formats.\n\nAnyway, that doesn't seem consistent enough: Git knows that the subject is \"first line\\nsecond line\\nthird line\" (because it shows it correctly in full or raw formats). Why does it join the lines in the custom format's %s? \n\nI know I can just use raw format, I'm just concerned about git log behavior consistency.\n\n\n15.09.2010, в 17:01, Ævar Arnfjörð Bjarmason написал(а):\n\n> On Wed, Sep 15, 2010 at 12:55, Kirill Likhodedov\n> <Kirill.Likhodedov@jetbrains.com> wrote:\n>> Commit something to a git repository with a commit message with several newlines like this:\n>> \n>> ==== commit message starts below ===\n>> first line\n>> second line\n>> third line\n>> \n>> fifth line\n>> === commit message ends above ===\n>> \n>> Git treats the first 3 lines as commit message subject and the last line as its body.\n>> \n>> 'git log' shows the commit message correctly - exactly like I've entered. So does 'git log --pretty=raw'\n>> \n>> But 'git log --pretty=format:%s#%b' joins the first three lines:\n>> first line second line third line#fifth line\n>> \n>> Is it a bug or a feature?\n> \n> It's probably a feature. We delimit the subject by \"\\n\\n\", not\n> \"\\n\". And IIRC subjects in E-Mail can contain \\n.\n> \n>> If it is a feature how can I acquire the original subject of the commit message by using custom format?\n> \n> Use a log format that gives you the complete message, then pipe it\n> through perl or something to parse it?\n\n----------------------------------\nKirill Likhodedov\nJetBrains, Inc\nhttp://www.jetbrains.com\n\"Develop with pleasure!\"\n"},{"id":"150880","messageId":"20100917145522.GB2860@sigill.intra.peff.net","threadId":"25109","inReplyTo":"4D8D88A4-FEBF-4FA9-A39F-410D76289E4B@jetbrains.com","subject":"Re: git log --pretty=format joins lines in the subject of commit message","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-09-17T14:55:22Z","receivedAt":"2010-09-17T14:55:22Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Sep 17, 2010 at 03:56:53PM +0400, Kirill Likhodedov wrote:\n\n> I think that if it is a feature, it should be reflected in the\n> documentation for custom pretty formats.\n\nI agree it should be documented. I'm not sure where, though. The\nsubject-munging affects more than just pretty formats. For example, at\nleast git format-patch also has --keep-subjects to turn off munging. I\nguess a note should be made in a all relevant places.\n\n> Anyway, that doesn't seem consistent enough: Git knows that the\n> subject is \"first line\\nsecond line\\nthird line\" (because it shows it\n> correctly in full or raw formats). Why does it join the lines in the\n> custom format's %s?\n\nBecause then the consumer of \"git log --format=%s\" knows that they will\nget exactly one line per commit.\n\nThe convention in git is to do \"subject\\n\\nbody\", with subject on a\nsingle line. However, we often see commits imported from other version\ncontrol systems without this format. The subject-munging is an attempt\nto make them useful in git-aware tools (e.g., gitk or gitweb, which show\nthe subject). Showing just the first line of a multi-line subject is\noften useless. People complained, and we got the behavior we have today.\n\n-Peff\n"}]}