https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292019-03-29T19:27:23ZRedmineRedmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910002019-03-29T19:27:23ZChad Petersen
<ul></ul><p>The file is {redmineroot}\lib\redmine\scm\adapters\git_adapter.rb</p> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910212019-03-31T04:34:56ZGo MAEDA
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/91021/diff?detail_id=73196">diff</a>)</li></ul> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910222019-03-31T04:40:57ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/22723">31120.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/22723/31120.patch">31120.patch</a> added</li></ul><p>I have generated a patch file from Chad Petersen's post.</p> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910232019-03-31T05:00:36ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li></ul><p>The fixed code looks correct but I was not able to reproduce the situation that 'git branch --no-color --verbose --no-abbrev' outputs a single branch using two or more lines even if the commit log consists of multiple lines.</p>
<p>Could you tell me the operations to make a repository that causes the problem?</p> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910582019-04-01T17:24:19ZChad Petersen
<ul></ul><p>It's a bit of an odd setup. This particular team is using TFS as its source control. So in order to pull it across to git, I'm using the git-TFS integration found here: <a class="external" href="https://github.com/git-tfs/git-tfs">https://github.com/git-tfs/git-tfs</a>. This appends git commit messages with a new line including the TFS commit so you can trace them back.</p> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910592019-04-01T23:58:25ZGo MAEDA
<ul><li><strong>Tracker</strong> changed from <i>Patch</i> to <i>Defect</i></li><li><strong>Subject</strong> changed from <i>Git commit with multi-line comment on a project with more than one branch breaking parser.</i> to <i>Git commit with multi-line comment on a project with more than one branch breaking parser</i></li><li><strong>Status</strong> changed from <i>Needs feedback</i> to <i>New</i></li><li><strong>Target version</strong> set to <i>3.4.11</i></li></ul><p>Chad Petersen wrote:</p>
<blockquote>
<p>It's a bit of an odd setup. This particular team is using TFS as its source control. So in order to pull it across to git, I'm using the git-TFS integration found here: <a class="external" href="https://github.com/git-tfs/git-tfs">https://github.com/git-tfs/git-tfs</a>. This appends git commit messages with a new line including the TFS commit so you can trace them back.</p>
</blockquote>
<p>I understand. Thank you for clarifying.<br />I cannot reproduce the problem because I don't use TFS, but the code after line 86 ('<code>bran = GitBranch...</code>') must not be executed if <code>branch_rev</code> is nil. I am setting the target version to 3.4.11.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index e0c5d4763..0733cbc40 100644
</span><span class="gd">--- a/lib/redmine/scm/adapters/git_adapter.rb
</span><span class="gi">+++ b/lib/redmine/scm/adapters/git_adapter.rb
</span><span class="p">@@ -84,6 +84,7 @@</span> module Redmine
git_cmd(cmd_args) do |io|
io.each_line do |line|
branch_rev = line.match('\s*(\*?)\s*(.*?)\s*([0-9a-f]{40}).*$')
<span class="gi">+ next unless branch_rev
</span> bran = GitBranch.new(branch_rev[2])
bran.revision = branch_rev[3]
bran.scmid = branch_rev[3]
</code></pre> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=910752019-04-02T11:32:13ZGo MAEDA
<ul><li><strong>Subject</strong> changed from <i>Git commit with multi-line comment on a project with more than one branch breaking parser</i> to <i>Multi-line commit message breaks git adapter when parsing branches</i></li></ul> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=911352019-04-07T07:07:07ZGo MAEDA
<ul><li><strong>Subject</strong> changed from <i>Multi-line commit message breaks git adapter when parsing branches</i> to <i>Garbage lines in the output of 'git branch' break git adapter</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fixed in <a class="changeset" title="Garbage lines in the output of 'git branch' break git adapter (#31120). Contributed by Chad Pete..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/18046">r18046</a>. Thank you for your contribution.</p> Redmine - Defect #31120: Garbage lines in the output of 'git branch' break git adapterhttps://www.redmine.org/issues/31120?journal_id=911362019-04-07T07:43:11ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>